cordova-plugin-insider 1.8.0 → 2.0.0

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/SECURITY.MD ADDED
@@ -0,0 +1,7 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ To securely report a vulnerability, please [Contact us!](mailto:security@useinsider.com?subject=[GitHub]_Vulnerability!).
6
+
7
+ <!-- E26CADE3-DF7C-4FF8-A30A-4DD2F28E06BF -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-insider",
3
- "version": "1.8.0",
3
+ "version": "2.0.0",
4
4
  "description": "A plugin that you can use Insider SDK with Cordova and Ionic",
5
5
  "cordova_name": "Insider Cordova Plugin",
6
6
  "cordova": {
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-plugin-insider" version="1.8.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <plugin id="cordova-plugin-insider" version="2.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
3
3
  <name>Insider</name>
4
4
  <description>Insider Cordova Plugin</description>
5
5
  <keywords>insider,cordova,cordova-ios,cordova-android</keywords>
@@ -70,7 +70,7 @@
70
70
  <source url="https://cdn.cocoapods.org/" />
71
71
  </config>
72
72
  <pods use-frameworks="true">
73
- <pod name="InsiderMobile" spec="13.2.2" />
73
+ <pod name="InsiderMobile" spec="13.4.0" />
74
74
  <pod name="InsiderGeofence" spec="1.1.0" />
75
75
  <pod name="InsiderHybrid" spec="1.4.0" />
76
76
  </pods>
@@ -637,6 +637,18 @@ public class InsiderPlugin extends CordovaPlugin {
637
637
  return true;
638
638
  } else if (action.equals("signUpConfirmation")) {
639
639
  Insider.Instance.signUpConfirmation();
640
+ } else if (action.equals("setPushToken")) {
641
+ Insider.Instance.setPushToken(args.getString(0));
642
+ } else if (action.equals("setEmail")) {
643
+ if (args.get(0) == null)
644
+ return false;
645
+
646
+ Insider.Instance.getCurrentUser().setEmail(args.getString(0));
647
+ } else if (action.equals("setPhoneNumber")) {
648
+ if (args.get(0) == null)
649
+ return false;
650
+
651
+ Insider.Instance.getCurrentUser().setPhoneNumber(args.getString(0));
640
652
  } else {
641
653
  return false;
642
654
  }
@@ -16,7 +16,7 @@ android {
16
16
  }
17
17
 
18
18
  dependencies {
19
- implementation 'com.useinsider:insider:14.1.1'
19
+ implementation 'com.useinsider:insider:14.2.2'
20
20
  implementation 'com.useinsider:insiderhybrid:1.1.6'
21
21
 
22
22
  implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
@@ -27,11 +27,11 @@ dependencies {
27
27
 
28
28
  implementation 'com.google.android.gms:play-services-location:21.0.1'
29
29
  implementation 'com.google.firebase:firebase-messaging:23.0.5'
30
- implementation 'com.google.android.play:core-ktx:1.8.1'
30
+ implementation 'com.google.android.play:review:2.0.1'
31
31
 
32
32
  implementation 'com.huawei.hms:push:6.5.0.300'
33
33
  implementation 'com.huawei.hms:ads-identifier:3.4.39.302'
34
34
  implementation 'com.huawei.hms:location:6.4.0.300'
35
-
36
- implementation 'androidx.security:security-crypto:1.0.0'
35
+
36
+ implementation 'androidx.security:security-crypto:1.1.0-alpha06'
37
37
  }
@@ -40,7 +40,9 @@
40
40
  - (void) setAge:(CDVInvokedUrlCommand *)command;
41
41
  - (void) setSMSOptin:(CDVInvokedUrlCommand *)command;
42
42
  - (void) setEmailOptin:(CDVInvokedUrlCommand *)command;
43
+ - (void) setEmail:(CDVInvokedUrlCommand *)command;
43
44
  - (void) setPushOptin:(CDVInvokedUrlCommand *)command;
45
+ - (void) setPhoneNumber:(CDVInvokedUrlCommand *)command;
44
46
  - (void) setLocationOptin:(CDVInvokedUrlCommand *)command;
45
47
  - (void) setWhatsappOptin:(CDVInvokedUrlCommand *)command;
46
48
  - (void) setLocale:(CDVInvokedUrlCommand *)command;
@@ -507,6 +507,16 @@
507
507
  }
508
508
  }
