Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ AppRegistry.registerComponent('testProject', () => appStack);

Event listener will work fine when your app is in background or foreground. If it is not running, to capture the first event we need to do some extra work. Make the following changes in your `MainActivity.java` file of React Native app,

```diff
```
package com.yourpackage;

+import android.os.Bundle;
import android.os.Bundle; // <-- Add this import
import com.facebook.react.ReactActivity;
+import com.codegulp.invokeapp.RNInvokeApp;
import com.codegulp.invokeapp.RNInvokeApp; // <-- Add this import

public class MainActivity extends ReactActivity {
/**
Expand All @@ -119,11 +119,11 @@ public class MainActivity extends ReactActivity {
return "testProject";
}

+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ RNInvokeApp.sendEvent();
+ }
@Override // <-- Add this function
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RNInvokeApp.sendEvent();
}
}
```

Expand Down