@@ -96,18 +96,25 @@ public boolean launchReceivedDeeplink(Uri uri) {
96
96
97
97
@ ReactMethod
98
98
public void create (ReadableMap mapConfig ) {
99
- String environment = null ;
100
- String appToken = null ;
101
- String defaultTracker = null ;
102
- String processName = null ;
103
- String sdkPrefix = null ;
104
- String logLevel = null ;
105
- boolean eventBufferingEnabled = false ;
106
- String userAgent = null ;
107
- boolean sendInBackground = false ;
108
- boolean shouldLaunchDeeplink = false ;
109
- double delayStart = 0.0 ;
110
- boolean isLogLevelSuppress = false ;
99
+ String environment = null ;
100
+ String appToken = null ;
101
+ String defaultTracker = null ;
102
+ String processName = null ;
103
+ String sdkPrefix = null ;
104
+ String logLevel = null ;
105
+ boolean eventBufferingEnabled = false ;
106
+ String userAgent = null ;
107
+ long secretId = 0L ;
108
+ long info1 = 0L ;
109
+ long info2 = 0L ;
110
+ long info3 = 0L ;
111
+ long info4 = 0L ;
112
+ boolean sendInBackground = false ;
113
+ boolean shouldLaunchDeeplink = false ;
114
+ double delayStart = 0.0 ;
115
+ boolean isLogLevelSuppress = false ;
116
+ boolean isDeviceKnown = false ;
117
+ boolean readMobileEquipmentIdentity = false ;
111
118
112
119
// Check for isLogLevelSuppress.
113
120
if (!mapConfig .isNull ("logLevel" )) {
@@ -181,12 +188,40 @@ public void create(ReadableMap mapConfig) {
181
188
adjustConfig .setUserAgent (userAgent );
182
189
}
183
190
191
+ // App secret
192
+ if (!mapConfig .isNull ("secretId" )
193
+ && !mapConfig .isNull ("info1" )
194
+ && !mapConfig .isNull ("info2" )
195
+ && !mapConfig .isNull ("info3" )
196
+ && !mapConfig .isNull ("info4" )) {
197
+ try {
198
+ secretId = Long .parseLong (mapConfig .getString ("secretId" ), 10 );
199
+ info1 = Long .parseLong (mapConfig .getString ("info1" ), 10 );
200
+ info2 = Long .parseLong (mapConfig .getString ("info2" ), 10 );
201
+ info3 = Long .parseLong (mapConfig .getString ("info3" ), 10 );
202
+ info4 = Long .parseLong (mapConfig .getString ("info4" ), 10 );
203
+ adjustConfig .setAppSecret (secretId , info1 , info2 , info3 , info4 );
204
+ } catch (NumberFormatException ignore ) { }
205
+ }
206
+
184
207
// Background tracking
185
208
if (!mapConfig .isNull ("sendInBackground" )) {
186
209
sendInBackground = mapConfig .getBoolean ("sendInBackground" );
187
210
adjustConfig .setSendInBackground (sendInBackground );
188
211
}
189
212
213
+ // Set device Known
214
+ if (!mapConfig .isNull ("isDeviceKnown" )) {
215
+ isDeviceKnown = mapConfig .getBoolean ("isDeviceKnown" );
216
+ adjustConfig .setDeviceKnown (isDeviceKnown );
217
+ }
218
+
219
+ // Set read mobile equipment id
220
+ if (!mapConfig .isNull ("readMobileEquipmentIdentity" )) {
221
+ readMobileEquipmentIdentity = mapConfig .getBoolean ("readMobileEquipmentIdentity" );
222
+ adjustConfig .setReadMobileEquipmentIdentity (readMobileEquipmentIdentity );
223
+ }
224
+
190
225
// Launching deferred deep link
191
226
if (!mapConfig .isNull ("shouldLaunchDeeplink" )) {
192
227
shouldLaunchDeeplink = mapConfig .getBoolean ("shouldLaunchDeeplink" );
@@ -280,7 +315,9 @@ public void isEnabled(Callback callback) {
280
315
281
316
@ ReactMethod
282
317
public void setReferrer (String referrer ) {
283
- com .adjust .sdk .Adjust .setReferrer (referrer );
318
+ com .adjust .sdk .Adjust .setReferrer (
319
+ referrer ,
320
+ getReactApplicationContext ());
284
321
}
285
322
286
323
@ ReactMethod
@@ -354,6 +391,11 @@ public void getAdid(Callback callback) {
354
391
callback .invoke (com .adjust .sdk .Adjust .getAdid ());
355
392
}
356
393
394
+ @ ReactMethod
395
+ public void getAmazonAdId (Callback callback ) {
396
+ callback .invoke (com .adjust .sdk .Adjust .getAmazonAdId (getReactApplicationContext ()));
397
+ }
398
+
357
399
@ ReactMethod
358
400
public void getAttribution (Callback callback ) {
359
401
callback .invoke (AdjustUtil .attributionToMap (com .adjust .sdk .Adjust .getAttribution ()));
0 commit comments