react-native-insider 6.6.0 → 6.7.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.
@@ -1,7 +1,8 @@
1
1
  name: Security AllInOne
2
2
  on:
3
3
  push:
4
- branches: '**'
4
+ branches:
5
+ - feature/*
5
6
  pull_request:
6
7
  types:
7
8
  - opened
package/RNInsider.podspec CHANGED
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
14
14
  s.requires_arc = true
15
15
  s.static_framework = true
16
16
  s.dependency 'React'
17
- s.dependency 'InsiderMobile', '13.7.1'
17
+ s.dependency 'InsiderMobile', '13.9.0'
18
18
  s.dependency 'InsiderGeofence', '1.2.0'
19
19
  s.dependency 'InsiderHybrid', '1.5.0'
20
20
  end
@@ -35,7 +35,7 @@ repositories {
35
35
 
36
36
  dependencies {
37
37
  implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
38
- implementation ('com.useinsider:insider:14.5.0')
38
+ implementation ('com.useinsider:insider:14.7.0')
39
39
  implementation ('com.useinsider:insiderhybrid:1.1.5')
40
40
 
41
41
  implementation 'androidx.security:security-crypto:1.1.0-alpha06'
@@ -411,6 +411,15 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
411
411
  });
412
412
  }
413
413
 
414
+ @ReactMethod
415
+ public void setMobileGDPRConsent(final boolean mobileGDPRConsent) {
416
+ try {
417
+ Insider.Instance.setMobileGDPRConsent(mobileGDPRConsent);
418
+ } catch (Exception e) {
419
+ Insider.Instance.putException(e);
420
+ }
421
+ }
422
+
414
423
  @ReactMethod
415
424
  public void itemPurchased(String saleID, ReadableMap productMustMap, ReadableMap productOptMap) {
416
425
  try {
package/index.d.ts CHANGED
@@ -10,7 +10,8 @@ declare module 'react-native-insider' {
10
10
  static tagEvent(name: string): RNInsiderEvent;
11
11
  static getCurrentUser(): RNInsiderUser;
12
12
  static setGDPRConsent(gdprConsent: boolean): void;
13
-
13
+ static setMobileGDPRConsent(mobileGDPRConsent: boolean): void;
14
+
14
15
  static createNewProduct(
15
16
  productID: string,
16
17
  name: string,
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Platform, NativeModules, NativeEventEmitter } from 'react-native';
2
2
 
3
+ import { shouldNotProceed, generateJSONErrorString, checkParameters, showParameterWarningLog } from './src/Util';
3
4
  import RNInsiderEvent from './src/InsiderEvent';
4
5
  import RNInsiderUser from './src/InsiderUser';
5
6
  import RNInsiderProduct from './src/InsiderProduct';
@@ -25,14 +26,6 @@ const platformType = {
25
26
  android: "android"
26
27
  }
27
28
 
28
- function shouldNotProceed() {
29
- return Insider == null;
30
- }
31
-
32
- function generateJSONErrorString(error) {
33
- return '[JavaScript Error] ' + error;
34
- }
35
-
36
29
  function registerInsiderCallback(insiderCallback) {
37
30
  try {
38
31
  const callbackActions = [NOTIFICATION_OPEN, INAPP_BUTTON_CLICK, TEMP_STORE_PURCHASE, TEMP_STORE_ADDED_TO_CART, TEMP_STORE_CUSTOM_ACTION, INAPP_SEEN];
@@ -48,7 +41,15 @@ function registerInsiderCallback(insiderCallback) {
48
41
 
49
42
  export default class RNInsider {
50
43
  static init(partnerName, appGroup, insiderCallback) {
51
- if (shouldNotProceed() || partnerName == null || appGroup == null || insiderCallback == null) return;
44
+ if (shouldNotProceed()) return;
45
+ if (checkParameters([{ type: 'string', value: partnerName }, { type: 'string', value: appGroup }, { type: 'function', value: insiderCallback }])) {
46
+ showParameterWarningLog("init", [
47
+ { type: 'string', value: partnerName },
48
+ { type: 'string', value: appGroup },
49
+ { type: 'function', value: insiderCallback }
50
+ ]);
51
+ return;
52
+ }
52
53
  try {
53
54
  registerInsiderCallback(insiderCallback);
54
55
  let sdkVersion = 'RN-' + packageJSON.version;
@@ -63,8 +64,21 @@ export default class RNInsider {
63
64
  }
64
65
 
65
66
  static initWithCustomEndpoint(partnerName, appGroup, endpoint, insiderCallback) {
66
- if (shouldNotProceed() || partnerName == null || appGroup == null || endpoint == null || insiderCallback == null) return;
67
- try {
67
+ if (shouldNotProceed()) return;
68
+ if (checkParameters([
69
+ { type: 'string', value: partnerName },
70
+ { type: 'string', value: appGroup },
71
+ { type: 'string', value: endpoint },
72
+ { type: 'function', value: insiderCallback }
73
+ ])) {
74
+ showParameterWarningLog("initWithCustomEndpoint", [
75
+ { type: 'string', value: partnerName },
76
+ { type: 'string', value: appGroup },
77
+ { type: 'string', value: endpoint },
78
+ { type: 'function', value: insiderCallback }
79
+ ]);
80
+ return;
81
+ } try {
68
82
  registerInsiderCallback(insiderCallback);
69
83
  let sdkVersion = 'RN-' + packageJSON.version;
70
84
  if (Platform.OS === platformType.ios) {
@@ -79,8 +93,11 @@ export default class RNInsider {
79
93
  }
80
94
 
81
95
  static reinitWithPartnerName(partnerName) {
82
- if (shouldNotProceed() || partnerName == null) return;
83
-
96
+ if (shouldNotProceed()) return;
97
+ if (checkParameters([{ type: 'string', value: partnerName }])) {
98
+ showParameterWarningLog("reinitWithPartnerName", [{ type: 'string', value: partnerName }]);
99
+ return;
100
+ }
84
101
  try {
85
102
  Insider.reinitWithPartnerName(partnerName);
86
103
  } catch (error) {
@@ -89,7 +106,11 @@ export default class RNInsider {
89
106
  }
90
107
 
91
108
  static tagEvent(name) {
92
- if (shouldNotProceed() || name == null) return new RNInsiderEvent('');
109
+ if (shouldNotProceed()) return new RNInsiderEvent('');
110
+ if (checkParameters([{ type: 'string', value: name }])) {
111
+ showParameterWarningLog("tagEvent", [{ type: 'string', value: name }]);
112
+ return new RNInsiderEvent('');
113
+ }
93
114
  return new RNInsiderEvent(name);
94
115
  }
95
116
 
@@ -99,7 +120,11 @@ export default class RNInsider {
99
120
  }
100
121
 
101
122
  static setGDPRConsent(gdprConsent) {
102
- if (shouldNotProceed() || gdprConsent == null) return;
123
+ if (shouldNotProceed()) return;
124
+ if (checkParameters([{ type: 'boolean', value: gdprConsent }])) {
125
+ showParameterWarningLog("setGDPRConsent", [{ type: 'boolean', value: gdprConsent }]);
126
+ return;
127
+ }
103
128
  try {
104
129
  Insider.setGDPRConsent(gdprConsent);
105
130
  } catch (error) {
@@ -107,16 +132,52 @@ export default class RNInsider {
107
132
  }
108
133
  }
109
134
 
135
+ static setMobileGDPRConsent(mobileGDPRConsent) {
136
+ if (shouldNotProceed() || mobileGDPRConsent == null) return;
137
+ try {
138
+ Insider.setMobileGDPRConsent(mobileGDPRConsent);
139
+ } catch (error) {
140
+ Insider.putErrorLog(generateJSONErrorString(error));
141
+ }
142
+ }
143
+
110
144
  // Product
111
145
 
112
146
  static createNewProduct(productID, name, taxonomy, imageURL, price, currency) {
113
- if (shouldNotProceed() || productID == null || name == null || taxonomy == null || imageURL == null || price == null || currency == null)
147
+ if (shouldNotProceed()) return new RNInsiderProduct('', '', [], '', 0, '');
148
+ if (checkParameters([
149
+ { type: 'string', value: productID },
150
+ { type: 'string', value: name },
151
+ { type: 'object', value: taxonomy },
152
+ { type: 'string', value: imageURL },
153
+ { type: 'number', value: price },
154
+ { type: 'string', value: currency }
155
+ ])) {
156
+ showParameterWarningLog("createNewProduct", [
157
+ { type: 'string', value: productID },
158
+ { type: 'string', value: name },
159
+ { type: 'object', value: taxonomy },
160
+ { type: 'string', value: imageURL },
161
+ { type: 'number', value: price },
162
+ { type: 'string', value: currency }
163
+ ]);
114
164
  return new RNInsiderProduct('', '', [], '', 0, '');
165
+ }
115
166
  return new RNInsiderProduct(productID, name, taxonomy, imageURL, price, currency);
116
167
  }
117
168
 
118
169
  static itemPurchased(uniqueSaleID, product) {
119
- if (shouldNotProceed() || uniqueSaleID == null || product == null) return;
170
+ if (shouldNotProceed()) return;
171
+ if (checkParameters([
172
+ { type: 'string', value: uniqueSaleID },
173
+ { type: 'object', value: product }
174
+ ])) {
175
+ showParameterWarningLog("itemPurchased", [
176
+ { type: 'string', value: uniqueSaleID },
177
+ { type: 'object', value: product }
178
+ ]);
179
+ return;
180
+ }
120
181
  try {
121
182
  Insider.itemPurchased(uniqueSaleID, product.productMustMap, product.productOptMap);
122
183
  } catch (error) {
@@ -125,7 +186,11 @@ export default class RNInsider {
125
186
  }
126
187
 
127
188
  static itemAddedToCart(product) {
128
- if (shouldNotProceed() || product == null) return;
189
+ if (shouldNotProceed()) return;
190
+ if (checkParameters([{ type: 'object', value: product }])) {
191
+ showParameterWarningLog("itemAddedToCart", [{ type: 'object', value: product }]);
192
+ return;
193
+ }
129
194
  try {
130
195
  Insider.itemAddedToCart(product.productMustMap, product.productOptMap);
131
196
  } catch (error) {
@@ -134,7 +199,11 @@ export default class RNInsider {
134
199
  }
135
200
 
136
201
  static itemRemovedFromCart(productID) {
137
- if (shouldNotProceed() || productID == null) return;
202
+ if (shouldNotProceed()) return;
203
+ if (checkParameters([{ type: 'string', value: productID }])) {
204
+ showParameterWarningLog("itemRemovedFromCart", [{ type: 'string', value: productID }]);
205
+ return;
206
+ }
138
207
  try {
139
208
  Insider.itemRemovedFromCart(productID);
140
209
  } catch (error) {
@@ -153,8 +222,22 @@ export default class RNInsider {
153
222
 
154
223
  // Message Center & Smart Recommendation
155
224
  static getMessageCenterData(limit, startDate, endDate, callback) {
156
- if (shouldNotProceed() || limit == null || startDate == null || endDate == null || callback == null || startDate.getTime() === endDate.getTime() ||
157
- startDate.getTime() > endDate.getTime()) return;
225
+ if (shouldNotProceed()) return;
226
+ if (checkParameters([
227
+ { type: 'number', value: limit },
228
+ { type: 'object', value: startDate },
229
+ { type: 'object', value: endDate },
230
+ { type: 'function', value: callback }
231
+ ])) {
232
+ showParameterWarningLog("getMessageCenterData", [
233
+ { type: 'number', value: limit },
234
+ { type: 'object', value: startDate },
235
+ { type: 'object', value: endDate },
236
+ { type: 'function', value: callback }
237
+ ]);
238
+ return;
239
+ }
240
+ if ( startDate.getTime() === endDate.getTime() || startDate.getTime() > endDate.getTime()) return;
158
241
  try {
159
242
  Insider.getMessageCenterData(limit, startDate.toISOString(), endDate.toISOString(), (messageCenterData) => {
160
243
  if (Platform.OS !== platformType.ios) {
@@ -169,8 +252,22 @@ export default class RNInsider {
169
252
  }
170
253
 
171
254
  static getMessageCenterDataArray(limit, startDate, endDate, callback) {
172
- if (shouldNotProceed() || limit == null || startDate == null || endDate == null || callback == null || startDate.getTime() === endDate.getTime() ||
173
- startDate.getTime() > endDate.getTime()) return;
255
+ if (shouldNotProceed()) return;
256
+ if (checkParameters([
257
+ { type: 'number', value: limit },
258
+ { type: 'object', value: startDate },
259
+ { type: 'object', value: endDate },
260
+ { type: 'function', value: callback }
261
+ ])) {
262
+ showParameterWarningLog("getMessageCenterDataArray", [
263
+ { type: 'number', value: limit },
264
+ { type: 'object', value: startDate },
265
+ { type: 'object', value: endDate },
266
+ { type: 'function', value: callback }
267
+ ]);
268
+ return;
269
+ }
270
+ if ( startDate.getTime() === endDate.getTime() || startDate.getTime() > endDate.getTime()) return;
174
271
  try {
175
272
  Insider.getMessageCenterData(limit, startDate.toISOString(), endDate.toISOString(), (messageCenterData) => {
176
273
  if (Platform.OS !== platformType.ios) {
@@ -185,7 +282,21 @@ export default class RNInsider {
185
282
  }
186
283
 
187
284
  static getSmartRecommendation(recommendationID, locale, currency, callback) {
188
- if (shouldNotProceed() || recommendationID == null || locale == null || currency == null || callback == null) return;
285
+ if (shouldNotProceed()) return;
286
+ if (checkParameters([
287
+ { type: 'number', value: recommendationID },
288
+ { type: 'string', value: locale },
289
+ { type: 'string', value: currency },
290
+ { type: 'function', value: callback }
291
+ ])) {
292
+ showParameterWarningLog("getSmartRecommendation", [
293
+ { type: 'number', value: recommendationID },
294
+ { type: 'string', value: locale },
295
+ { type: 'string', value: currency },
296
+ { type: 'function', value: callback }
297
+ ]);
298
+ return;
299
+ }
189
300
  try {
190
301
  Insider.getSmartRecommendation(recommendationID, locale, currency, (recommendation) => {
191
302
  callback(recommendation);
@@ -196,7 +307,21 @@ export default class RNInsider {
196
307
  }
197
308
 
198
309
  static getSmartRecommendationWithProduct(product, recommendationID, locale, callback) {
199
- if (shouldNotProceed() || product == null || recommendationID == null || locale == null || callback == null) return;
310
+ if (shouldNotProceed()) return;
311
+ if (checkParameters([
312
+ { type: 'object', value: product },
313
+ { type: 'number', value: recommendationID },
314
+ { type: 'string', value: locale },
315
+ { type: 'function', value: callback }
316
+ ])) {
317
+ showParameterWarningLog("getSmartRecommendationWithProduct", [
318
+ { type: 'object', value: product },
319
+ { type: 'number', value: recommendationID },
320
+ { type: 'string', value: locale },
321
+ { type: 'function', value: callback }
322
+ ]);
323
+ return;
324
+ }
200
325
  try {
201
326
  Insider.getSmartRecommendationWithProduct(product.productMustMap, product.productOptMap, recommendationID, locale, (recommendation) => {
202
327
  callback(recommendation);
@@ -207,7 +332,23 @@ export default class RNInsider {
207
332
  }
208
333
 
209
334
  static getSmartRecommendationWithProductIDs(productIDs, recommendationID, locale, currency, callback) {
210
- if (shouldNotProceed() || productIDs == null || recommendationID == null || locale == null || currency == null || callback == null) return;
335
+ if (shouldNotProceed()) return;
336
+ if (checkParameters([
337
+ { type: 'object', value: productIDs },
338
+ { type: 'number', value: recommendationID },
339
+ { type: 'string', value: locale },
340
+ { type: 'string', value: currency },
341
+ { type: 'function', value: callback }
342
+ ])) {
343
+ showParameterWarningLog("getSmartRecommendationWithProductIDs", [
344
+ { type: 'object', value: productIDs },
345
+ { type: 'number', value: recommendationID },
346
+ { type: 'string', value: locale },
347
+ { type: 'string', value: currency },
348
+ { type: 'function', value: callback }
349
+ ]);
350
+ return;
351
+ }
211
352
  try {
212
353
  productIDs = productIDs.filter(value => value != null && typeof value == "string" && value.trim());
213
354
 
@@ -220,7 +361,17 @@ export default class RNInsider {
220
361
  }
221
362
 
222
363
  static clickSmartRecommendationProduct(recommendationID, product) {
223
- if (shouldNotProceed() || product == null || recommendationID == null) return;
364
+ if (shouldNotProceed()) return;
365
+ if (checkParameters([
366
+ { type: 'number', value: recommendationID },
367
+ { type: 'object', value: product }
368
+ ])) {
369
+ showParameterWarningLog("clickSmartRecommendationProduct", [
370
+ { type: 'number', value: recommendationID },
371
+ { type: 'object', value: product }
372
+ ]);
373
+ return;
374
+ }
224
375
  try {
225
376
  Insider.clickSmartRecommendationProduct(recommendationID, product.productMustMap, product.productOptMap);
226
377
  } catch (error) {
@@ -230,7 +381,21 @@ export default class RNInsider {
230
381
 
231
382
  // Content Optimizer
232
383
  static getContentStringWithName(variableName, defaultValue, contentOptimizerDataType, callback) {
233
- if (shouldNotProceed() || variableName == null || defaultValue == null || contentOptimizerDataType == null || callback == null) return;
384
+ if (shouldNotProceed()) return;
385
+ if (checkParameters([
386
+ { type: 'string', value: variableName },
387
+ { type: 'string', value: defaultValue },
388
+ { type: 'number', value: contentOptimizerDataType },
389
+ { type: 'function', value: callback }
390
+ ])) {
391
+ showParameterWarningLog("getContentStringWithName", [
392
+ { type: 'string', value: variableName },
393
+ { type: 'string', value: defaultValue },
394
+ { type: 'number', value: contentOptimizerDataType },
395
+ { type: 'function', value: callback }
396
+ ]);
397
+ return;
398
+ }
234
399
  try {
235
400
  Insider.getContentStringWithName(variableName, defaultValue, contentOptimizerDataType, callback);
236
401
  } catch (error) {
@@ -239,7 +404,21 @@ export default class RNInsider {
239
404
  }
240
405
 
241
406
  static getContentBoolWithName(variableName, defaultValue, contentOptimizerDataType, callback) {
242
- if (shouldNotProceed() || variableName == null || defaultValue == null || contentOptimizerDataType == null || callback == null) return;
407
+ if (shouldNotProceed()) return;
408
+ if (checkParameters([
409
+ { type: 'string', value: variableName },
410
+ { type: 'boolean', value: defaultValue },
411
+ { type: 'number', value: contentOptimizerDataType },
412
+ { type: 'function', value: callback }
413
+ ])) {
414
+ showParameterWarningLog("getContentBoolWithName", [
415
+ { type: 'string', value: variableName },
416
+ { type: 'boolean', value: defaultValue },
417
+ { type: 'number', value: contentOptimizerDataType },
418
+ { type: 'function', value: callback }
419
+ ]);
420
+ return;
421
+ }
243
422
  try {
244
423
  Insider.getContentBoolWithName(variableName, defaultValue, contentOptimizerDataType, callback);
245
424
  } catch (error) {
@@ -248,7 +427,21 @@ export default class RNInsider {
248
427
  }
249
428
 
250
429
  static getContentIntWithName(variableName, defaultValue, contentOptimizerDataType, callback) {
251
- if (shouldNotProceed() || variableName == null || defaultValue == null || contentOptimizerDataType == null || callback == null) return;
430
+ if (shouldNotProceed()) return;
431
+ if (checkParameters([
432
+ { type: 'string', value: variableName },
433
+ { type: 'number', value: defaultValue },
434
+ { type: 'number', value: contentOptimizerDataType },
435
+ { type: 'function', value: callback }
436
+ ])) {
437
+ showParameterWarningLog("getContentIntWithName", [
438
+ { type: 'string', value: variableName },
439
+ { type: 'number', value: defaultValue },
440
+ { type: 'number', value: contentOptimizerDataType },
441
+ { type: 'function', value: callback }
442
+ ]);
443
+ return;
444
+ }
252
445
  try {
253
446
  Insider.getContentIntWithName(variableName, defaultValue, contentOptimizerDataType, callback);
254
447
  } catch (error) {
@@ -267,7 +460,11 @@ export default class RNInsider {
267
460
  }
268
461
 
269
462
  static visitListingPage(taxonomy) {
270
- if (shouldNotProceed() || taxonomy == null) return;
463
+ if (shouldNotProceed()) return;
464
+ if (checkParameters([{ type: 'object', value: taxonomy }])) {
465
+ showParameterWarningLog("visitListingPage", [{ type: 'object', value: taxonomy }]);
466
+ return;
467
+ }
271
468
  try {
272
469
  Insider.visitListingPage(taxonomy);
273
470
  } catch (error) {
@@ -276,7 +473,11 @@ export default class RNInsider {
276
473
  }
277
474
 
278
475
  static visitProductDetailPage(product) {
279
- if (shouldNotProceed() || product == null) return;
476
+ if (shouldNotProceed()) return;
477
+ if (checkParameters([{ type: 'object', value: product }])) {
478
+ showParameterWarningLog("visitProductDetailPage", [{ type: 'object', value: product }]);
479
+ return;
480
+ }
280
481
  try {
281
482
  Insider.visitProductDetailPage(product.productMustMap, product.productOptMap);
282
483
  } catch (error) {
@@ -285,7 +486,11 @@ export default class RNInsider {
285
486
  }
286
487
 
287
488
  static visitCartPage(products) {
288
- if (shouldNotProceed() || products == null) return;
489
+ if (shouldNotProceed()) return;
490
+ if (checkParameters([{ type: 'object', value: products }])) {
491
+ showParameterWarningLog("visitCartPage", [{ type: 'object', value: products }]);
492
+ return;
493
+ }
289
494
  let mappedProducts = new Array(products.length);
290
495
  try {
291
496
  products.forEach((product, i) => {
@@ -310,7 +515,11 @@ export default class RNInsider {
310
515
  }
311
516
 
312
517
  static handleNotification(notification) {
313
- if (shouldNotProceed() || notification == null) return;
518
+ if (shouldNotProceed()) return;
519
+ if (checkParameters([{ type: 'object', value: notification }])) {
520
+ showParameterWarningLog("handleNotification", [{ type: 'object', value: notification }]);
521
+ return;
522
+ }
314
523
  try {
315
524
  Insider.handleNotification(notification);
316
525
  } catch (error) {
@@ -319,7 +528,11 @@ export default class RNInsider {
319
528
  }
320
529
 
321
530
  static enableIDFACollection(enableIDFACollection) {
322
- if (shouldNotProceed() || enableIDFACollection == null) return;
531
+ if (shouldNotProceed()) return;
532
+ if (checkParameters([{ type: 'boolean', value: enableIDFACollection }])) {
533
+ showParameterWarningLog("enableIDFACollection", [{ type: 'boolean', value: enableIDFACollection }]);
534
+ return;
535
+ }
323
536
  try {
324
537
  Insider.enableIDFACollection(enableIDFACollection);
325
538
  } catch (error) {
@@ -337,7 +550,11 @@ export default class RNInsider {
337
550
  }
338
551
 
339
552
  static registerWithQuietPermission(enabled) {
340
- if (shouldNotProceed() || enabled == null) return;
553
+ if (shouldNotProceed()) return;
554
+ if (checkParameters([{ type: 'boolean', value: enabled }])) {
555
+ showParameterWarningLog("registerWithQuietPermission", [{ type: 'boolean', value: enabled }]);
556
+ return;
557
+ }
341
558
  try {
342
559
  if (Platform.OS !== platformType.ios) return;
343
560
  Insider.registerWithQuietPermission(enabled);
@@ -347,7 +564,11 @@ export default class RNInsider {
347
564
  }
348
565
 
349
566
  static setHybridPushToken(token) {
350
- if (shouldNotProceed() || token == null) return;
567
+ if (shouldNotProceed()) return;
568
+ if (checkParameters([{ type: 'string', value: token }])) {
569
+ showParameterWarningLog("setHybridPushToken", [{ type: 'string', value: token }]);
570
+ return;
571
+ }
351
572
  try {
352
573
  if (Platform.OS !== 'android') return;
353
574
  Insider.setHybridPushToken(token);
@@ -367,7 +588,10 @@ export default class RNInsider {
367
588
 
368
589
  static enableLocationCollection (consentStatus) {
369
590
  if (shouldNotProceed()) return;
370
-
591
+ if (checkParameters([{ type: 'boolean', value: consentStatus }])) {
592
+ showParameterWarningLog("enableLocationCollection", [{ type: 'boolean', value: consentStatus }]);
593
+ return;
594
+ }
371
595
  try {
372
596
  Insider.enableLocationCollection(consentStatus);
373
597
  } catch (error) {
@@ -377,7 +601,10 @@ export default class RNInsider {
377
601
 
378
602
  static enableIpCollection (consentStatus) {
379
603
  if (shouldNotProceed()) return;
380
-
604
+ if (checkParameters([{ type: 'boolean', value: consentStatus }])) {
605
+ showParameterWarningLog("enableIpCollection", [{ type: 'boolean', value: consentStatus }]);
606
+ return;
607
+ }
381
608
  try {
382
609
  Insider.enableIpCollection(consentStatus);
383
610
  } catch (error) {
@@ -387,7 +614,10 @@ export default class RNInsider {
387
614
 
388
615
  static enableCarrierCollection (consentStatus) {
389
616
  if (shouldNotProceed()) return;
390
-
617
+ if (checkParameters([{ type: 'boolean', value: consentStatus }])) {
618
+ showParameterWarningLog("enableCarrierCollection", [{ type: 'boolean', value: consentStatus }]);
619
+ return;
620
+ }
391
621
  try {
392
622
  Insider.enableCarrierCollection(consentStatus);
393
623
  } catch (error) {
@@ -427,7 +657,10 @@ export default class RNInsider {
427
657
 
428
658
  static setForegroundPushCallback (callback) {
429
659
  if (shouldNotProceed()) return;
430
-
660
+ if (checkParameters([{ type: 'function', value: callback }])) {
661
+ showParameterWarningLog("setForegroundPushCallback", [{ type: 'function', value: callback }]);
662
+ return;
663
+ }
431
664
  try {
432
665
  Insider.setForegroundPushCallback();
433
666
 
@@ -450,6 +683,11 @@ export default class RNInsider {
450
683
  }
451
684
 
452
685
  static handleUniversalLink(url) {
686
+ if (shouldNotProceed()) return;
687
+ if (checkParameters([{ type: 'string', value: url }])) {
688
+ showParameterWarningLog("handleUniversalLink", [{ type: 'string', value: url }]);
689
+ return;
690
+ }
453
691
  try {
454
692
  if (Platform.OS !== 'android' || url == null || shouldNotProceed()) return;
455
693
 
@@ -470,8 +708,11 @@ export default class RNInsider {
470
708
  }
471
709
 
472
710
  static insiderIDListener(callback) {
473
- if (shouldNotProceed() || callback == undefined) return;
474
-
711
+ if (shouldNotProceed()) return;
712
+ if (checkParameters([{ type: 'function', value: callback }])) {
713
+ showParameterWarningLog("insiderIDListener", [{ type: 'function', value: callback }]);
714
+ return;
715
+ }
475
716
  try {
476
717
  Insider.registerInsiderIDListener();
477
718
 
@@ -308,6 +308,14 @@ RCT_EXPORT_METHOD(setGDPRConsent:(BOOL)gdprConsent) {
308
308
  }
309
309
  }
310
310
 
311
+ RCT_EXPORT_METHOD(setMobileGDPRConsent:(BOOL)mobileConsent) {
312
+ @try {
313
+ [Insider setMobileGDPRConsent:mobileConsent];
314
+ } @catch (NSException *e){
315
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
316
+ }
317
+ }
318
+
311
319
  RCT_EXPORT_METHOD(signUpConfirmation) {
312
320
  @try {
313
321
  [Insider signUpConfirmation];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",