react-native-ux-cam 5.4.13 → 5.4.14

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/CHANGELOG.md CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  Version | Changes
7
7
  ------- | ----------
8
+ 5.4.14 | Updated iOS SDK to 3.6.9 and Android to 3.6.21
8
9
  5.4.13 | Updated iOS SDK to 3.6.7 and Android to 3.6.18, Updated minSdkVersion to 21 for Android
9
10
  5.4.12 | Updated iOS SDK to 3.6.6 and Android to 3.6.16
10
11
  5.4.11 | Updated iOS SDK to 3.6.5 and Android to 3.6.14
package/RNUxcam.podspec CHANGED
@@ -17,6 +17,5 @@ Pod::Spec.new do |s|
17
17
  s.static_framework = true
18
18
 
19
19
  s.dependency 'React-Core'
20
- s.dependency 'UXCam' , '~> 3.6.7'
21
- end
22
-
20
+ s.dependency 'UXCam' , '~> 3.6.9'
21
+ end
@@ -43,5 +43,5 @@ rootProject.allprojects {
43
43
 
44
44
  dependencies {
45
45
  implementation 'com.facebook.react:react-native:+'
46
- implementation 'com.uxcam:uxcam:3.6.18'
46
+ implementation 'com.uxcam:uxcam:3.6.21'
47
47
  }
@@ -3,6 +3,7 @@ package com.uxcam;
3
3
  import android.view.View;
4
4
 
5
5
  import com.facebook.react.bridge.Arguments;
6
+ import com.facebook.react.bridge.NoSuchKeyException;
6
7
  import com.facebook.react.bridge.Promise;
7
8
  import com.facebook.react.bridge.ReactApplicationContext;
8
9
  import com.facebook.react.bridge.ReactContext;
@@ -12,6 +13,7 @@ import com.facebook.react.bridge.ReadableArray;
12
13
  import com.facebook.react.bridge.ReadableMap;
13
14
  import com.facebook.react.bridge.ReadableType;
14
15
  import com.facebook.react.bridge.ReadableMapKeySetIterator;
16
+ import com.facebook.react.bridge.UnexpectedNativeTypeException;
15
17
  import com.facebook.react.bridge.WritableArray;
16
18
  import com.facebook.react.bridge.WritableMap;
17
19
  import com.facebook.react.modules.core.DeviceEventManagerModule;
@@ -35,7 +37,7 @@ import com.uxcam.datamodel.UXConfig;
35
37
 
36
38
  public class RNUxcamModule extends ReactContextBaseJavaModule {
37
39
  private static final String UXCAM_PLUGIN_TYPE = "react-native";
38
- private static final String UXCAM_REACT_PLUGIN_VERSION = "5.4.13";
40
+ private static final String UXCAM_REACT_PLUGIN_VERSION = "5.4.14";
39
41
 
40
42
  private static final String UXCAM_VERIFICATION_EVENT_KEY = "UXCam_Verification_Event";
41
43
  private static final String PARAM_SUCCESS_KEY = "success";
@@ -306,32 +308,47 @@ public class RNUxcamModule extends ReactContextBaseJavaModule {
306
308
 
307
309
  @ReactMethod
308
310
  public void logEvent(String event) {
309
- UXCam.logEvent(event);
311
+ UXCam.logEvent(event);
310
312
  }
311
313
 
312
314
  @ReactMethod
313
315
  public void logEvent(String event, ReadableMap properties) {
314
- if (properties != null) {
315
-
316
- HashMap<String, Object> map = new HashMap<String, Object>();
316
+ HashMap<String, Object> convertedProperties = new HashMap<>();
317
317
 
318
+ if (properties != null) {
318
319
  ReadableMapKeySetIterator iterator = properties.keySetIterator();
320
+
319
321
  while (iterator.hasNextKey()) {
320
322
  String key = iterator.nextKey();
321
323
  ReadableType type = properties.getType(key);
322
- if (type == ReadableType.Boolean) {
323
- map.put(key, properties.getBoolean(key));
324
- } else if (type == ReadableType.Number) {
325
- map.put(key, properties.getDouble(key));
326
- } else {
327
- map.put(key, properties.getString(key));
324
+ try {
325
+ switch (type) {
326
+ case Null:
327
+ convertedProperties.put(key, "");
328
+ case Boolean:
329
+ convertedProperties.put(key, properties.getBoolean(key));
330
+ break;
331
+ case Number:
332
+ convertedProperties.put(key, properties.getDouble(key));
333
+ break;
334
+ case String:
335
+ convertedProperties.put(key, properties.getString(key));
336
+ break;
337
+ case Map:
338
+ convertedProperties.put(key, properties.getMap(key).toString());
339
+ break;
340
+ case Array:
341
+ convertedProperties.put(key, properties.getArray(key).toString());
342
+ break;
343
+ }
344
+ } catch (NullPointerException | NoSuchKeyException | UnexpectedNativeTypeException e) {
345
+ convertedProperties.put(key, "");
346
+ e.printStackTrace();
328
347
  }
329
348
  }
330
- UXCam.logEvent(event, map);
331
- } else {
332
- UXCam.logEvent(event);
333
349
  }
334
350
 
351
+ UXCam.logEvent(event, convertedProperties);
335
352
  }
336
353
 
337
354
  @ReactMethod
package/ios/RNUxcam.m CHANGED
@@ -54,7 +54,7 @@ RCT_EXPORT_MODULE();
54
54
  RCT_EXPORT_METHOD(startWithConfiguration:(NSDictionary *)config)
55
55
  {
56
56
  self.lastVerifyResult = nil;
57
- [UXCam pluginType:@"react-native" version:@"5.4.13"];
57
+ [UXCam pluginType:@"react-native" version:@"5.4.14"];
58
58
 
59
59
  NSString *userAppKey = config[RNUxcam_AppKey];
60
60
  if (!userAppKey || ![userAppKey isKindOfClass:NSString.class])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ux-cam",
3
- "version": "5.4.13",
3
+ "version": "5.4.14",
4
4
  "description": "React Native wrapper for uxcam.com.",
5
5
  "license": "MIT",
6
6
  "author": "admin@uxcam.com for UXCam Inc. after Mark Miyashita <negativetwelve@gmail.com>",