509
509
 
510
+ - (void)setPhoneNumber:(CDVInvokedUrlCommand *)command {
511
+ @try {
512
+ if (![command.arguments objectAtIndex:0]) return;
513
+
514
+ [Insider getCurrentUser].setPhoneNumber([command.arguments objectAtIndex:0]);
515
+ } @catch (NSException *e) {
516
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
517
+ }
518
+ }
519
+
510
520
  - (void)setEmailOptin:(CDVInvokedUrlCommand *)command {
511
521
  @try {
512
522
  if (![command.arguments objectAtIndex:0]) return;
@@ -516,6 +526,16 @@
516
526
  }
517
527
  }
518
528
 
529
+ - (void)setEmail:(CDVInvokedUrlCommand *)command {
530
+ @try {
531
+ if (![command.arguments objectAtIndex:0]) return;
532
+
533
+ [Insider getCurrentUser].setEmail([command.arguments objectAtIndex:0]);
534
+ } @catch (NSException *e) {
535
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
536
+ }
537
+ }
538
+
519
539
  - (void)setPushOptin:(CDVInvokedUrlCommand *)command {
520
540
  @try {
521
541
  if (![command.arguments objectAtIndex:0]) return;
@@ -674,12 +694,9 @@
674
694
  [[Insider getCurrentUser] login:insiderIdentifiers insiderIDResult:^(NSString *insiderID) {
675
695
  [self sendSuccessResultWithString:insiderID andCommand:command];
676
696
  }];
697
+ } else {
698
+ [[Insider getCurrentUser] login:insiderIdentifiers];
677
699
  }
678
-
679
- InsiderUser* currentUser = [Insider getCurrentUser];
680
-
681
- [currentUser login:insiderIdentifiers];
682
-
683
700
  });
684
701
  } @catch (NSException *e) {
685
702
  [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
@@ -33,7 +33,7 @@ interface InsiderPlugin {
33
33
  enableIDFACollection(idfaCollection: boolean): void;
34
34
  removeInapp(): void;
35
35
  registerWithQuietPermission(booleanValue: boolean): void;
36
- setHybridPushToken(token: string): void;
36
+ setPushToken(token: string): void;
37
37
  enableLocationCollection(locationCollection: boolean): void;
38
38
  enableIpCollection(ipCollection: boolean): void;
39
39
  enableCarrierCollection(carrierCollection: boolean): void;
package/www/Constants.js CHANGED
@@ -55,7 +55,7 @@ module.exports = {
55
55
  SET_GDPR_CONSENT: 'setGDPRConsent',
56
56
  REMOVE_IN_APP: 'removeInapp',
57
57
  REGISTER_WITH_QUIET_PERMISSION: 'registerWithQuietPermission',
58
- SET_HYBRID_PUSH_TOKEN: 'setHybridPushToken',
58
+ SET_HYBRID_PUSH_TOKEN: 'setPushToken',
59
59
  ENABLE_IDFA_COLLECTION: 'enableIDFACollection',
60
60
  ENABLE_LOCATION_COLLECTION: 'enableLocationCollection',
61
61
  ENABLE_IP_COLLECTION: 'enableIpCollection',
@@ -86,5 +86,5 @@ module.exports = {
86
86
  // Reinit
87
87
  REINIT_WITH_PARTNER_NAME: 'reinitWithPartnerName',
88
88
  // SDK Version
89
- SDK_VERSION: 'CDV-1.8.0',
89
+ SDK_VERSION: 'CDV-2.0.0',
90
90
  };
@@ -410,14 +410,14 @@ class InsiderPlugin {
410
410
  }
411
411
  };
412
412
 
413
- setHybridPushToken = (token) => {
413
+ setPushToken = (token) => {
414
414
  if (Utils.checkParameters([{ type: 'string', value: token }])) {
415
- Utils.showParameterWarningLog(this.constructor.name + '-setHybridPushToken');
415
+ Utils.showParameterWarningLog(this.constructor.name + '-setPushToken');
416
416
  return;
417
417
  }
418
418
 
419
419
  try {
420
- if (Platform.OS !== InsiderConstants.ANDROID) return;
420
+ if (cordova.platformId !== InsiderConstants.ANDROID) return;
421
421
 
422
422
  Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.SET_HYBRID_PUSH_TOKEN, [token]);
423
423
  } catch (error) {