react-native-insider 4.3.1-nh → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNInsider.podspec +2 -2
- package/android/build.gradle +6 -2
- package/android/src/main/java/com/useinsider/react/RNInsiderModule.java +109 -34
- package/changelog/4.4.1.md +4 -0
- package/index.js +30 -0
- package/ios/RNInsider/RNInsider.m +24 -0
- package/package.json +1 -1
- package/changelog/4.3.1-nh.md +0 -5
package/RNInsider.podspec
CHANGED
|
@@ -9,11 +9,11 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.authors = package_json['author']
|
|
10
10
|
s.license = 'MIT'
|
|
11
11
|
s.platform = :ios, '10.0'
|
|
12
|
-
s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/11.3.
|
|
12
|
+
s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/11.3.3/InsiderMobileIOSFramework.zip'}
|
|
13
13
|
s.source_files = 'ios/RNInsider/*.{h,m}'
|
|
14
14
|
s.requires_arc = true
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
s.dependency 'React'
|
|
17
|
-
s.dependency 'InsiderMobile', '11.3.
|
|
17
|
+
s.dependency 'InsiderMobile', '11.3.3'
|
|
18
18
|
s.dependency 'InsiderHybrid', '1.1.2'
|
|
19
19
|
end
|
package/android/build.gradle
CHANGED
|
@@ -36,7 +36,7 @@ android {
|
|
|
36
36
|
|
|
37
37
|
dependencies {
|
|
38
38
|
implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
|
|
39
|
-
implementation ('com.useinsider:insider:12.
|
|
39
|
+
implementation ('com.useinsider:insider:12.3.1')
|
|
40
40
|
implementation ('com.useinsider:insiderhybrid:1.1.3')
|
|
41
41
|
|
|
42
42
|
implementation 'com.google.android.play:core:1.10.1'
|
|
@@ -44,6 +44,10 @@ dependencies {
|
|
|
44
44
|
implementation 'com.google.android.gms:play-services-location:17.0.0'
|
|
45
45
|
implementation 'com.google.firebase:firebase-messaging:20.0.0'
|
|
46
46
|
implementation 'com.google.android.gms:play-services-ads:16.0.0'
|
|
47
|
-
implementation 'androidx.lifecycle:lifecycle-process:2.
|
|
47
|
+
implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
|
|
48
|
+
|
|
49
|
+
implementation 'com.huawei.hms:push:5.3.0.304'
|
|
50
|
+
implementation 'com.huawei.hms:ads-identifier:3.4.34.301'
|
|
51
|
+
implementation 'com.huawei.hms:location:4.0.4.300'
|
|
48
52
|
|
|
49
53
|
}
|
|
@@ -2,6 +2,8 @@ package com.useinsider.react;
|
|
|
2
2
|
|
|
3
3
|
import android.app.Application;
|
|
4
4
|
|
|
5
|
+
import android.os.Handler;
|
|
6
|
+
import android.os.Looper;
|
|
5
7
|
import com.facebook.react.bridge.Callback;
|
|
6
8
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
9
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
@@ -32,6 +34,7 @@ import java.util.Map;
|
|
|
32
34
|
public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
33
35
|
|
|
34
36
|
private final ReactApplicationContext reactContext;
|
|
37
|
+
private boolean isCoreInited = false;
|
|
35
38
|
|
|
36
39
|
public RNInsiderModule(ReactApplicationContext reactContext) {
|
|
37
40
|
super(reactContext);
|
|
@@ -53,31 +56,42 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
@ReactMethod
|
|
56
|
-
public void init(String partnerName, String sdkVersion) {
|
|
59
|
+
public void init(final String partnerName, final String sdkVersion) {
|
|
57
60
|
try {
|
|
58
61
|
if (Insider.Instance.isSDKInitialized()) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
Insider.Instance.setSDKType("react-native");
|
|
63
|
-
Insider.Instance.setHybridSDKVersion(sdkVersion);
|
|
64
|
-
Insider.Instance.resumeSession(reactContext.getCurrentActivity());
|
|
65
|
-
Insider.Instance.registerInsiderCallback(new InsiderCallback() {
|
|
66
|
-
DeviceEventManagerModule.RCTDeviceEventEmitter emitter = getReactApplicationContext()
|
|
67
|
-
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
|
|
68
|
-
|
|
64
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
69
65
|
@Override
|
|
70
|
-
public void
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
public void run() {
|
|
67
|
+
Insider.Instance.init(((Application) reactContext.getApplicationContext()), partnerName);
|
|
68
|
+
Insider.Instance.setSDKType("react-native");
|
|
69
|
+
Insider.Instance.setHybridSDKVersion(sdkVersion);
|
|
70
|
+
|
|
71
|
+
Insider.Instance.resumeSessionHybridReactConfig(reactContext.getCurrentActivity());
|
|
72
|
+
if (isCoreInited) {
|
|
73
|
+
Insider.Instance.resumeSessionHybridReactRequestConfig();
|
|
76
74
|
}
|
|
75
|
+
isCoreInited = true;
|
|
76
|
+
|
|
77
|
+
Insider.Instance.registerInsiderCallback(new InsiderCallback() {
|
|
78
|
+
DeviceEventManagerModule.RCTDeviceEventEmitter emitter = getReactApplicationContext()
|
|
79
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
|
|
80
|
+
|
|
81
|
+
@Override
|
|
82
|
+
public void doAction(JSONObject jsonObject, InsiderCallbackType insiderCallbackType) {
|
|
83
|
+
try {
|
|
84
|
+
WritableMap callbackData = RNUtils.convertJSONObjectToMap(jsonObject);
|
|
85
|
+
emitter.emit(insiderCallbackType.name(), callbackData);
|
|
86
|
+
} catch (Exception e) {
|
|
87
|
+
Insider.Instance.putException(e);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Insider.Instance.handleHybridIntent();
|
|
92
|
+
Insider.Instance.storePartnerName(partnerName);
|
|
77
93
|
}
|
|
78
94
|
});
|
|
79
|
-
Insider.Instance.handleHybridIntent();
|
|
80
|
-
Insider.Instance.storePartnerName(partnerName);
|
|
81
95
|
} catch (Exception e) {
|
|
82
96
|
Insider.Instance.putException(e);
|
|
83
97
|
}
|
|
@@ -341,12 +355,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
341
355
|
}
|
|
342
356
|
|
|
343
357
|
@ReactMethod
|
|
344
|
-
public void setGDPRConsent(boolean gdprConsent) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
358
|
+
public void setGDPRConsent(final boolean gdprConsent) {
|
|
359
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
360
|
+
@Override
|
|
361
|
+
public void run() {
|
|
362
|
+
try {
|
|
363
|
+
Insider.Instance.setGDPRConsent(gdprConsent);
|
|
364
|
+
} catch (Exception e) {
|
|
365
|
+
Insider.Instance.putException(e);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
});
|
|
350
369
|
}
|
|
351
370
|
|
|
352
371
|
@ReactMethod
|
|
@@ -541,11 +560,16 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
541
560
|
|
|
542
561
|
@ReactMethod
|
|
543
562
|
public void startTrackingGeofence() {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
563
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
564
|
+
@Override
|
|
565
|
+
public void run() {
|
|
566
|
+
try {
|
|
567
|
+
Insider.Instance.startTrackingGeofence();
|
|
568
|
+
} catch (Exception e) {
|
|
569
|
+
Insider.Instance.putException(e);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
});
|
|
549
573
|
}
|
|
550
574
|
|
|
551
575
|
@ReactMethod
|
|
@@ -568,6 +592,10 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
568
592
|
}
|
|
569
593
|
String provider = Insider.Instance.getCurrentProvider(reactContext);
|
|
570
594
|
switch (provider) {
|
|
595
|
+
case "huawei":
|
|
596
|
+
com.huawei.hms.push.RemoteMessage hmsRemoteMessage = new com.huawei.hms.push.RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
|
|
597
|
+
Insider.Instance.handleHMSNotification(reactContext, hmsRemoteMessage);
|
|
598
|
+
break;
|
|
571
599
|
case "other":
|
|
572
600
|
case "google":
|
|
573
601
|
RemoteMessage fcmRemoteMessage = new RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
|
|
@@ -583,12 +611,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
583
611
|
}
|
|
584
612
|
|
|
585
613
|
@ReactMethod
|
|
586
|
-
public void enableIDFACollection(boolean enableIDFACollection) {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
614
|
+
public void enableIDFACollection(final boolean enableIDFACollection) {
|
|
615
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
616
|
+
@Override
|
|
617
|
+
public void run() {
|
|
618
|
+
try {
|
|
619
|
+
Insider.Instance.enableIDFACollection(enableIDFACollection);
|
|
620
|
+
} catch (Exception e) {
|
|
621
|
+
Insider.Instance.putException(e);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
});
|
|
592
625
|
}
|
|
593
626
|
|
|
594
627
|
@ReactMethod
|
|
@@ -618,4 +651,46 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
|
|
|
618
651
|
Insider.Instance.putException(e);
|
|
619
652
|
}
|
|
620
653
|
}
|
|
654
|
+
|
|
655
|
+
@ReactMethod
|
|
656
|
+
public void enableLocationCollection(final boolean consentStatus) {
|
|
657
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
658
|
+
@Override
|
|
659
|
+
public void run() {
|
|
660
|
+
try {
|
|
661
|
+
Insider.Instance.enableLocationCollection(consentStatus);
|
|
662
|
+
} catch (Exception e) {
|
|
663
|
+
Insider.Instance.putException(e);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
@ReactMethod
|
|
670
|
+
public void enableIpCollection(final boolean consentStatus) {
|
|
671
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
672
|
+
@Override
|
|
673
|
+
public void run() {
|
|
674
|
+
try {
|
|
675
|
+
Insider.Instance.enableIpCollection(consentStatus);
|
|
676
|
+
} catch (Exception e) {
|
|
677
|
+
Insider.Instance.putException(e);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
@ReactMethod
|
|
684
|
+
public void enableCarrierCollection(final boolean consentStatus) {
|
|
685
|
+
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
686
|
+
@Override
|
|
687
|
+
public void run() {
|
|
688
|
+
try {
|
|
689
|
+
Insider.Instance.enableCarrierCollection(consentStatus);
|
|
690
|
+
} catch (Exception e) {
|
|
691
|
+
Insider.Instance.putException(e);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
}
|
|
621
696
|
}
|
package/index.js
CHANGED
|
@@ -322,4 +322,34 @@ export default class RNInsider {
|
|
|
322
322
|
Insider.putErrorLog(generateJSONErrorString(error));
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
+
|
|
326
|
+
static enableLocationCollection (consentStatus) {
|
|
327
|
+
if (shouldNotProceed()) return;
|
|
328
|
+
|
|
329
|
+
try {
|
|
330
|
+
Insider.enableLocationCollection(consentStatus);
|
|
331
|
+
} catch (error) {
|
|
332
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
static enableIpCollection (consentStatus) {
|
|
337
|
+
if (shouldNotProceed()) return;
|
|
338
|
+
|
|
339
|
+
try {
|
|
340
|
+
Insider.enableIpCollection(consentStatus);
|
|
341
|
+
} catch (error) {
|
|
342
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
static enableCarrierCollection (consentStatus) {
|
|
347
|
+
if (shouldNotProceed()) return;
|
|
348
|
+
|
|
349
|
+
try {
|
|
350
|
+
Insider.enableCarrierCollection(consentStatus);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
Insider.putErrorLog(generateJSONErrorString(error));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
325
355
|
}
|
|
@@ -460,6 +460,30 @@ RCT_EXPORT_METHOD(showNativeAppReview) {
|
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
+
RCT_EXPORT_METHOD(enableLocationCollection:(BOOL)enabled) {
|
|
464
|
+
@try {
|
|
465
|
+
[Insider enableLocationCollection:enabled];
|
|
466
|
+
} @catch (NSException *e){
|
|
467
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
RCT_EXPORT_METHOD(enableIpCollection:(BOOL)enabled) {
|
|
472
|
+
@try {
|
|
473
|
+
[Insider enableIpCollection:enabled];
|
|
474
|
+
} @catch (NSException *e){
|
|
475
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
RCT_EXPORT_METHOD(enableCarrierCollection:(BOOL)enabled) {
|
|
480
|
+
@try {
|
|
481
|
+
[Insider enableCarrierCollection:enabled];
|
|
482
|
+
} @catch (NSException *e){
|
|
483
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
463
487
|
-(void)emitEvent:(NSDictionary *)evetData {
|
|
464
488
|
@try {
|
|
465
489
|
RNNotificationHandler *handler = [[RNNotificationHandler alloc] init];
|
package/package.json
CHANGED