plotline-engage 4.0.9 → 4.1.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/android/build.gradle +1 -1
- package/index.js +24 -2
- package/package.json +1 -1
package/android/build.gradle
CHANGED
package/index.js
CHANGED
|
@@ -4,6 +4,28 @@ import { ScrollView as RNScrollView, FlatList as RNFlatList} from 'react-native'
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
const { RNPlotline } = NativeModules;
|
|
6
6
|
|
|
7
|
+
function convertToStringValues(obj) {
|
|
8
|
+
const convertedObj = {};
|
|
9
|
+
|
|
10
|
+
for (let key in obj) {
|
|
11
|
+
if (obj.hasOwnProperty(key)) {
|
|
12
|
+
const value = obj[key];
|
|
13
|
+
|
|
14
|
+
if (typeof value === 'number') {
|
|
15
|
+
convertedObj[key] = String(value);
|
|
16
|
+
}
|
|
17
|
+
else if (typeof value === 'boolean') {
|
|
18
|
+
convertedObj[key] = value ? "true" : "false";
|
|
19
|
+
}
|
|
20
|
+
else if (typeof value === 'string') {
|
|
21
|
+
convertedObj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return convertedObj;
|
|
27
|
+
}
|
|
28
|
+
|
|
7
29
|
class plotline {
|
|
8
30
|
constructor() {
|
|
9
31
|
this.throttledNotifyScroll = this.throttle(this.handleScroll, 250);
|
|
@@ -43,7 +65,7 @@ class plotline {
|
|
|
43
65
|
|
|
44
66
|
track (eventName, properties) {
|
|
45
67
|
if (properties)
|
|
46
|
-
RNPlotline.track(eventName, properties);
|
|
68
|
+
RNPlotline.track(eventName, convertToStringValues(properties));
|
|
47
69
|
else
|
|
48
70
|
RNPlotline.track(eventName, null);
|
|
49
71
|
}
|
|
@@ -53,7 +75,7 @@ class plotline {
|
|
|
53
75
|
}
|
|
54
76
|
|
|
55
77
|
identify (obj) {
|
|
56
|
-
RNPlotline.identify(obj);
|
|
78
|
+
RNPlotline.identify(convertToStringValues(obj));
|
|
57
79
|
}
|
|
58
80
|
|
|
59
81
|
setLocale (locale) {
|