react-native-insider 4.4.0 → 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.3.0')
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'
@@ -45,9 +45,5 @@ dependencies {
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
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'
52
48
 
53
49
  }
@@ -355,12 +355,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
355
355
  }
356
356
 
357
357
  @ReactMethod
358
- public void setGDPRConsent(boolean gdprConsent) {
359
- try {
360
- Insider.Instance.setGDPRConsent(gdprConsent);
361
- } catch (Exception e) {
362
- Insider.Instance.putException(e);
363
- }
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
+ });
364
369
  }
365
370
 
366
371
  @ReactMethod
@@ -555,11 +560,16 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
555
560
 
556
561
  @ReactMethod
557
562
  public void startTrackingGeofence() {
558
- try {
559
- Insider.Instance.startTrackingGeofence();
560
- } catch (Exception e) {
561
- Insider.Instance.putException(e);
562
- }
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
+ });
563
573
  }
564
574
 
565
575
  @ReactMethod
@@ -582,10 +592,6 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
582
592
  }
583
593
  String provider = Insider.Instance.getCurrentProvider(reactContext);
584
594
  switch (provider) {
585
- case "huawei":
586
- com.huawei.hms.push.RemoteMessage hmsRemoteMessage = new com.huawei.hms.push.RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
587
- Insider.Instance.handleHMSNotification(reactContext, hmsRemoteMessage);
588
- break;
589
595
  case "other":
590
596
  case "google":
591
597
  RemoteMessage fcmRemoteMessage = new RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
@@ -601,12 +607,17 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
601
607
  }
602
608
 
603
609
  @ReactMethod
604
- public void enableIDFACollection(boolean enableIDFACollection) {
605
- try {
606
- Insider.Instance.enableIDFACollection(enableIDFACollection);
607
- } catch (Exception e) {
608
- Insider.Instance.putException(e);
609
- }
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
+ });
610
621
  }
611
622
 
612
623
  @ReactMethod
@@ -636,4 +647,46 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
636
647
  Insider.Instance.putException(e);
637
648
  }
638
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
+ }
639
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.4.0",
3
+ "version": "4.4.1-nh",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -1,4 +0,0 @@
1
- 4.4.0 RELEASE
2
-
3
- Updated Android to 12.3.0
4
- SDK inititalization in the main thread