plotline-engage 4.8.5 → 4.8.7-legacy
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
CHANGED
|
@@ -32,19 +32,19 @@ android {
|
|
|
32
32
|
|
|
33
33
|
rootProject.allprojects { Project subproject ->
|
|
34
34
|
subproject.repositories {
|
|
35
|
-
maven { url 'https://
|
|
35
|
+
maven { url 'https://jitpack.io' }
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
repositories {
|
|
40
40
|
mavenCentral()
|
|
41
41
|
maven {
|
|
42
|
-
url 'https://
|
|
42
|
+
url 'https://jitpack.io'
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
dependencies {
|
|
47
47
|
implementation 'com.facebook.react:react-native:+'
|
|
48
|
-
implementation '
|
|
48
|
+
implementation 'com.gitlab.plotline:plotline-android-sdk:4.5.7'
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -53,6 +53,12 @@ public class RNPlotline extends ReactContextBaseJavaModule {
|
|
|
53
53
|
return "RNPlotline";
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
public static String writableMapToJson(WritableMap writableMap) {
|
|
57
|
+
ReadableMap readableMap = writableMap.copy();
|
|
58
|
+
Map<String, Object> map = readableMap.toHashMap();
|
|
59
|
+
return new JSONObject(map).toString();
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
@ReactMethod
|
|
57
63
|
public void init(String apiKey, String userId, String endpoint) {
|
|
58
64
|
final Activity activity = getCurrentActivity();
|
|
@@ -82,7 +88,7 @@ public class RNPlotline extends ReactContextBaseJavaModule {
|
|
|
82
88
|
|
|
83
89
|
WritableMap event = Arguments.createMap();
|
|
84
90
|
event.putString("eventName", eventName);
|
|
85
|
-
event.
|
|
91
|
+
event.putString("properties", writableMapToJson(writableMap));
|
|
86
92
|
|
|
87
93
|
getReactApplicationContext()
|
|
88
94
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
package/index.js
CHANGED
|
@@ -46,7 +46,7 @@ class plotline {
|
|
|
46
46
|
|
|
47
47
|
if (Platform.OS === 'android') {
|
|
48
48
|
this.plotlineEventsSubscription = DeviceEventEmitter.addListener('PlotlineEvents', (event) => {
|
|
49
|
-
this._notifyEvent(event.eventName, event.properties);
|
|
49
|
+
this._notifyEvent(event.eventName, JSON.parse(event.properties));
|
|
50
50
|
});
|
|
51
51
|
this.plotlineRedirectSubscription = DeviceEventEmitter.addListener('PlotlineRedirect', (keyValuePairs) => {
|
|
52
52
|
this._notifyRedirect(keyValuePairs);
|