Skip to content

Commit d9ce583

Browse files
authored
Update README.md
1 parent fae076e commit d9ce583

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ $ react-native link
6767

6868
For **iOS**, you don't need to do anything else.
6969

70-
For **Android**, you need to include the native module's package manually.
70+
For **Android**, you need to check if adjust package was added to the native module's package list.
7171

7272
- Go to your app's `MainApplication.java` class. It should be located in
7373
`./android/app/src/main/java/[your app]/MainApplication.java`
74+
7475
- There is a method called `getPackages()` that looks like this by default:
7576
```java
7677
@Override
@@ -80,8 +81,14 @@ protected List<ReactPackage> getPackages() {
8081
);
8182
}
8283
```
83-
- You'll have to add the `new AdjustPackage()` to the list of packages like this:
84+
85+
- After adding adjust SDK via `npm` and running `react-native link` command, adjust package should be added autoatically to
86+
this list and it should look something like this:
8487
```java
88+
import com.adjust.nativemodule.AdjustPackage;
89+
90+
// ...
91+
8592
@Override
8693
protected List<ReactPackage> getPackages() {
8794
return Arrays.<ReactPackage>asList(
@@ -90,7 +97,9 @@ protected List<ReactPackage> getPackages() {
9097
);
9198
}
9299
```
93-
- Also, don't forget to add the import statement on top of the `MainApplication.java` file:
100+
101+
- In case that the line `new AdjustPackage()` was not added automatically, you'll have to add it to the list of packages by
102+
yourself like described above. Also, don't forget to add the import statement on top of the `MainApplication.java` file:
94103
```
95104
import com.adjust.nativemodule.AdjustPackage;
96105
```

0 commit comments

Comments
 (0)