plotline-engage 4.8.6 → 4.8.7-legacy-2
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
|
@@ -12,6 +12,7 @@ buildscript {
|
|
|
12
12
|
apply plugin: 'com.android.library'
|
|
13
13
|
|
|
14
14
|
android {
|
|
15
|
+
namespace 'com.reactnativeplotline'
|
|
15
16
|
compileSdkVersion 33
|
|
16
17
|
buildToolsVersion "23.0.1"
|
|
17
18
|
compileOptions {
|
|
@@ -32,19 +33,19 @@ android {
|
|
|
32
33
|
|
|
33
34
|
rootProject.allprojects { Project subproject ->
|
|
34
35
|
subproject.repositories {
|
|
35
|
-
maven { url 'https://
|
|
36
|
+
maven { url 'https://jitpack.io' }
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
repositories {
|
|
40
41
|
mavenCentral()
|
|
41
42
|
maven {
|
|
42
|
-
url 'https://
|
|
43
|
+
url 'https://jitpack.io'
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
dependencies {
|
|
47
48
|
implementation 'com.facebook.react:react-native:+'
|
|
48
|
-
implementation '
|
|
49
|
+
implementation 'com.gitlab.plotline:plotline-android-sdk:4.5.7'
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -53,6 +53,11 @@ public class RNPlotline extends ReactContextBaseJavaModule {
|
|
|
53
53
|
return "RNPlotline";
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
public static String writableMapToJson(WritableMap writableMap) {
|
|
57
|
+
Map<String, Object> map = writableMap.toHashMap();
|
|
58
|
+
return new JSONObject(map).toString();
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
@ReactMethod
|
|
57
62
|
public void init(String apiKey, String userId, String endpoint) {
|
|
58
63
|
final Activity activity = getCurrentActivity();
|
|
@@ -82,7 +87,7 @@ public class RNPlotline extends ReactContextBaseJavaModule {
|
|
|
82
87
|
|
|
83
88
|
WritableMap event = Arguments.createMap();
|
|
84
89
|
event.putString("eventName", eventName);
|
|
85
|
-
event.
|
|
90
|
+
event.putString("properties", writableMapToJson(writableMap));
|
|
86
91
|
|
|
87
92
|
getReactApplicationContext()
|
|
88
93
|
.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);
|