react-native-mapp-plugin 1.0.10 → 1.0.11-beta4
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/.idea/workspace.xml +16 -4
- package/android/.classpath +1 -1
- package/android/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/android/build.gradle +10 -11
- package/android/src/main/java/com/reactlibrary/MessageService.java +25 -3
- package/android/src/main/java/com/reactlibrary/RNMappPluginModule.java +38 -62
- package/package.json +1 -1
package/.idea/workspace.xml
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
|
-
<list default="true" id="8b4f258a-c093-494f-afe5-5f5a25c90893" name="Default Changelist" comment=""
|
|
4
|
+
<list default="true" id="8b4f258a-c093-494f-afe5-5f5a25c90893" name="Default Changelist" comment="">
|
|
5
|
+
<change beforePath="$PROJECT_DIR$/android/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/android/build.gradle" afterDir="false" />
|
|
6
|
+
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
7
|
+
</list>
|
|
5
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
6
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
7
10
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -76,7 +79,8 @@
|
|
|
76
79
|
<workItem from="1632991423561" duration="15597000" />
|
|
77
80
|
<workItem from="1633566225798" duration="599000" />
|
|
78
81
|
<workItem from="1634673153825" duration="3131000" />
|
|
79
|
-
<workItem from="1635406438746" duration="
|
|
82
|
+
<workItem from="1635406438746" duration="1187000" />
|
|
83
|
+
<workItem from="1635764727836" duration="10080000" />
|
|
80
84
|
</task>
|
|
81
85
|
<task id="LOCAL-00001" summary="new version">
|
|
82
86
|
<created>1632917445507</created>
|
|
@@ -113,7 +117,14 @@
|
|
|
113
117
|
<option name="project" value="LOCAL" />
|
|
114
118
|
<updated>1635407568834</updated>
|
|
115
119
|
</task>
|
|
116
|
-
<
|
|
120
|
+
<task id="LOCAL-00006" summary="Fixed android issue when engage late">
|
|
121
|
+
<created>1635776654720</created>
|
|
122
|
+
<option name="number" value="00006" />
|
|
123
|
+
<option name="presentableId" value="LOCAL-00006" />
|
|
124
|
+
<option name="project" value="LOCAL" />
|
|
125
|
+
<updated>1635776654720</updated>
|
|
126
|
+
</task>
|
|
127
|
+
<option name="localTasksCounter" value="7" />
|
|
117
128
|
<servers />
|
|
118
129
|
</component>
|
|
119
130
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -141,6 +152,7 @@
|
|
|
141
152
|
<component name="VcsManagerConfiguration">
|
|
142
153
|
<MESSAGE value="new version" />
|
|
143
154
|
<MESSAGE value="Update script to run on all linux systems" />
|
|
144
|
-
<
|
|
155
|
+
<MESSAGE value="Fixed android issue when engage late" />
|
|
156
|
+
<option name="LAST_COMMIT_MESSAGE" value="Fixed android issue when engage late" />
|
|
145
157
|
</component>
|
|
146
158
|
</project>
|
package/android/.classpath
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<classpath>
|
|
3
|
-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-
|
|
3
|
+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
|
4
4
|
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
|
5
5
|
<classpathentry kind="output" path="bin/default"/>
|
|
6
6
|
</classpath>
|
|
@@ -5,7 +5,7 @@ connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.0-rc-1))
|
|
|
5
5
|
connection.project.dir=
|
|
6
6
|
eclipse.preferences.version=1
|
|
7
7
|
gradle.user.home=
|
|
8
|
-
java.home
|
|
8
|
+
java.home=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home
|
|
9
9
|
jvm.arguments=
|
|
10
10
|
offline.mode=false
|
|
11
11
|
override.workspace.settings=true
|
package/android/build.gradle
CHANGED
|
@@ -35,12 +35,12 @@ def safeExtGet(prop, fallback) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
android {
|
|
38
|
-
compileSdkVersion safeExtGet('compileSdkVersion',
|
|
39
|
-
buildToolsVersion safeExtGet('buildToolsVersion', '
|
|
38
|
+
compileSdkVersion safeExtGet('compileSdkVersion', 31)
|
|
39
|
+
buildToolsVersion safeExtGet('buildToolsVersion', '30.0.3')
|
|
40
40
|
|
|
41
41
|
defaultConfig {
|
|
42
42
|
minSdkVersion safeExtGet('minSdkVersion', 19)
|
|
43
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
43
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 31)
|
|
44
44
|
versionCode 1
|
|
45
45
|
versionName '1.0'
|
|
46
46
|
}
|
|
@@ -54,12 +54,7 @@ android {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
dependencies {
|
|
57
|
-
|
|
58
57
|
implementation('com.facebook.react:react-native:+')
|
|
59
|
-
implementation('com.google.android.gms:play-services-location:16.0.0')
|
|
60
|
-
{
|
|
61
|
-
exclude group: 'com.android.support'
|
|
62
|
-
}
|
|
63
58
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
|
64
59
|
implementation 'com.google.code.gson:gson:2.8.5'
|
|
65
60
|
implementation 'com.google.dagger:dagger:2.24'
|
|
@@ -69,8 +64,12 @@ dependencies {
|
|
|
69
64
|
{
|
|
70
65
|
exclude group: 'com.android.support'
|
|
71
66
|
}
|
|
72
|
-
api('com.google.android.gms:play-services-location:
|
|
67
|
+
api('com.google.android.gms:play-services-location:18.0.0')
|
|
68
|
+
{
|
|
69
|
+
exclude group: 'com.android.support'
|
|
70
|
+
}
|
|
73
71
|
implementation 'androidx.media:media:1.0.1'
|
|
74
72
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
75
|
-
implementation 'com.mapp.sdk:mapp-android:6.0.17-
|
|
76
|
-
}
|
|
73
|
+
implementation 'com.mapp.sdk:mapp-android:6.0.17-special13'
|
|
74
|
+
}
|
|
75
|
+
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
package com.reactlibrary;
|
|
2
2
|
|
|
3
3
|
import com.appoxee.Appoxee;
|
|
4
|
+
import com.appoxee.internal.logger.LoggerFactory;
|
|
5
|
+
import com.appoxee.internal.service.AppoxeeServiceAdapter;
|
|
4
6
|
import com.appoxee.push.fcm.MappMessagingService;
|
|
5
7
|
import com.google.firebase.messaging.RemoteMessage;
|
|
6
8
|
|
|
9
|
+
import java.util.concurrent.TimeUnit;
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
|
|
12
|
+
public class MessageService extends MappMessagingService {
|
|
9
13
|
|
|
10
14
|
@Override
|
|
11
15
|
public void onCreate() {
|
|
@@ -15,11 +19,29 @@ public class MessageService extends MappMessagingService {
|
|
|
15
19
|
|
|
16
20
|
@Override
|
|
17
21
|
public void onMessageReceived(RemoteMessage remoteMessage) {
|
|
18
|
-
|
|
22
|
+
int limit = 15;
|
|
23
|
+
try {
|
|
24
|
+
while (limit >= 0 && (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady())) {
|
|
25
|
+
TimeUnit.MILLISECONDS.sleep(300);
|
|
26
|
+
limit--;
|
|
27
|
+
}
|
|
28
|
+
super.onMessageReceived(remoteMessage);
|
|
29
|
+
} catch (Exception e) {
|
|
30
|
+
LoggerFactory.getDevLogger().e(e.getMessage());
|
|
31
|
+
}
|
|
19
32
|
}
|
|
20
33
|
|
|
21
34
|
@Override
|
|
22
35
|
public void onNewToken(String s) {
|
|
23
|
-
|
|
36
|
+
int limit = 15;
|
|
37
|
+
try {
|
|
38
|
+
while (limit >= 0 && (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady())) {
|
|
39
|
+
TimeUnit.MILLISECONDS.sleep(300);
|
|
40
|
+
limit--;
|
|
41
|
+
}
|
|
42
|
+
super.onNewToken(s);
|
|
43
|
+
} catch (Exception e) {
|
|
44
|
+
LoggerFactory.getDevLogger().e(e.getMessage());
|
|
45
|
+
}
|
|
24
46
|
}
|
|
25
47
|
}
|
|
@@ -8,6 +8,7 @@ import android.content.pm.PackageManager;
|
|
|
8
8
|
import android.os.Build;
|
|
9
9
|
import android.util.Log;
|
|
10
10
|
|
|
11
|
+
import androidx.annotation.Nullable;
|
|
11
12
|
import androidx.core.app.NotificationManagerCompat;
|
|
12
13
|
import androidx.core.content.ContextCompat;
|
|
13
14
|
|
|
@@ -22,6 +23,7 @@ import com.appoxee.internal.inapp.model.MessageContext;
|
|
|
22
23
|
import com.appoxee.internal.inapp.model.Tracking;
|
|
23
24
|
import com.appoxee.internal.inapp.model.TrackingAttributes;
|
|
24
25
|
import com.appoxee.internal.service.AppoxeeServiceAdapter;
|
|
26
|
+
import com.appoxee.internal.util.ResultCallback;
|
|
25
27
|
import com.appoxee.push.NotificationMode;
|
|
26
28
|
import com.appoxee.push.PushData;
|
|
27
29
|
import com.facebook.react.bridge.Arguments;
|
|
@@ -107,12 +109,12 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
@ReactMethod
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
public void setRemoteMessage(String msgJson) {
|
|
113
|
+
RemoteMessage remoteMessage = getRemoteMessage(msgJson);
|
|
114
|
+
if (remoteMessage != null && Appoxee.instance() != null) {
|
|
115
|
+
Appoxee.instance().setRemoteMessage(remoteMessage);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
116
118
|
|
|
117
119
|
@ReactMethod
|
|
118
120
|
public void isPushFromMapp(String msgJson, Promise promise) {
|
|
@@ -127,6 +129,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
127
129
|
|
|
128
130
|
@ReactMethod
|
|
129
131
|
public void setToken(String token) {
|
|
132
|
+
if (Appoxee.instance() != null)
|
|
130
133
|
Appoxee.instance().setToken(token);
|
|
131
134
|
}
|
|
132
135
|
|
|
@@ -284,63 +287,38 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
284
287
|
}
|
|
285
288
|
|
|
286
289
|
@ReactMethod
|
|
287
|
-
public void
|
|
290
|
+
public void startGeofencing(final Promise promise) {
|
|
291
|
+
Appoxee.instance().startGeoFencing(new ResultCallback<String>() {
|
|
292
|
+
@Override
|
|
293
|
+
public void onResult(@Nullable String result) {
|
|
294
|
+
promise.resolve(result);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
288
298
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
//
|
|
299
|
-
// Appoxee.instance().startGeoFencing();
|
|
300
|
-
// }
|
|
301
|
-
// }
|
|
302
|
-
// });
|
|
303
|
-
// task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
|
|
304
|
-
//
|
|
305
|
-
// } else if (Build.VERSION.SDK_INT == 29) {
|
|
306
|
-
// RequestPermissionsTask task = new RequestPermissionsTask(getReactApplicationContext(),
|
|
307
|
-
// new RequestPermissionsTask.Callback() {
|
|
308
|
-
// @Override
|
|
309
|
-
// public void onResult(boolean enabled) {
|
|
310
|
-
// if (enabled) {
|
|
311
|
-
//
|
|
312
|
-
// Appoxee.instance().startGeoFencing();
|
|
313
|
-
// }
|
|
314
|
-
// }
|
|
315
|
-
// });
|
|
316
|
-
// task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION);
|
|
317
|
-
//
|
|
318
|
-
// } else if (Build.VERSION.SDK_INT == 30) {
|
|
319
|
-
// RequestPermissionsTask task = new RequestPermissionsTask(getReactApplicationContext(),
|
|
320
|
-
// new RequestPermissionsTask.Callback() {
|
|
321
|
-
// @Override
|
|
322
|
-
// public void onResult(boolean enabled) {
|
|
323
|
-
// if (enabled) {
|
|
324
|
-
// Appoxee.instance().startGeoFencing();
|
|
325
|
-
// RequestPermissionsTask task2 = new RequestPermissionsTask(getReactApplicationContext(),
|
|
326
|
-
// new RequestPermissionsTask.Callback() {
|
|
327
|
-
// @Override
|
|
328
|
-
// public void onResult(boolean enabled) {
|
|
329
|
-
// if (enabled) {
|
|
330
|
-
// Appoxee.instance().startGeoFencing();
|
|
331
|
-
// }
|
|
332
|
-
// }
|
|
333
|
-
// });
|
|
334
|
-
// task2.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_BACKGROUND_LOCATION);
|
|
335
|
-
//
|
|
336
|
-
// }
|
|
337
|
-
// }
|
|
338
|
-
// });
|
|
339
|
-
// task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
|
|
340
|
-
// }
|
|
299
|
+
@ReactMethod
|
|
300
|
+
public void stopGeofencing(final Promise promise) {
|
|
301
|
+
Appoxee.instance().stopGeoFencing(new ResultCallback<String>() {
|
|
302
|
+
@Override
|
|
303
|
+
public void onResult(@Nullable String result) {
|
|
304
|
+
promise.resolve(result);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
341
308
|
|
|
309
|
+
/**
|
|
310
|
+
* This method is deprecated in Java. Use method {@link #startGeofencing(ResultCallback)}}
|
|
311
|
+
*/
|
|
312
|
+
@ReactMethod
|
|
313
|
+
@Deprecated()
|
|
314
|
+
public void startGeoFencing() {
|
|
315
|
+
Appoxee.instance().startGeoFencing();
|
|
342
316
|
}
|
|
343
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Deprecated in Java. Use method {@link #stopGeofencing(ResultCallback)}
|
|
320
|
+
*/
|
|
321
|
+
@Deprecated
|
|
344
322
|
@ReactMethod
|
|
345
323
|
public void stopGeoFencing() {
|
|
346
324
|
Appoxee.instance().stopGeoFencing();
|
|
@@ -368,8 +346,6 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
368
346
|
promise.resolve(messageToJson(message));
|
|
369
347
|
}
|
|
370
348
|
});
|
|
371
|
-
|
|
372
|
-
|
|
373
349
|
}
|
|
374
350
|
|
|
375
351
|
@ReactMethod
|
|
@@ -598,4 +574,4 @@ private RemoteMessage getRemoteMessage(String jsonMsg) {
|
|
|
598
574
|
}
|
|
599
575
|
|
|
600
576
|
|
|
601
|
-
}
|
|
577
|
+
}
|