cordova-plugin-insider 2.4.1 → 3.0.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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2016 Insider
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <sourceFolder url="file://$MODULE_DIR$/src/android" isTestSource="false" packagePrefix="com.useinsider.cordova" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-insider",
3
- "version": "2.4.1",
3
+ "version": "3.0.1",
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": {
@@ -26,5 +26,8 @@
26
26
  "@babel/cli": "^7.27.2",
27
27
  "@babel/core": "^7.27.4",
28
28
  "@babel/preset-env": "^7.27.2"
29
+ },
30
+ "dependencies": {
31
+ "babel": "^6.23.0"
29
32
  }
30
33
  }
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-plugin-insider" version="2.4.1" 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="3.0.1" 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,9 +70,9 @@
70
70
  <source url="https://cdn.cocoapods.org/" />
71
71
  </config>
72
72
  <pods use-frameworks="true">
73
- <pod name="InsiderMobile" spec="13.12.1" />
74
- <pod name="InsiderGeofence" spec="1.2.0" />
75
- <pod name="InsiderHybrid" spec="1.7.3" />
73
+ <pod name="InsiderMobile" spec="14.0.4" />
74
+ <pod name="InsiderGeofence" spec="1.2.3" />
75
+ <pod name="InsiderHybrid" spec="1.7.5" />
76
76
  </pods>
77
77
  </podspec>
78
78
 
