react-native-insider 4.3.1-nh → 4.4.1-nh

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 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.2/InsiderMobileIOSFramework.zip'}
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.2'
17
+ s.dependency 'InsiderMobile', '11.3.3'
18
18
  s.dependency 'InsiderHybrid', '1.1.2'
19
19
  end
@@ -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.2.2-nh')
39
+ implementation ('com.useinsider:insider:12.3.1-nh')
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,6 @@ 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.2.0'
47
+ implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
48
48
 
49
49
  }
@@ -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
- Insider.Instance.init(((Application) reactContext.getApplicationContext()), partnerName);
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 doAction(JSONObject jsonObject, InsiderCallbackType insiderCallbackType) {
71
- try {
72
- WritableMap callbackData = RNUtils.convertJSONObjectToMap(jsonObject);
73
- emitter.emit(insiderCallbackType.name(), callbackData);
74
- } catch (Exception e) {
75
- Insider.Instance.putException(e);
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
- try {
346
- Insider.Instance.setGDPRConsent(gdprConsent);
347
- } catch (Exception e) {
348
- Insider.Instance.putException(e);
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
- try {
545
- Insider.Instance.startTrackingGeofence();
546
- } catch (Exception e) {
547
- Insider.Instance.putException(e);
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
@@ -583,12 +607,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
583
607
  }
584
608
 
585
609
  @ReactMethod
586
- public void enableIDFACollection(boolean enableIDFACollection) {
587
- try {
588
- Insider.Instance.enableIDFACollection(enableIDFACollection);
589
- } catch (Exception e) {
590
- Insider.Instance.putException(e);
591
- }
610
+ public void enableIDFACollection(final boolean enableIDFACollection) {
611
+ new Handler(Looper.getMainLooper()).post(new Runnable() {
612
+ @Override
613
+ public void run() {
614
+ try {
615
+ Insider.Instance.enableIDFACollection(enableIDFACollection);
616
+ } catch (Exception e) {
617
+ Insider.Instance.putException(e);
618
+ }
619
+ }
620
+ });
592
621
  }
593
622
 
594
623
  @ReactMethod
@@ -618,4 +647,46 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
618
647
  Insider.Instance.putException(e);
619
648
  }
620
649
  }
650
+
651
+ @ReactMethod
652
+ public void enableLocationCollection(final boolean consentStatus) {
653
+ new Handler(Looper.getMainLooper()).post(new Runnable() {
654
+ @Override
655
+ public void run() {
656
+ try {
657
+ Insider.Instance.enableLocationCollection(consentStatus);
658
+ } catch (Exception e) {
659
+ Insider.Instance.putException(e);
660
+ }
661
+ }
662
+ });
663
+ }
664
+
665
+ @ReactMethod
666
+ public void enableIpCollection(final boolean consentStatus) {
667
+ new Handler(Looper.getMainLooper()).post(new Runnable() {
668
+ @Override
669
+ public void run() {
670
+ try {
671
+ Insider.Instance.enableIpCollection(consentStatus);
672
+ } catch (Exception e) {
673
+ Insider.Instance.putException(e);
674
+ }
675
+ }
676
+ });
677
+ }
678
+
679
+ @ReactMethod
680
+ public void enableCarrierCollection(final boolean consentStatus) {
681
+ new Handler(Looper.getMainLooper()).post(new Runnable() {
682
+ @Override
683
+ public void run() {
684
+ try {
685
+ Insider.Instance.enableCarrierCollection(consentStatus);
686
+ } catch (Exception e) {
687
+ Insider.Instance.putException(e);
688
+ }
689
+ }
690
+ });
691
+ }
621
692
  }
@@ -0,0 +1,4 @@
1
+ 4.4.1-nh RELEASE
2
+
3
+ Updated Android to 12.3.1-nh
4
+ MOB-10656 | Location, IP, Carrier made optional
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "4.3.1-nh",
3
+ "version": "4.4.1-nh",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -1,5 +0,0 @@
1
- 4.3.1-nh RELEASE
2
-
3
- MOB-10418 | Remove Deprecated DeviceEmitter
4
- set Android version 12.2.2-nh
5
- set ios version to 11.3.2