Skip to content

Commit 7212976

Browse files
committed
Improved Android setup instructions
1 parent fd3da27 commit 7212976

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ These instructions are for Swift 3. Please note that Swift 2 is deprecated.
227227

228228
### Android project
229229

230-
Add RNBranchPackage to packages list in MainApplication.java (`android/app/src/[...]/MainApplication.java`)
230+
Add RNBranchPackage to packages list in `getPackages()` MainApplication.java (`android/app/src/[...]/MainApplication.java`).
231+
Note that this is automatically done if you used `react-native link`.
232+
233+
Also add a call to `Branch.getAutoinstance()` in `onCreate()` in the same source file. This has to be
234+
done even if you used `react-native link`.
231235
```java
232236
// ...
233237
@@ -254,7 +258,8 @@ import io.branch.referral.Branch;
254258
}
255259
```
256260

257-
Override onStart and onNewIntent in MainActivity.java to handle Branch links (`android/app/src/[...]/MainActivity.java`)
261+
Override onStart and onNewIntent in MainActivity.java to handle Branch links (`android/app/src/[...]/MainActivity.java`).
262+
This has to be done regardless whether you used `react-native link`.
258263
```java
259264
import io.branch.rnbranch.*; // <-- add this
260265
import android.content.Intent; // <-- and this

0 commit comments

Comments
 (0)