@@ -1018,7 +1018,10 @@ public class InsiderPlugin extends CordovaPlugin {
1018
1018
  product.setCustomAttributeWithDate(key, (Date) value);
1019
1019
  break;
1020
1020
  case "String[]":
1021
- product.setCustomAttributeWithArray(key, (String[]) value);
1021
+ product.setCustomAttributeWithStringArray(key, (String[]) value);
1022
+ break;
1023
+ case "Number[]":
1024
+ product.setCustomAttributeWithNumericArray(key, (Number[]) value);
1022
1025
  break;
1023
1026
  default:
1024
1027
  break;
@@ -16,8 +16,8 @@ android {
16
16
  }
17
17
 
18
18
  dependencies {
19
- implementation 'com.useinsider:insider:14.10.6'
20
- implementation 'com.useinsider:insiderhybrid:1.3.2'
19
+ implementation 'com.useinsider:insider:15.1.3'
20
+ implementation 'com.useinsider:insiderhybrid:1.3.3'
21
21
 
22
22
  implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
23
23
  implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.4'
@@ -31,7 +31,7 @@ dependencies {
31
31
  implementation 'com.google.firebase:firebase-messaging:24.0.0'
32
32
  implementation 'com.google.android.play:review:2.0.1'
33
33
 
34
- implementation 'com.huawei.hms:push:6.12.0.300'
34
+ implementation 'com.huawei.hms:push:6.13.0.300'
35
35
  implementation 'com.huawei.hms:ads-identifier:3.4.62.300'
36
- implementation 'com.huawei.hms:location:6.11.0.301'
36
+ implementation 'com.huawei.hms:location:6.16.0.302'
37
37
  }
@@ -36,7 +36,7 @@
36
36
  [Insider registerInsiderCallbackWithSelector:@selector(registerCallback:) sender:self];
37
37
  [Insider setHybridSDKVersion:[command.arguments objectAtIndex:1]];
38
38
  [Insider initWithLaunchOptions:nil partnerName:[command.arguments objectAtIndex:0] appGroup:[command.arguments objectAtIndex:2]];
39
- [Insider hybridApplicationDidBecomeActive];
39
+ [Insider applicationDidBecomeActive];
40
40
 
41
41
  [self sendSuccessResultWithString:@"Insider Cordova Plugin: initWithLaunchOptions" andCommand:command];
42
42
  } @catch (NSException *exception){
@@ -53,7 +53,7 @@
53
53
  [Insider registerInsiderCallbackWithSelector:@selector(registerCallback:) sender:self];
54
54
  [Insider setHybridSDKVersion:[command.arguments objectAtIndex:1]];
55
55
  [Insider initWithLaunchOptions:nil partnerName:[command.arguments objectAtIndex:0] appGroup:[command.arguments objectAtIndex:2] customEndpoint:[command.arguments objectAtIndex:3]];
56
- [Insider hybridApplicationDidBecomeActive];
56
+ [Insider applicationDidBecomeActive];
57
57
 
58
58
  [self sendSuccessResultWithString:@"Insider Cordova Plugin: initWithCustomEndpoint" andCommand:command];
59
59
  } @catch (NSException *exception){
@@ -262,7 +262,7 @@
262
262
  - (void)hybridIntent:(CDVInvokedUrlCommand *)command {
263
263
  @try {
264
264
  [self.commandDelegate runInBackground:^{
265
- [Insider hybridApplicationDidBecomeActive];
265
+ [Insider applicationDidBecomeActive];
266
266
  }];
267
267
  } @catch (NSException *e) {
268
268
  [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
package/types/Event.d.ts CHANGED
@@ -4,6 +4,11 @@ export interface Event {
4
4
  addParameterWithDouble(key: string, value: number): Event;
5
5
  addParameterWithBoolean(key: string, value: boolean): Event;
6
6
  addParameterWithDate(key: string, value: string): Event;
7
+ /**
8
+ * @deprecated Use `addParameterWithStringArray` instead.
9
+ */
7
10
  addParameterWithArray(key: string, value: object): Event;
11
+ addParameterWithStringArray(key: string, value: Array<string>): Event;
12
+ addParameterWithNumericArray(key: string, value: Array<number>): Event;
8
13
  build(): void;
9
14
  }
@@ -15,5 +15,10 @@ export interface Product {
15
15
  setCustomAttributeWithBoolean(key: string, value: boolean):Product;
16
16
  setCustomAttributeWithDouble(key: string, value: number):Product;
17
17
  setCustomAttributeWithDate(key: string, value: Date):Product;
18
+ /**
19
+ * @deprecated Use `setCustomAttributeWithStringArray` instead.
20
+ */
18
21
  setCustomAttributeWithArray(key: string, value: object):Product;
22
+ setCustomAttributeWithStringArray(key: string, value: Array<string>):Product;
23
+ setCustomAttributeWithNumericArray(key: string, value: Array<number>):Product;
19
24
  }
package/www/Constants.js CHANGED
@@ -109,5 +109,5 @@ module.exports = {
109
109
  // Reinit
110
110
  REINIT_WITH_PARTNER_NAME: 'reinitWithPartnerName',
111
111
  // SDK Version
112
- SDK_VERSION: 'CDV-2.4.1'
112
+ SDK_VERSION: 'CDV-3.0.1'
113
113
  };
package/www/Event.js CHANGED
@@ -136,6 +136,46 @@ var Event = /*#__PURE__*/function () {
136
136
  Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
137
137
  }
138
138
  }
139
+ }, {
140
+ key: "addParameterWithStringArray",
141
+ value: function addParameterWithStringArray(key, value) {
142
+ if (Utils.checkParameters([{
143
+ type: 'string',
144
+ value: key
145
+ }, {
146
+ type: 'string_array',
147
+ value: value
148
+ }])) {
149
+ Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithStringArray');
150
+ return this;
151
+ }
152
+ try {
153
+ this.parameters[key] = value;
154
+ return this;
155
+ } catch (error) {
156
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
157
+ }
158
+ }
159
+ }, {
160
+ key: "addParameterWithNumericArray",
161
+ value: function addParameterWithNumericArray(key, value) {
162
+ if (Utils.checkParameters([{
163
+ type: 'string',
164
+ value: key
165
+ }, {
166
+ type: 'numeric_array',
167
+ value: value
168
+ }])) {
169
+ Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithNumericArray');
170
+ return this;
171
+ }
172
+ try {
173
+ this.parameters[key] = value;
174
+ return this;
175
+ } catch (error) {
176
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
177
+ }
178
+ }
139
179
  }, {
140
180
  key: "build",
141
181
  value: function build() {
package/www/Product.js CHANGED
@@ -462,6 +462,46 @@ var Product = /*#__PURE__*/function () {
462
462
  }
463
463
  return this;
464
464
  }
465
+ }, {
466
+ key: "setCustomAttributeWithStringArray",
467
+ value: function setCustomAttributeWithStringArray(key, value) {
468
+ if (Utils.checkParameters([{
469
+ type: 'string',
470
+ value: key
471
+ }, {
472
+ type: 'string_array',
473
+ value: value
474
+ }])) {
475
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithStringArray');
476
+ return this;
477
+ }
478
+ try {
479
+ this.productOptMap[key] = value;
480
+ } catch (error) {
481
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
482
+ }
483
+ return this;
484
+ }
485
+ }, {
486
+ key: "setCustomAttributeWithNumericArray",
487
+ value: function setCustomAttributeWithNumericArray(key, value) {
488
+ if (Utils.checkParameters([{
489
+ type: 'string',
490
+ value: key
491
+ }, {
492
+ type: 'numeric_array',
493
+ value: value
494
+ }])) {
495
+ Utils.showParameterWarningLog(this.constructor.name + '-setCustomAttributeWithNumericArray');
496
+ return this;
497
+ }
498
+ try {
499
+ this.productOptMap[key] = value;
500
+ } catch (error) {
501
+ Utils.asyncExec(InsiderConstants.CLASS, InsiderConstants.PUT_ERROR_LOG, [Utils.generateJSONErrorString(error)]);
502
+ }
503
+ return this;
504
+ }
465
505
  }]);
466
506
  }();
467
507
  module.exports = Product;
package/www/Utils.js CHANGED
@@ -13,7 +13,24 @@ module.exports = {
13
13
  },
14
14
  checkParameters: function checkParameters(parameters) {
15
15
  return parameters.some(function (parameterConfig) {
16
- return parameterConfig.type !== _typeof(parameterConfig.value);
16
+ switch (parameterConfig.type) {
17
+ case "numeric_array":
18
+ if (!Array.isArray(parameterConfig.value)) {
19
+ return true;
20
+ }
21
+ return !parameterConfig.value.every(function (item) {
22
+ return typeof item === "number";
23
+ });
24
+ case "string_array":
25
+ if (!Array.isArray(parameterConfig.value)) {
26
+ return true;
27
+ }
28
+ return !parameterConfig.value.every(function (item) {
29
+ return typeof item === "string";
30
+ });
31
+ default:
32
+ return parameterConfig.type !== _typeof(parameterConfig.value);
33
+ }
17
34
  });
18
35
  },
19
36
  showParameterWarningLog: function showParameterWarningLog(functionName) {