cordova-plugin-insider 2.2.1 → 2.4.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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "presets": [
3
+ ["@babel/preset-env", {
4
+ "targets": {
5
+ "ie": "11"
6
+ }
7
+ }]
8
+ ]
9
+ }
@@ -26,7 +26,7 @@ module.exports = function (context) {
26
26
  };
27
27
 
28
28
  function addAGConnectDependency(lines) {
29
- var AG_CONNECT_DEPENDENCY = "classpath 'com.huawei.agconnect:agcp:1.6.2.300' " + COMMENT;
29
+ var AG_CONNECT_DEPENDENCY = "classpath 'com.huawei.agconnect:agcp:1.9.1.302' " + COMMENT;
30
30
  var pattern = /(\s*)classpath(\s+)[\',\"]com.android.tools.build:gradle.*[^\]\n]/m;
31
31
  var index;
32
32
 
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "cordova-plugin-insider",
3
- "version": "2.2.1",
3
+ "version": "2.4.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": {
7
7
  "id": "cordova-plugin-insider",
8
- "platforms": ["android","ios"]
8
+ "platforms": [
9
+ "android",
10
+ "ios"
11
+ ]
12
+ },
13
+ "scripts": {
14
+ "build": "babel js --out-dir www --copy-files"
9
15
  },
10
16
  "keywords": [
11
17
  "cordova-plugin-insider",
@@ -15,5 +21,10 @@
15
21
  "main": "www/InsiderPlugin.js",
16
22
  "typings": "types/InsiderPlugin.d.ts",
17
23
  "author": "useinsider",
18
- "license": "ISC"
24
+ "license": "ISC",
25
+ "devDependencies": {
26
+ "@babel/cli": "^7.27.2",
27
+ "@babel/core": "^7.27.4",
28
+ "@babel/preset-env": "^7.27.2"
29
+ }
19
30
  }
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.2.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="2.4.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>
@@ -33,7 +33,7 @@
33
33
 
34
34
  <config-file target="config.xml" parent="/*">
35
35
  <preference name="GradlePluginGoogleServicesEnabled" value="true" />
36
- <preference name="GradlePluginGoogleServicesVersion" value="4.3.10" />
36
+ <preference name="GradlePluginGoogleServicesVersion" value="4.4.2" />
37
37
  </config-file>
38
38
 
39
39
  <config-file target="AndroidManifest.xml" parent="/manifest">
@@ -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.9.1" />
73
+ <pod name="InsiderMobile" spec="13.12.1" />
74
74
  <pod name="InsiderGeofence" spec="1.2.0" />
75
- <pod name="InsiderHybrid" spec="1.6.1" />
75
+ <pod name="InsiderHybrid" spec="1.7.3" />
76
76
  </pods>
77
77
  </podspec>
78
78
 
@@ -39,4 +39,13 @@ class Constants {
39
39
  static final String PROMOTION_NAME = "promotion_name";
40
40
  static final String PROMOTION_DISCOUNT = "promotion_discount";
41
41
  static final String GROUP_CODE = "groupcode";
42
+ static final String BRAND = "brnd";
43
+ static final String SKU = "sku";
44
+ static final String PRODUCT_GENDER = "ge";
45
+ static final String MULTIPACK = "mlt";
46
+ static final String PRODUCT_TYPE = "pt";
47
+ static final String GTIN = "gt";
48
+ static final String DESCRIPTION = "desc";
49
+ static final String TAGS = "tags";
50
+ static final String IS_IN_STOCK = "iis";
42
51
  }
@@ -135,6 +135,8 @@ public class InsiderPlugin extends CordovaPlugin {
135
135
  Insider.Instance.reinitWithPartnerName(args.getString(0));
136
136
  } else if (action.equals("setGDPRConsent")) {
137
137
  Insider.Instance.setGDPRConsent(Boolean.parseBoolean(args.getString(0)));
138
+ } else if (action.equals("setMobileAppAccess")) {
139
+ Insider.Instance.setMobileAppAccess(Boolean.parseBoolean(args.getString(0)));
138
140
  } else if (action.equals("startTrackingGeofence")) {
139
141
  cordova.getThreadPool().execute(new Runnable() {
140
142
  @Override
@@ -161,6 +163,26 @@ public class InsiderPlugin extends CordovaPlugin {
161
163
 
162
164
  boolean optimizedBoolean = Insider.Instance.getContentBoolWithName(args.getString(0), args.getBoolean(1), boolVariableDataType);
163
165
 
166
+ callbackSuccess(callbackContext, optimizedBoolean);
167
+ } else if (action.equals("getContentStringWithoutCache")) {
168
+ ContentOptimizerDataType stringVariableDataType = getDataType(args.getString(2));
169
+
170
+ String optimizedString = Insider.Instance.getContentStringWithoutCache(args.getString(0), args.getString(1), stringVariableDataType);
171
+
172
+ if (optimizedString != null && optimizedString.length() > 0) {
173
+ callbackSuccess(callbackContext, optimizedString);
174
+ }
175
+ } else if (action.equals("getContentIntWithoutCache")) {
176
+ ContentOptimizerDataType intVariableDataType = getDataType(args.getString(2));
177
+
178
+ int optimizedInteger = Insider.Instance.getContentIntWithoutCache(args.getString(0), args.getInt(1), intVariableDataType);
179
+
180
+ callbackSuccess(callbackContext, optimizedInteger);
181
+ } else if (action.equals("getContentBoolWithoutCache")) {
182
+ ContentOptimizerDataType boolVariableDataType = getDataType(args.getString(2));
183
+
184
+ boolean optimizedBoolean = Insider.Instance.getContentBoolWithoutCache(args.getString(0), args.getBoolean(1), boolVariableDataType);
185
+
164
186
  callbackSuccess(callbackContext, optimizedBoolean);
165
187
  } else if (action.equals("removeInapp")) {
166
188
  Insider.Instance.removeInapp(this.cordova.getActivity());
@@ -230,11 +252,11 @@ public class InsiderPlugin extends CordovaPlugin {
230
252
 
231
253
  cordova.getThreadPool().execute(() -> {
232
254
  try {
233
- int limit =args.getInt(0);
234
- String startDate = args.getString(1);
235
- String endDate = args.getString(2);
255
+ int limit = args.getInt(0);
256
+ long startDateEpoch = Long.parseLong(args.getString(1));
257
+ long endDateEpoch = Long.parseLong(args.getString(2));
236
258
 
237
- InsiderHybrid.getMessageCenterData(limit,startDate,endDate, new MessageCenterData() {
259
+ InsiderHybrid.getMessageCenterData(limit, startDateEpoch, endDateEpoch, new MessageCenterData() {
238
260
  @Override
239
261
  public void loadMessageCenterData(JSONArray jsonArray) {
240
262
  callbackSuccess(callbackContext, jsonArray.toString());
@@ -929,6 +951,41 @@ public class InsiderPlugin extends CordovaPlugin {
929
951
  case Constants.GROUP_CODE:
930
952
  product.setGroupCode((String) value);
931
953
  break;
954
+ case Constants.BRAND:
955
+ product.setBrand((String) value);
956
+ break;
957
+ case Constants.SKU:
958
+ product.setSku((String) value);
959
+ break;
960
+ case Constants.PRODUCT_GENDER:
961
+ product.setGender((String) value);
962
+ break;
963
+ case Constants.MULTIPACK:
964
+ product.setMultipack((String) value);
965
+ break;
966
+ case Constants.PRODUCT_TYPE:
967
+ product.setProductType((String) value);
968
+ break;
969
+ case Constants.GTIN:
970
+ product.setGtin((String) value);
971
+ break;
972
+ case Constants.DESCRIPTION:
973
+ product.setDescription((String) value);
974
+ break;
975
+ case Constants.TAGS:
976
+ String[] tags;
977
+
978
+ if (value.getClass().isArray()) {
979
+ tags = (String[]) value;
980
+ } else {
981
+ tags = ((ArrayList<String>) value).toArray(new String[0]);
982
+ }
983
+
984
+ product.setTags(tags);
985
+ break;
986
+ case Constants.IS_IN_STOCK:
987
+ product.setInStock((boolean) value);
988
+ break;
932
989
  default:
933
990
  setProductCustomAttribute(product, entry.getKey(), value);
934
991
  break;
@@ -16,8 +16,8 @@ android {
16
16
  }
17
17
 
18
18
  dependencies {
19
- implementation 'com.useinsider:insider:14.7.2'
20
- implementation 'com.useinsider:insiderhybrid:1.2.0'
19
+ implementation 'com.useinsider:insider:14.10.0'
20
+ implementation 'com.useinsider:insiderhybrid:1.3.2'
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'
@@ -13,6 +13,7 @@
13
13
  - (void) registerWithQuietPermission:(CDVInvokedUrlCommand *)command;
14
14
  - (void) enableIDFACollection:(CDVInvokedUrlCommand *)command;
15
15
  - (void) setGDPRConsent:(CDVInvokedUrlCommand *)command;
16
+ - (void) setMobileAppAccess:(CDVInvokedUrlCommand *)command;
16
17
  - (void) startTrackingGeofence:(CDVInvokedUrlCommand *)command;
17
18
  - (void) tagEvent:(CDVInvokedUrlCommand *)command;
18
19
  - (void) enableLocationCollection:(CDVInvokedUrlCommand *)command;
@@ -22,6 +23,9 @@
22
23
  - (void) getContentStringWithName:(CDVInvokedUrlCommand *)command;
23
24
  - (void) getContentIntWithName:(CDVInvokedUrlCommand *)command;
24
25
  - (void) getContentBoolWithName:(CDVInvokedUrlCommand *)command;
26
+ - (void) getContentStringWithoutCache:(CDVInvokedUrlCommand *)command;
27
+ - (void) getContentIntWithoutCache:(CDVInvokedUrlCommand *)command;
28
+ - (void) getContentBoolWithoutCache:(CDVInvokedUrlCommand *)command;
25
29
  - (void) visitHomePage:(CDVInvokedUrlCommand *)command;
26
30
  - (void) visitListingPage:(CDVInvokedUrlCommand *)command;
27
31
  - (void) visitProductDetailPage:(CDVInvokedUrlCommand *)command;
@@ -123,6 +123,12 @@
123
123
  [self.commandDelegate evalJs:js];
124
124
  break;
125
125
  }
126
+ case InsiderCallbackTypeSessionStarted:{
127
+ NSString * data = [NSString stringWithFormat:@"{""action"":'SESSION_STARTED',""result"":""%@""}", callbackData];
128
+ js = [NSString stringWithFormat:@"cordova.fireDocumentEvent('ins_notification_handle',%@);", data];
129
+ [self.commandDelegate evalJs:js];
130
+ break;
131
+ }
126
132
  default:
127
133
  break;
128
134
  }
@@ -156,6 +162,17 @@
156
162
  [Insider sendError:exception desc:@"Insider.m - setGDPRConsent"];
157
163
  }
158
164
  }
165
+ - (void) setMobileAppAccess:(CDVInvokedUrlCommand *)command {
166
+ @try {
167
+ [self.commandDelegate runInBackground:^{
168
+ NSString* booleanValueByString = [[command arguments] objectAtIndex:0];
169
+ [Insider setMobileAppAccess:[booleanValueByString isEqualToString: @"true"]];
170
+ [self sendSuccessResultWithString:@"SUCCESS" andCommand:command];
171
+ }];
172
+ } @catch (NSException *exception) {
173
+ [Insider sendError:exception desc:@"Insider.m - setMobileAppAccess"];
174
+ }
175
+ }
159
176
 
160
177
  - (void) startTrackingGeofence:(CDVInvokedUrlCommand *)command {
161
178
  @try {
@@ -281,6 +298,30 @@
281
298
  if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2]) return;
282
299
  [self.commandDelegate runInBackground:^{
283
300
  bool coResult = [Insider getContentBoolWithName:[command.arguments objectAtIndex:0] defaultBool:[[command.arguments objectAtIndex:1] boolValue] dataType:[[command.arguments objectAtIndex:2] intValue]];
301
+ [self sendSuccessResultWithBool:coResult andCommand:command];
302
+ }];
303
+ } @catch (NSException *e) {
304
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
305
+ }
306
+ }
307
+
308
+ - (void)getContentStringWithoutCache:(CDVInvokedUrlCommand *)command {
309
+ @try {
310
+ if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2]) return;
311
+ [self.commandDelegate runInBackground:^{
312
+ NSString *coResult = [Insider getContentStringWithoutCache:[command.arguments objectAtIndex:0] defaultString:[command.arguments objectAtIndex:1] dataType:[[command.arguments objectAtIndex:2] intValue]];
313
+ [self sendSuccessResultWithString:coResult andCommand:command];
314
+ }];
315
+ } @catch (NSException *e) {
316
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
317
+ }
318
+ }
319
+
320
+ - (void)getContentIntWithoutCache:(CDVInvokedUrlCommand *)command {
321
+ @try {
322
+ if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2]) return;
323
+ [self.commandDelegate runInBackground:^{
324
+ int coResult = [Insider getContentIntWithoutCache:[command.arguments objectAtIndex:0] defaultInt:[[command.arguments objectAtIndex:1] intValue] dataType:[[command.arguments objectAtIndex:2] intValue]];
284
325
  [self sendSuccessResultWithInt:coResult andCommand:command];
285
326
  }];
286
327
  } @catch (NSException *e) {
@@ -288,6 +329,18 @@
288
329
  }
289
330
  }
290
331
 
332
+ - (void)getContentBoolWithoutCache:(CDVInvokedUrlCommand *)command {
333
+ @try {
334
+ if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2]) return;
335
+ [self.commandDelegate runInBackground:^{
336
+ bool coResult = [Insider getContentBoolWithoutCache:[command.arguments objectAtIndex:0] defaultBool:[[command.arguments objectAtIndex:1] boolValue] dataType:[[command.arguments objectAtIndex:2] intValue]];
337
+ [self sendSuccessResultWithBool:coResult andCommand:command];
338
+ }];
339
+ } @catch (NSException *e) {
340
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
341
+ }
342
+ }
343
+
291
344
  - (void)visitHomePage:(CDVInvokedUrlCommand *)command {
292
345
  @try {
293
346
  dispatch_async(dispatch_get_main_queue(), ^{
@@ -442,7 +495,11 @@
442
495
  @try {
443
496
  [self.commandDelegate runInBackground:^{
444
497
  if (![command.arguments objectAtIndex:0] || ![command.arguments objectAtIndex:1] || ![command.arguments objectAtIndex:2]) return;
445
- [InsiderHybrid getMessageCenterDataWithLimit:[[command.arguments objectAtIndex:0] intValue] startDate:[command.arguments objectAtIndex:1] endDate:[command.arguments objectAtIndex:2] success:^(NSArray *messageCenterData) {
498
+
499
+ NSInteger startDateEpoch = [[command.arguments objectAtIndex:1] integerValue];
500
+ NSInteger endDateEpoch = [[command.arguments objectAtIndex:2] integerValue];
501
+
502
+ [InsiderHybrid getMessageCenterDataWithLimit:[[command.arguments objectAtIndex:0] intValue] startDate:startDateEpoch endDate:endDateEpoch success:^(NSArray *messageCenterData) {
446
503
  [self sendSuccessResultWithArray:messageCenterData andCommand:command];
447
504
  }];
448
505
  }];
@@ -904,6 +961,12 @@
904
961
  [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
905
962
  }
906
963
 
964
+ - (void) sendSuccessResultWithBool:(BOOL)resultMessage andCommand:(CDVInvokedUrlCommand *)command {
965
+ CDVPluginResult *pluginResult = nil;
966
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:resultMessage];
967
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
968
+ }
969
+
907
970
  - (void) sendSuccessResultWithArray:(NSArray *)resultMessage andCommand:(CDVInvokedUrlCommand *)command {
908
971
  CDVPluginResult *pluginResult = nil;
909
972
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:resultMessage];
@@ -4,4 +4,6 @@ export interface CallbackType {
4
4
  TEMP_STORE_PURCHASE: number,
5
5
  TEMP_STORE_ADDED_TO_CART: number,
6
6
  TEMP_STORE_CUSTOM_ACTION: number,
7
+ INAPP_SEEN: number,
8
+ SESSION_STARTED: number,
7
9
  }
@@ -24,12 +24,16 @@ interface InsiderPlugin {
24
24
  getContentStringWithName(variableName: string, defaultValue: any, contentOptimizerDataType: number): Promise <any>;
25
25
  getContentBoolWithName(variableName: string, defaultValue: boolean, contentOptimizerDataType: number): Promise <any>;
26
26
  getContentIntWithName(variableName: string, defaultValue: number, contentOptimizerDataType: number): Promise <any>;
27
+ getContentStringWithoutCache(variableName: string, defaultValue: any, contentOptimizerDataType: number): Promise <any>;
28
+ getContentBoolWithoutCache(variableName: string, defaultValue: boolean, contentOptimizerDataType: number): Promise <any>;
29
+ getContentIntWithoutCache(variableName: string, defaultValue: number, contentOptimizerDataType: number): Promise <any>;
27
30
  visitHomePage(): void;
28
31
  visitListingPage(taxonomy: object): void;
29
32
  visitProductDetailPage(product: object): void;
30
33
  visitCartPage(products: object): void;
31
34
  startTrackingGeofence(): void;
32
35
  setGDPRConsent(gdprConsent: boolean): void;
36
+ setMobileAppAccess(mobileAppAccess: boolean): void;
33
37
  enableIDFACollection(idfaCollection: boolean): void;
34
38
  removeInapp(): void;
35
39
  registerWithQuietPermission(booleanValue: boolean): void;
@@ -1,8 +1,11 @@
1
+ "use strict";
2
+
1
3
  module.exports = {
2
- NOTIFICATION_OPEN: 0,
3
- INAPP_BUTTON_CLICK: 1,
4
- TEMP_STORE_PURCHASE: 2,
5
- TEMP_STORE_ADDED_TO_CART: 3,
6
- TEMP_STORE_CUSTOM_ACTION: 4,
7
- INAPP_SEEN: 5,
4
+ NOTIFICATION_OPEN: 0,
5
+ INAPP_BUTTON_CLICK: 1,
6
+ TEMP_STORE_PURCHASE: 2,
7
+ TEMP_STORE_ADDED_TO_CART: 3,
8
+ TEMP_STORE_CUSTOM_ACTION: 4,
9
+ INAPP_SEEN: 5,
10
+ SESSION_STARTED: 6
8
11
  };
package/www/Constants.js CHANGED
@@ -1,98 +1,113 @@
1
+ "use strict";
2
+
1
3
  module.exports = {
2
- // Main Class Name
3
- CLASS: 'InsiderPlugin',
4
- // User
5
- SET_GENDER: 'setGender',
6
- SET_BIRTDAY: 'setBirthday',
7
- SET_NAME: 'setName',
8
- SET_SURNAME: 'setSurname',
9
- SET_AGE: 'setAge',
10
- SET_EMAIL: 'setEmail',
11
- SET_PHONE_NUMBER: 'setPhoneNumber',
12
- SET_LANGUAGE: 'setLanguage',
13
- SET_LOCALE: 'setLocale',
14
- SET_FACEBOOK_ID: 'setFacebookID',
15
- SET_TWITTER_ID: 'setTwitterID',
16
- SET_EMAIL_OPTIN: 'setEmailOptin',
17
- SET_SMS_OPTIN: 'setSMSOptin',
18
- SET_PUSH_OPTIN: 'setPushOptin',
19
- SET_LOCATION_OPTIN: 'setLocationOptin',
20
- SET_WHATSAPP_OPTIN: 'setWhatsappOptin',
21
- LOGIN: 'login',
22
- LOGOUT: 'logout',
23
- SET_CUSTOM_ATTRIBUTE_WITH_STRING: 'setCustomAttributeWithString',
24
- SET_CUSTOM_ATTRIBUTE_WITH_INT: 'setCustomAttributeWithInt',
25
- SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE: 'setCustomAttributeWithDouble',
26
- SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN: 'setCustomAttributeWithBoolean',
27
- SET_CUSTOM_ATTRIBUTE_WITH_DATE: 'setCustomAttributeWithDate',
28
- SET_CUSTOM_ATTRIBUTE_WITH_ARRAY: 'setCustomAttributeWithArray',
29
- UNSET_CUSTOM_ATTRIBUTE: 'unsetCustomAttribute',
30
- // User Identifier
31
- ADD_EMAIL: 'addEmail',
32
- ADD_PHONE_NUMBER: 'addPhoneNumber',
33
- ADD_USER_ID: 'addUserID',
34
- // Insider Functions
35
- INIT_WITH_CUSTOM_ENDPOINT: 'initWithCustomEndpoint',
36
- INIT_WITH_LAUNCH_OPTIONS: 'initWithLaunchOptions',
37
- INIT: 'init',
38
- ITEM_PURCHASED: 'itemPurchased',
39
- ITEM_ADDED_TO_CART: 'itemAddedToCart',
40
- ITEM_REMOVED_FROM_CART: 'itemRemovedFromCart',
41
- CART_CLEARED: 'cartCleared',
42
- GET_MESSAGE_CENTER_DATA: 'getMessageCenterData',
43
- GET_SMART_RECOMMENDATION: 'getSmartRecommendation',
44
- GET_SMART_RECOMMENDATION_WITH_PRODUCT: 'getSmartRecommendationWithProduct',
45
- GET_SMART_RECOMMENDATION_WITH_PRODUCT_IDS: 'getSmartRecommendationWithProductIDs',
46
- CLICK_SMART_RECOMMENDATION_PRODUCT: 'clickSmartRecommendationProduct',
47
- GET_CONTENT_STRING_WITH_NAME: 'getContentStringWithName',
48
- GET_CONTENT_BOOL_WITH_NAME: 'getContentBoolWithName',
49
- GET_CONTENT_INT_WITH_NAME: 'getContentIntWithName',
50
- VISIT_HOME_PAGE: 'visitHomePage',
51
- VISIT_LISTING_PAGE: 'visitListingPage',
52
- VISIT_PRODUCT_DETAIL_PAGE: 'visitProductDetailPage',
53
- VISIT_CART_PAGE: 'visitCartPage',
54
- START_TRACKING_GEOFENCE: 'startTrackingGeofence',
55
- SET_GDPR_CONSENT: 'setGDPRConsent',
56
- REMOVE_IN_APP: 'removeInapp',
57
- REGISTER_WITH_QUIET_PERMISSION: 'registerWithQuietPermission',
58
- SET_HYBRID_PUSH_TOKEN: 'setPushToken',
59
- ENABLE_IDFA_COLLECTION: 'enableIDFACollection',
60
- ENABLE_LOCATION_COLLECTION: 'enableLocationCollection',
61
- ENABLE_IP_COLLECTION: 'enableIpCollection',
62
- ENABLE_CARRIER_COLLECTION: 'enableCarrierCollection',
63
- SIGN_UP_CONFIRMATION: 'signUpConfirmation',
64
- SET_ACTIVE_FOREGROUND_PUSH_VIEW: 'setActiveForegroundPushView',
65
- SET_FOREGROUND_PUSH_CALLBACK: 'setForegroundPushCallback',
66
- HANDLE_NOTIFICATION: 'handleNotification',
67
- GET_INSIDER_ID: 'getInsiderID',
68
- REGISTER_INSIDER_ID_LISTENER: 'registerInsiderIDListener',
69
- DISABLE_IN_APP_MESSAGES: 'disableInAppMessages',
70
- ENABLE_IN_APP_MESSAGES: 'enableInAppMessages',
71
- ITEM_ADDED_TO_WISHLIST: 'itemAddedToWishlist',
72
- ITEM_REMOVED_FROM_WISHLIST: 'itemRemovedFromWishlist',
73
- WISHLIST_CLEARED: 'wishlistCleared',
74
- VISIT_WISHLIST_PAGE: 'visitWishlistPage',
75
- // Event
76
- TAG_EVENT: 'tagEvent',
77
- // Product Attribute
78
- SALE_PRICE: 'sale_price',
79
- STOCK: 'stock',
80
- COLOR: 'color',
81
- SIZE: 'size',
82
- QUANTITY: 'quantity',
83
- SHIPPING_COST: 'shipping_cost',
84
- VOUCHER_NAME: 'voucher_name',
85
- VOUCHER_DISCOUNT: 'voucher_discount',
86
- PROMOTION_NAME: 'promotion_name',
87
- PROMOTION_DISCOUNT: 'promotion_discount',
88
- GROUP_CODE: 'groupcode',
89
- // Error
90
- PUT_ERROR_LOG: 'putErrorLog',
91
- // Platform
92
- ANDROID: 'android',
93
- IOS: 'ios',
94
- // Reinit
95
- REINIT_WITH_PARTNER_NAME: 'reinitWithPartnerName',
96
- // SDK Version
97
- SDK_VERSION: 'CDV-2.2.1',
98
- };
4
+ // Main Class Name
5
+ CLASS: 'InsiderPlugin',
6
+ // User
7
+ SET_GENDER: 'setGender',
8
+ SET_BIRTDAY: 'setBirthday',
9
+ SET_NAME: 'setName',
10
+ SET_SURNAME: 'setSurname',
11
+ SET_AGE: 'setAge',
12
+ SET_EMAIL: 'setEmail',
13
+ SET_PHONE_NUMBER: 'setPhoneNumber',
14
+ SET_LANGUAGE: 'setLanguage',
15
+ SET_LOCALE: 'setLocale',
16
+ SET_FACEBOOK_ID: 'setFacebookID',
17
+ SET_TWITTER_ID: 'setTwitterID',
18
+ SET_EMAIL_OPTIN: 'setEmailOptin',
19
+ SET_SMS_OPTIN: 'setSMSOptin',
20
+ SET_PUSH_OPTIN: 'setPushOptin',
21
+ SET_LOCATION_OPTIN: 'setLocationOptin',
22
+ SET_WHATSAPP_OPTIN: 'setWhatsappOptin',
23
+ LOGIN: 'login',
24
+ LOGOUT: 'logout',
25
+ SET_CUSTOM_ATTRIBUTE_WITH_STRING: 'setCustomAttributeWithString',
26
+ SET_CUSTOM_ATTRIBUTE_WITH_INT: 'setCustomAttributeWithInt',
27
+ SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE: 'setCustomAttributeWithDouble',
28
+ SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN: 'setCustomAttributeWithBoolean',
29
+ SET_CUSTOM_ATTRIBUTE_WITH_DATE: 'setCustomAttributeWithDate',
30
+ SET_CUSTOM_ATTRIBUTE_WITH_ARRAY: 'setCustomAttributeWithArray',
31
+ UNSET_CUSTOM_ATTRIBUTE: 'unsetCustomAttribute',
32
+ // User Identifier
33
+ ADD_EMAIL: 'addEmail',
34
+ ADD_PHONE_NUMBER: 'addPhoneNumber',
35
+ ADD_USER_ID: 'addUserID',
36
+ // Insider Functions
37
+ INIT_WITH_CUSTOM_ENDPOINT: 'initWithCustomEndpoint',
38
+ INIT_WITH_LAUNCH_OPTIONS: 'initWithLaunchOptions',
39
+ INIT: 'init',
40
+ ITEM_PURCHASED: 'itemPurchased',
41
+ ITEM_ADDED_TO_CART: 'itemAddedToCart',
42
+ ITEM_REMOVED_FROM_CART: 'itemRemovedFromCart',
43
+ CART_CLEARED: 'cartCleared',
44
+ GET_MESSAGE_CENTER_DATA: 'getMessageCenterData',
45
+ GET_SMART_RECOMMENDATION: 'getSmartRecommendation',
46
+ GET_SMART_RECOMMENDATION_WITH_PRODUCT: 'getSmartRecommendationWithProduct',
47
+ GET_SMART_RECOMMENDATION_WITH_PRODUCT_IDS: 'getSmartRecommendationWithProductIDs',
48
+ CLICK_SMART_RECOMMENDATION_PRODUCT: 'clickSmartRecommendationProduct',
49
+ GET_CONTENT_STRING_WITH_NAME: 'getContentStringWithName',
50
+ GET_CONTENT_BOOL_WITH_NAME: 'getContentBoolWithName',
51
+ GET_CONTENT_INT_WITH_NAME: 'getContentIntWithName',
52
+ GET_CONTENT_STRING_WITHOUT_CACHE: 'getContentStringWithoutCache',
53
+ GET_CONTENT_BOOL_WITHOUT_CACHE: 'getContentBoolWithoutCache',
54
+ GET_CONTENT_INT_WITHOUT_CACHE: 'getContentIntWithoutCache',
55
+ VISIT_HOME_PAGE: 'visitHomePage',
56
+ VISIT_LISTING_PAGE: 'visitListingPage',
57
+ VISIT_PRODUCT_DETAIL_PAGE: 'visitProductDetailPage',
58
+ VISIT_CART_PAGE: 'visitCartPage',
59
+ START_TRACKING_GEOFENCE: 'startTrackingGeofence',
60
+ SET_GDPR_CONSENT: 'setGDPRConsent',
61
+ SET_MOBILE_APP_ACCESS: 'setMobileAppAccess',
62
+ REMOVE_IN_APP: 'removeInapp',
63
+ REGISTER_WITH_QUIET_PERMISSION: 'registerWithQuietPermission',
64
+ SET_HYBRID_PUSH_TOKEN: 'setPushToken',
65
+ ENABLE_IDFA_COLLECTION: 'enableIDFACollection',
66
+ ENABLE_LOCATION_COLLECTION: 'enableLocationCollection',
67
+ ENABLE_IP_COLLECTION: 'enableIpCollection',
68
+ ENABLE_CARRIER_COLLECTION: 'enableCarrierCollection',
69
+ SIGN_UP_CONFIRMATION: 'signUpConfirmation',
70
+ SET_ACTIVE_FOREGROUND_PUSH_VIEW: 'setActiveForegroundPushView',
71
+ SET_FOREGROUND_PUSH_CALLBACK: 'setForegroundPushCallback',
72
+ HANDLE_NOTIFICATION: 'handleNotification',
73
+ GET_INSIDER_ID: 'getInsiderID',
74
+ REGISTER_INSIDER_ID_LISTENER: 'registerInsiderIDListener',
75
+ DISABLE_IN_APP_MESSAGES: 'disableInAppMessages',
76
+ ENABLE_IN_APP_MESSAGES: 'enableInAppMessages',
77
+ ITEM_ADDED_TO_WISHLIST: 'itemAddedToWishlist',
78
+ ITEM_REMOVED_FROM_WISHLIST: 'itemRemovedFromWishlist',
79
+ WISHLIST_CLEARED: 'wishlistCleared',
80
+ VISIT_WISHLIST_PAGE: 'visitWishlistPage',
81
+ // Event
82
+ TAG_EVENT: 'tagEvent',
83
+ // Product Attribute
84
+ SALE_PRICE: 'sale_price',
85
+ STOCK: 'stock',
86
+ COLOR: 'color',
87
+ SIZE: 'size',
88
+ QUANTITY: 'quantity',
89
+ SHIPPING_COST: 'shipping_cost',
90
+ VOUCHER_NAME: 'voucher_name',
91
+ VOUCHER_DISCOUNT: 'voucher_discount',
92
+ PROMOTION_NAME: 'promotion_name',
93
+ PROMOTION_DISCOUNT: 'promotion_discount',
94
+ GROUP_CODE: 'groupcode',
95
+ BRAND: "brnd",
96
+ SKU: "sku",
97
+ PRODUCT_GENDER: "ge",
98
+ MULTIPACK: "mlt",
99
+ PRODUCT_TYPE: "pt",
100
+ GTIN: "gt",
101
+ DESCRIPTION: "desc",
102
+ TAGS: "tags",
103
+ IS_IN_STOCK: "iis",
104
+ // Error
105
+ PUT_ERROR_LOG: 'putErrorLog',
106
+ // Platform
107
+ ANDROID: 'android',
108
+ IOS: 'ios',
109
+ // Reinit
110
+ REINIT_WITH_PARTNER_NAME: 'reinitWithPartnerName',
111
+ // SDK Version
112
+ SDK_VERSION: 'CDV-2.4.0'
113
+ };
@@ -1,4 +1,6 @@
1
+ "use strict";
2
+
1
3
  module.exports = {
2
- CONTENT: 0,
3
- ELEMENT: 1,
4
+ CONTENT: 0,
5
+ ELEMENT: 1
4
6
  };