@@ -67,10 +67,11 @@ $ react-native link
67
67
68
68
For ** iOS** , you don't need to do anything else.
69
69
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 .
71
71
72
72
- Go to your app's ` MainApplication.java ` class. It should be located in
73
73
` ./android/app/src/main/java/[your app]/MainApplication.java `
74
+
74
75
- There is a method called ` getPackages() ` that looks like this by default:
75
76
``` java
76
77
@Override
@@ -80,8 +81,14 @@ protected List<ReactPackage> getPackages() {
80
81
);
81
82
}
82
83
```
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:
84
87
``` java
88
+ import com.adjust.nativemodule.AdjustPackage ;
89
+
90
+ // ...
91
+
85
92
@Override
86
93
protected List<ReactPackage > getPackages() {
87
94
return Arrays . < ReactPackage > asList(
@@ -90,7 +97,9 @@ protected List<ReactPackage> getPackages() {
90
97
);
91
98
}
92
99
```
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:
94
103
```
95
104
import com.adjust.nativemodule.AdjustPackage;
96
105
```
0 commit comments