react-native-userleap 2.18.7 → 2.18.9
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
|
@@ -75,6 +75,6 @@ dependencies {
|
|
|
75
75
|
if (findProject(':userleap-android-sdk') != null) {
|
|
76
76
|
implementation project(':userleap-android-sdk')
|
|
77
77
|
} else {
|
|
78
|
-
implementation ("com.userleap:userleap-android-sdk:2.19.
|
|
78
|
+
implementation ("com.userleap:userleap-android-sdk:2.19.5") // update this version on android updates
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -25,6 +25,17 @@ import javax.annotation.Nullable;
|
|
|
25
25
|
import kotlin.Unit;
|
|
26
26
|
import kotlin.jvm.functions.Function1;
|
|
27
27
|
|
|
28
|
+
import android.util.Log;
|
|
29
|
+
|
|
30
|
+
import com.userleap.EventListener;
|
|
31
|
+
import com.userleap.EventName;
|
|
32
|
+
import com.userleap.SprigEvent;
|
|
33
|
+
import com.userleap.SprigLoggingLevel;
|
|
34
|
+
import com.userleap.UserLeap;
|
|
35
|
+
|
|
36
|
+
import kotlin.Unit;
|
|
37
|
+
import kotlin.jvm.functions.Function1;
|
|
38
|
+
|
|
28
39
|
public class UserLeapModule extends ReactContextBaseJavaModule {
|
|
29
40
|
|
|
30
41
|
private final ReactApplicationContext reactContext;
|
|
@@ -58,15 +69,37 @@ public class UserLeapModule extends ReactContextBaseJavaModule {
|
|
|
58
69
|
|
|
59
70
|
@ReactMethod
|
|
60
71
|
public void configure(String environment, ReadableMap configuration) {
|
|
61
|
-
UserLeap.INSTANCE.configure(reactContext, environment, stringifyMap(configuration), getFragmentActivity());
|
|
62
|
-
}
|
|
63
72
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
UserLeap.INSTANCE.addEventListener(EventName.LOGGING_EVENT, new EventListener() {
|
|
74
|
+
@Override
|
|
75
|
+
public void onEvent(SprigEvent event) {
|
|
76
|
+
|
|
77
|
+
String tag = "SprigLoggingEvent";
|
|
78
|
+
|
|
79
|
+
switch (event.getLogLevel()) {
|
|
80
|
+
case INFO:
|
|
81
|
+
Log.i(tag, event.getLogMessage());
|
|
82
|
+
break;
|
|
83
|
+
case DEBUG:
|
|
84
|
+
Log.d(tag, event.getLogMessage());
|
|
85
|
+
break;
|
|
86
|
+
case WARNING:
|
|
87
|
+
Log.w(tag, event.getLogMessage());
|
|
88
|
+
break;
|
|
89
|
+
case ERROR:
|
|
90
|
+
case CRITICAL:
|
|
91
|
+
Log.e(tag, event.getLogMessage());
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
UserLeap.INSTANCE.configure(
|
|
98
|
+
reactContext,
|
|
99
|
+
environment,
|
|
100
|
+
stringifyMap(configuration),
|
|
101
|
+
getFragmentActivity()
|
|
102
|
+
);
|
|
70
103
|
}
|
|
71
104
|
|
|
72
105
|
@ReactMethod
|
|
@@ -161,6 +194,11 @@ public class UserLeapModule extends ReactContextBaseJavaModule {
|
|
|
161
194
|
UserLeap.INSTANCE.trackAndPresent(event, userId, partnerAnonymousId, getFragmentActivity());
|
|
162
195
|
}
|
|
163
196
|
|
|
197
|
+
@ReactMethod
|
|
198
|
+
public void presentSurvey() {
|
|
199
|
+
UserLeap.INSTANCE.presentSurvey(null);
|
|
200
|
+
}
|
|
201
|
+
|
|
164
202
|
private @Nullable
|
|
165
203
|
FragmentActivity getFragmentActivity() {
|
|
166
204
|
Activity activity = getCurrentActivity();
|
package/package.json
CHANGED