cordova-plugin-insider 1.3.0 → 1.5.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/package.json +1 -1
- package/plugin.xml +6 -6
- package/src/android/Constants.java +1 -0
- package/src/android/InsiderPlugin.java +29 -3
- package/src/android/build-extras.gradle +5 -6
- package/src/ios/InsiderPlugin.h +2 -0
- package/src/ios/InsiderPlugin.m +30 -10
- package/types/InsiderPlugin.d.ts +1 -0
- package/types/Product.d.ts +1 -0
- package/www/CallbackType.js +1 -0
- package/www/Constants.js +3 -1
- package/www/Event.js +24 -7
- package/www/Identifier.js +16 -4
- package/www/InsiderPlugin.js +166 -20
- package/www/Product.js +80 -17
- package/www/User.js +99 -27
- package/www/Utils.js +7 -5
- package/.github/CODEOWNERS +0 -8
- package/.github/workflows/git-leak.yml +0 -25
- package/.github/workflows/insider-cordova-SDK_release.yml +0 -61
- package/.github/workflows/release_task_merger.yml +0 -22
- package/.github/workflows/release_version_setter.yml +0 -43
- package/release_version.sh +0 -27
- package/slack_notifier.sh +0 -20
package/package.json
CHANGED
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.
|
|
2
|
+
<plugin id="cordova-plugin-insider" version="1.5.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>
|
|
@@ -28,9 +28,8 @@
|
|
|
28
28
|
<platform name="android">
|
|
29
29
|
<framework src="src/android/build-extras.gradle" custom="true" type="gradleReference" />
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<hook type="before_plugin_uninstall" src="hooks/before_plugin_uninstall.js"/>
|
|
32
|
+
<hook type="after_plugin_install" src="hooks/after_plugin_install.js"/>
|
|
34
33
|
|
|
35
34
|
<config-file target="config.xml" parent="/*">
|
|
36
35
|
<preference name="GradlePluginGoogleServicesEnabled" value="true" />
|
|
@@ -71,8 +70,9 @@
|
|
|
71
70
|
<source url="https://cdn.cocoapods.org/" />
|
|
72
71
|
</config>
|
|
73
72
|
<pods use-frameworks="true">
|
|
74
|
-
<pod name="InsiderMobile" spec="12.
|
|
75
|
-
<pod name="
|
|
73
|
+
<pod name="InsiderMobile" spec="12.8.6" />
|
|
74
|
+
<pod name="InsiderGeofence" spec="1.0.3" />
|
|
75
|
+
<pod name="InsiderHybrid" spec="1.4.0" />
|
|
76
76
|
</pods>
|
|
77
77
|
</podspec>
|
|
78
78
|
|
|
@@ -87,7 +87,6 @@ public class InsiderPlugin extends CordovaPlugin {
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
Insider.Instance.handleHybridIntent();
|
|
91
90
|
Insider.Instance.storePartnerName(partnerName);
|
|
92
91
|
}
|
|
93
92
|
});
|
|
@@ -115,8 +114,6 @@ public class InsiderPlugin extends CordovaPlugin {
|
|
|
115
114
|
init(args.getString(0), args.getString(1));
|
|
116
115
|
} else if (action.equals("setGDPRConsent")) {
|
|
117
116
|
Insider.Instance.setGDPRConsent(Boolean.parseBoolean(args.getString(0)));
|
|
118
|
-
} else if (action.equals("enableIDFACollection")) {
|
|
119
|
-
Insider.Instance.enableIDFACollection(Boolean.parseBoolean(args.getString(0)));
|
|
120
117
|
} else if (action.equals("startTrackingGeofence")) {
|
|
121
118
|
cordova.getThreadPool().execute(new Runnable() {
|
|
122
119
|
@Override
|
|
@@ -273,6 +270,32 @@ public class InsiderPlugin extends CordovaPlugin {
|
|
|
273
270
|
}
|
|
274
271
|
}
|
|
275
272
|
});
|
|
273
|
+
} else if (action.equals("getSmartRecommendationWithProductIDs")) {
|
|
274
|
+
if (args.get(0) == null || args.get(1) == null || args.get(2) == null || args.get(3) == null)
|
|
275
|
+
return false;
|
|
276
|
+
|
|
277
|
+
cordova.getThreadPool().execute(new Runnable() {
|
|
278
|
+
@Override
|
|
279
|
+
public void run() {
|
|
280
|
+
try {
|
|
281
|
+
String[] productIDs = (CDVUtils.convertJSONToArrayList(args.get(0).toString())).toArray(new String[0]);
|
|
282
|
+
|
|
283
|
+
Insider.Instance.getSmartRecommendationWithProductIDs(productIDs,
|
|
284
|
+
args.getInt(1),
|
|
285
|
+
args.getString(2),
|
|
286
|
+
args.getString(3),
|
|
287
|
+
new RecommendationEngine.SmartRecommendation() {
|
|
288
|
+
@Override
|
|
289
|
+
public void loadRecommendationData(JSONObject jsonObject) {
|
|
290
|
+
callbackSuccess(callbackContext, jsonObject.toString());
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
} catch (JSONException e) {
|
|
294
|
+
callbackFailure(callbackContext, "ERROR:" + e.toString());
|
|
295
|
+
e.printStackTrace();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
});
|
|
276
299
|
} else if (action.equals(InsiderHybridMethods.CLICK_SMART_RECOMMENDATION_PRODUCT)) {
|
|
277
300
|
if (args.get(0) == null || args.get(1) == null || args.get(2) == null)
|
|
278
301
|
return false;
|
|
@@ -770,6 +793,9 @@ public class InsiderPlugin extends CordovaPlugin {
|
|
|
770
793
|
case Constants.PROMOTION_DISCOUNT:
|
|
771
794
|
product.setPromotionDiscount((double) value);
|
|
772
795
|
break;
|
|
796
|
+
case Constants.GROUP_CODE:
|
|
797
|
+
product.setGroupCode((String) value);
|
|
798
|
+
break;
|
|
773
799
|
default:
|
|
774
800
|
setProductCustomAttribute(product, entry.getKey(), value);
|
|
775
801
|
break;
|
|
@@ -11,16 +11,13 @@ android {
|
|
|
11
11
|
defaultConfig {
|
|
12
12
|
minSdkVersion 21
|
|
13
13
|
targetSdkVersion 31
|
|
14
|
-
versionCode 1
|
|
15
|
-
versionName "1.0"
|
|
16
|
-
manifestPlaceholders = [ partner: "partner_name" ]
|
|
17
14
|
multiDexEnabled true
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
dependencies {
|
|
22
|
-
implementation 'com.useinsider:insider:13.
|
|
23
|
-
implementation 'com.useinsider:insiderhybrid:1.1.
|
|
19
|
+
implementation 'com.useinsider:insider:13.8.5'
|
|
20
|
+
implementation 'com.useinsider:insiderhybrid:1.1.6'
|
|
24
21
|
|
|
25
22
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
|
|
26
23
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.4'
|
|
@@ -30,9 +27,11 @@ dependencies {
|
|
|
30
27
|
|
|
31
28
|
implementation 'com.google.android.gms:play-services-location:20.0.0'
|
|
32
29
|
implementation 'com.google.firebase:firebase-messaging:23.0.5'
|
|
33
|
-
implementation 'com.google.android.
|
|
30
|
+
implementation 'com.google.android.play:core-ktx:1.8.1'
|
|
34
31
|
|
|
35
32
|
implementation 'com.huawei.hms:push:6.5.0.300'
|
|
36
33
|
implementation 'com.huawei.hms:ads-identifier:3.4.39.302'
|
|
37
34
|
implementation 'com.huawei.hms:location:6.4.0.300'
|
|
35
|
+
|
|
36
|
+
implementation 'androidx.security:security-crypto:1.0.0'
|
|
38
37
|
}
|
package/src/ios/InsiderPlugin.h
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#import <InsiderMobile/Insider.h>
|
|
2
2
|
#import <InsiderHybrid/InsiderHybrid.h>
|
|
3
3
|
#import <InsiderMobile/InsiderCallbackTypeEnum.h>
|
|
4
|
+
#import <InsiderGeofence/InsiderGeofence.h>
|
|
4
5
|
#import "IDFAHelper.h"
|
|
5
6
|
#import <UserNotifications/UserNotifications.h>
|
|
6
7
|
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
- (void) cartCleared:(CDVInvokedUrlCommand *)command;
|
|
31
32
|
- (void) getSmartRecommendation:(CDVInvokedUrlCommand *)command;
|
|
32
33
|
- (void) getSmartRecommendationWithProduct:(CDVInvokedUrlCommand *)command;
|
|
34
|
+
- (void) getSmartRecommendationWithProductIDs:(CDVInvokedUrlCommand *)command;
|
|
33
35
|
- (void) clickSmartRecommendationProduct:(CDVInvokedUrlCommand *)command;
|
|
34
36
|
- (void) getMessageCenterData:(CDVInvokedUrlCommand *)command;
|
|
35
37
|
- (void) setGender:(CDVInvokedUrlCommand *)command;
|
package/src/ios/InsiderPlugin.m
CHANGED
|
@@ -62,41 +62,47 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
-(void)registerCallback:(NSDictionary *)
|
|
65
|
+
-(void)registerCallback:(NSDictionary *)callbackDictionary {
|
|
66
66
|
@try {
|
|
67
|
-
if (!
|
|
67
|
+
if (!callbackDictionary || [callbackDictionary count] == 0)
|
|
68
68
|
return;
|
|
69
|
-
InsiderCallbackType type = (InsiderCallbackType)[[
|
|
70
|
-
NSString*
|
|
69
|
+
InsiderCallbackType type = (InsiderCallbackType)[[callbackDictionary objectForKey:@"type"] intValue];
|
|
70
|
+
NSString* callbackData = [InsiderHybrid dictToJson:callbackDictionary];
|
|
71
71
|
|
|
72
72
|
NSString *js;
|
|
73
73
|
switch (type) {
|
|
74
74
|
case InsiderCallbackTypeNotificationOpen:{
|
|
75
|
-
NSString * data = [NSString stringWithFormat:@"{""action"":'NOTIFICATION_OPEN',""result"":""%@""}",
|
|
75
|
+
NSString * data = [NSString stringWithFormat:@"{""action"":'NOTIFICATION_OPEN',""result"":""%@""}", callbackData];
|
|
76
76
|
js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
|
|
77
77
|
[self.commandDelegate evalJs:js];
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
80
80
|
case InsiderCallbackTypeInappButtonClick:{
|
|
81
|
-
NSString * data = [NSString stringWithFormat:@"{""action"":'INAPP_BUTTON_CLICK',""result"":""%@""}",
|
|
81
|
+
NSString * data = [NSString stringWithFormat:@"{""action"":'INAPP_BUTTON_CLICK',""result"":""%@""}", callbackData];
|
|
82
82
|
js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
|
|
83
83
|
[self.commandDelegate evalJs:js];
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
case InsiderCallbackTypeTempStorePurchase:{
|
|
87
|
-
NSString * data = [NSString stringWithFormat:@"{""action"":'TEMP_STORE_PURCHASE',""result"":""%@""}",
|
|
87
|
+
NSString * data = [NSString stringWithFormat:@"{""action"":'TEMP_STORE_PURCHASE',""result"":""%@""}", callbackData];
|
|
88
88
|
js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
|
|
89
89
|
[self.commandDelegate evalJs:js];
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case InsiderCallbackTypeTempStoreAddedToCart:{
|
|
93
|
-
NSString * data = [NSString stringWithFormat:@"{""action"":'TEMP_STORE_ADDED_TO_CART',""result"":""%@""}",
|
|
93
|
+
NSString * data = [NSString stringWithFormat:@"{""action"":'TEMP_STORE_ADDED_TO_CART',""result"":""%@""}", callbackData];
|
|
94
94
|
js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
|
|
95
95
|
[self.commandDelegate evalJs:js];
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
case InsiderCallbackTypeTempStoreCustomAction:{
|
|
99
|
-
NSString * data = [NSString stringWithFormat:@"{""action"":'TEMP_STORE_CUSTOM_ACTION',""result"":""%@""}",
|
|
99
|
+
NSString * data = [NSString stringWithFormat:@"{""action"":'TEMP_STORE_CUSTOM_ACTION',""result"":""%@""}", callbackData];
|
|
100
|
+
js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
|
|
101
|
+
[self.commandDelegate evalJs:js];
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case InsiderCallbackTypeInAppSeen:{
|
|
105
|
+
NSString * data = [NSString stringWithFormat:@"{""action"":'INAPP_SEEN',""result"":""%@""}", callbackData];
|
|
100
106
|
js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
|
|
101
107
|
[self.commandDelegate evalJs:js];
|
|
102
108
|
break;
|
|
@@ -138,7 +144,7 @@
|
|
|
138
144
|
- (void) startTrackingGeofence:(CDVInvokedUrlCommand *)command {
|
|
139
145
|
@try {
|
|
140
146
|
[self.commandDelegate runInBackground:^{
|
|
141
|
-
[
|
|
147
|
+
[InsiderGeofence startTracking];
|
|
142
148
|
[self sendSuccessResultWithString:@"SUCCESS" andCommand:command];
|
|
143
149
|
}];
|
|
144
150
|
} @catch (NSException *exception) {
|
|
@@ -390,6 +396,20 @@
|
|
|
390
396
|
}
|
|
391
397
|
}
|
|
392
398
|
|
|
399
|
+
- (void)getSmartRecommendationWithProductIDs:(CDVInvokedUrlCommand *)command {
|
|
400
|
+
@try {
|
|
401
|
+
[self.commandDelegate runInBackground:^{
|
|
402
|
+
if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2] || ![command.arguments objectAtIndex:3]) return;
|
|
403
|
+
|
|
404
|
+
[Insider getSmartRecommendationWithProductIDs:[command.arguments objectAtIndex:0] recommendationID:[[command.arguments objectAtIndex:1] intValue] locale:[command.arguments objectAtIndex:2] currency:[command.arguments objectAtIndex:3] smartRecommendation:^(NSDictionary *recommendation) {
|
|
405
|
+
[self sendSuccessResultWithDictionary:recommendation andCommand:command];
|
|
406
|
+
}];
|
|
407
|
+
}];
|
|
408
|
+
} @catch (NSException *e) {
|
|
409
|
+
[Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
393
413
|
- (void)clickSmartRecommendationProduct:(CDVInvokedUrlCommand *)command {
|
|
394
414
|
@try {
|
|
395
415
|
dispatch_async(dispatch_get_main_queue(), ^{
|
package/types/InsiderPlugin.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ interface InsiderPlugin {
|
|
|
19
19
|
getMessageCenterData(limit: number, startDate: Date, endDate: Date): Promise <any>;
|
|
20
20
|
getSmartRecommendation(recommendationID: number, locale: string, currency: string): Promise <any>;
|
|
21
21
|
getSmartRecommendationWithProduct(product: object, recommendationID: number, locale: string): Promise <any>;
|
|
22
|
+
getSmartRecommendationWithProductIDs(product: Array<string>, recommendationID: number, locale: string): Promise <any>;
|
|
22
23
|
clickSmartRecommendationProduct(product: object, recommendationID: number);
|
|
23
24
|
getContentStringWithName(variableName: string, defaultValue: any, contentOptimizerDataType: number): Promise <any>;
|
|
24
25
|
getContentBoolWithName(variableName: string, defaultValue: boolean, contentOptimizerDataType: number): Promise <any>;
|
package/types/Product.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface Product {
|
|
|
9
9
|
setPromotionDiscount(promotionDiscount: number):Product;
|
|
10
10
|
setStock(setStock: number):Product;
|
|
11
11
|
setQuantity(quantity: number):Product;
|
|
12
|
+
setGroupCode(groupCode: string):Product;
|
|
12
13
|
setCustomAttributeWithString(key: string, value: string):Product;
|
|
13
14
|
setCustomAttributeWithInt(key: string, value: number):Product;
|
|
14
15
|
setCustomAttributeWithBoolean(key: string, value: boolean):Product;
|
package/www/CallbackType.js
CHANGED
package/www/Constants.js
CHANGED
|
@@ -42,6 +42,7 @@ module.exports = {
|
|
|
42
42
|
GET_MESSAGE_CENTER_DATA: 'getMessageCenterData',
|
|
43
43
|
GET_SMART_RECOMMENDATION: 'getSmartRecommendation',
|
|
44
44
|
GET_SMART_RECOMMENDATION_WITH_PRODUCT: 'getSmartRecommendationWithProduct',
|
|
45
|
+
GET_SMART_RECOMMENDATION_WITH_PRODUCT_IDS: 'getSmartRecommendationWithProductIDs',
|
|
45
46
|
CLICK_SMART_RECOMMENDATION_PRODUCT: 'clickSmartRecommendationProduct',
|
|
46
47
|
GET_CONTENT_STRING_WITH_NAME: 'getContentStringWithName',
|
|
47
48
|
GET_CONTENT_BOOL_WITH_NAME: 'getContentBoolWithName',
|
|
@@ -76,11 +77,12 @@ module.exports = {
|
|
|
76
77
|
VOUCHER_DISCOUNT: 'voucher_discount',
|
|
77
78
|
PROMOTION_NAME: 'promotion_name',
|
|
78
79
|
PROMOTION_DISCOUNT: 'promotion_discount',
|
|
80
|
+
GROUP_CODE: 'groupcode',
|
|
79
81
|
// Error
|
|
80
82
|
PUT_ERROR_LOG: 'putErrorLog',
|
|
81
83
|
// Platform
|
|
82
84
|
ANDROID: 'android',
|
|
83
85
|
IOS: 'ios',
|
|
84
86
|
// SDK Version
|
|
85
|
-
SDK_VERSION: 'CDV-1.
|
|
87
|
+
SDK_VERSION: 'CDV-1.5.0',
|
|
86
88
|
};
|
package/www/Event.js
CHANGED
|
@@ -12,7 +12,10 @@ class Event {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
addParameterWithString(key, value) {
|
|
15
|
-
if (
|
|
15
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'string', value: value }])) {
|
|
16
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithString');
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
16
19
|
|
|
17
20
|
try {
|
|
18
21
|
this.parameters[key] = value;
|
|
@@ -24,7 +27,10 @@ class Event {
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
addParameterWithInt(key, value) {
|
|
27
|
-
if (
|
|
30
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'number', value: value }])) {
|
|
31
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithInt');
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
28
34
|
|
|
29
35
|
try {
|
|
30
36
|
this.parameters[key] = value;
|
|
@@ -36,7 +42,10 @@ class Event {
|
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
addParameterWithDouble(key, value) {
|
|
39
|
-
if (
|
|
45
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'number', value: value }])) {
|
|
46
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithDouble');
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
40
49
|
|
|
41
50
|
try {
|
|
42
51
|
this.parameters[key] = value;
|
|
@@ -48,7 +57,10 @@ class Event {
|
|
|
48
57
|
}
|
|
49
58
|
|
|
50
59
|
addParameterWithBoolean(key, value) {
|
|
51
|
-
if (
|
|
60
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'boolean', value: value }])) {
|
|
61
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithBoolean');
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
52
64
|
|
|
53
65
|
try {
|
|
54
66
|
this.parameters[key] = value;
|
|
@@ -60,10 +72,12 @@ class Event {
|
|
|
60
72
|
}
|
|
61
73
|
|
|
62
74
|
addParameterWithDate(key, value) {
|
|
63
|
-
if (
|
|
75
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'object', value: value }])) {
|
|
76
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithDate');
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
64
79
|
|
|
65
80
|
try {
|
|
66
|
-
|
|
67
81
|
this.parameters[key] = value.toISOString();
|
|
68
82
|
|
|
69
83
|
return this;
|
|
@@ -73,7 +87,10 @@ class Event {
|
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
addParameterWithArray(key, value) {
|
|
76
|
-
if (
|
|
90
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'object', value: value }])) {
|
|
91
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addParameterWithArray');
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
77
94
|
|
|
78
95
|
try {
|
|
79
96
|
this.parameters[key] = value;
|
package/www/Identifier.js
CHANGED
|
@@ -11,7 +11,10 @@ class Identifier {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
addEmail(email) {
|
|
14
|
-
if (
|
|
14
|
+
if (Utils.checkParameters([{ type: 'string', value: email }])) {
|
|
15
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addEmail');
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
15
18
|
|
|
16
19
|
try {
|
|
17
20
|
this.identifiers[InsiderConstants.ADD_EMAIL] = email;
|
|
@@ -23,7 +26,10 @@ class Identifier {
|
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
addPhoneNumber(phoneNumber) {
|
|
26
|
-
if (
|
|
29
|
+
if (Utils.checkParameters([{ type: 'string', value: phoneNumber }])) {
|
|
30
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addPhoneNumber');
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
27
33
|
|
|
28
34
|
try {
|
|
29
35
|
this.identifiers[InsiderConstants.ADD_PHONE_NUMBER] = phoneNumber;
|
|
@@ -35,7 +41,10 @@ class Identifier {
|
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
addUserID(userID) {
|
|
38
|
-
if (
|
|
44
|
+
if (Utils.checkParameters([{ type: 'string', value: userID }])) {
|
|
45
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addUserID');
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
39
48
|
|
|
40
49
|
try {
|
|
41
50
|
this.identifiers[InsiderConstants.ADD_USER_ID] = userID;
|
|
@@ -47,7 +56,10 @@ class Identifier {
|
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
addCustomIdentifier(key, value) {
|
|
50
|
-
if (
|
|
59
|
+
if (Utils.checkParameters([{ type: 'string', value: key }, { type: 'string', value: value }])) {
|
|
60
|
+
Utils.showParameterWarningLog(this.constructor.name + '-addCustomIdentifier');
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
51
63
|
|
|
52
64
|
try {
|
|
53
65
|
this.identifiers[key] = value;
|