react-native-mapp-plugin 1.0.11-beta1 → 1.0.11-beta5

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.
@@ -2,8 +2,7 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="8b4f258a-c093-494f-afe5-5f5a25c90893" name="Default Changelist" comment="">
5
- <change beforePath="$PROJECT_DIR$/android/src/main/java/com/reactlibrary/MessageService.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/reactlibrary/MessageService.java" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/android/src/main/java/com/reactlibrary/RNMappPluginModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/reactlibrary/RNMappPluginModule.java" afterDir="false" />
5
+ <change beforePath="$PROJECT_DIR$/Mapp.js" beforeDir="false" afterPath="$PROJECT_DIR$/Mapp.js" afterDir="false" />
7
6
  <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
8
7
  </list>
9
8
  <option name="SHOW_DIALOG" value="false" />
@@ -81,7 +80,7 @@
81
80
  <workItem from="1633566225798" duration="599000" />
82
81
  <workItem from="1634673153825" duration="3131000" />
83
82
  <workItem from="1635406438746" duration="1187000" />
84
- <workItem from="1635764727836" duration="3806000" />
83
+ <workItem from="1635764727836" duration="11060000" />
85
84
  </task>
86
85
  <task id="LOCAL-00001" summary="new version">
87
86
  <created>1632917445507</created>
@@ -118,7 +117,21 @@
118
117
  <option name="project" value="LOCAL" />
119
118
  <updated>1635407568834</updated>
120
119
  </task>
121
- <option name="localTasksCounter" value="6" />
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
+ <task id="LOCAL-00007" summary="update version">
128
+ <created>1637674196630</created>
129
+ <option name="number" value="00007" />
130
+ <option name="presentableId" value="LOCAL-00007" />
131
+ <option name="project" value="LOCAL" />
132
+ <updated>1637674196630</updated>
133
+ </task>
134
+ <option name="localTasksCounter" value="8" />
122
135
  <servers />
123
136
  </component>
124
137
  <component name="TypeScriptGeneratedFilesManager">
@@ -146,6 +159,8 @@
146
159
  <component name="VcsManagerConfiguration">
147
160
  <MESSAGE value="new version" />
148
161
  <MESSAGE value="Update script to run on all linux systems" />
149
- <option name="LAST_COMMIT_MESSAGE" value="Update script to run on all linux systems" />
162
+ <MESSAGE value="Fixed android issue when engage late" />
163
+ <MESSAGE value="update version" />
164
+ <option name="LAST_COMMIT_MESSAGE" value="update version" />
150
165
  </component>
151
166
  </project>
package/Mapp.js CHANGED
@@ -182,8 +182,21 @@ export class Mapp {
182
182
  * iOS only
183
183
  */
184
184
  static showNotificationAlertView() {
185
- return RNMappPluginModule.showNotificationAlertView();
186
- }
185
+ if (Platform.OS === "ios") {
186
+ return RNMappPluginModule.showNotificationAlertView();
187
+ }
188
+
189
+ }
190
+
191
+ /**
192
+ * Display notifications even app is in foreground .
193
+ * iOS only
194
+ */
195
+ static setShowNotificationsAtForeground(value: boolean) {
196
+ if (Platform.OS === "ios") {
197
+ return RNMappPluginModule.setShowNotificationsAtForeground(value);
198
+ }
199
+ }
187
200
 
188
201
  /**
189
202
  * Set Custom Attribute
@@ -260,6 +273,14 @@ export class Mapp {
260
273
  return RNMappPluginModule.removeBadgeNumber();
261
274
  }
262
275
 
276
+ static startGeofencing():Promise<string> {
277
+ return RNMappPluginModule.startGeofencing();
278
+ }
279
+
280
+ static stopGeofencing() : Promise<string>{
281
+ return RNMappPluginModule.stopGeofencing();
282
+ }
283
+
263
284
  static startGeoFencing() {
264
285
  return RNMappPluginModule.startGeoFencing();
265
286
  }
@@ -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-16/"/>
3
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13/"/>
4
4
  <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5
5
  <classpathentry kind="output" path="bin/default"/>
6
6
  </classpath>
@@ -1,11 +1,11 @@
1
1
  arguments=
2
2
  auto.sync=false
3
3
  build.scans.enabled=false
4
- connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.0-rc-1))
4
+ connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.8))
5
5
  connection.project.dir=
6
6
  eclipse.preferences.version=1
7
7
  gradle.user.home=
8
- java.home=C\:/Program Files/Java/jdk-16.0.2
8
+ java.home=/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home
9
9
  jvm.arguments=
10
10
  offline.mode=false
11
11
  override.workspace.settings=true
@@ -35,12 +35,12 @@ def safeExtGet(prop, fallback) {
35
35
  }
36
36
 
37
37
  android {
38
- compileSdkVersion safeExtGet('compileSdkVersion', 29)
39
- buildToolsVersion safeExtGet('buildToolsVersion', '29.0.2')
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', 29)
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:16.0.0')
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-special8'
76
- }
73
+ implementation 'com.mapp.sdk:mapp-android:6.0.17-special13'
74
+ }
75
+
@@ -19,9 +19,9 @@ public class MessageService extends MappMessagingService {
19
19
 
20
20
  @Override
21
21
  public void onMessageReceived(RemoteMessage remoteMessage) {
22
- int limit = 10;
22
+ int limit = 15;
23
23
  try {
24
- while (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady() || limit != 0) {
24
+ while (limit >= 0 && (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady())) {
25
25
  TimeUnit.MILLISECONDS.sleep(300);
26
26
  limit--;
27
27
  }
@@ -33,9 +33,9 @@ public class MessageService extends MappMessagingService {
33
33
 
34
34
  @Override
35
35
  public void onNewToken(String s) {
36
- int limit = 10;
36
+ int limit = 15;
37
37
  try {
38
- while (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady() || limit != 0) {
38
+ while (limit >= 0 && (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady())) {
39
39
  TimeUnit.MILLISECONDS.sleep(300);
40
40
  limit--;
41
41
  }
@@ -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;
@@ -285,63 +287,38 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
285
287
  }
286
288
 
287
289
  @ReactMethod
288
- public void startGeoFencing() {
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
+ }
289
298
 
290
- Appoxee.instance().startGeoFencing();
291
- // if (Build.VERSION.SDK_INT < 23) {
292
- // Appoxee.instance().startGeoFencing();
293
- // } else if (Build.VERSION.SDK_INT <= 28) {
294
- // RequestPermissionsTask task = new RequestPermissionsTask(getReactApplicationContext(),
295
- // new RequestPermissionsTask.Callback() {
296
- // @Override
297
- // public void onResult(boolean enabled) {
298
- // if (enabled) {
299
- //
300
- // Appoxee.instance().startGeoFencing();
301
- // }
302
- // }
303
- // });
304
- // task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
305
- //
306
- // } else if (Build.VERSION.SDK_INT == 29) {
307
- // RequestPermissionsTask task = new RequestPermissionsTask(getReactApplicationContext(),
308
- // new RequestPermissionsTask.Callback() {
309
- // @Override
310
- // public void onResult(boolean enabled) {
311
- // if (enabled) {
312
- //
313
- // Appoxee.instance().startGeoFencing();
314
- // }
315
- // }
316
- // });
317
- // task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION);
318
- //
319
- // } else if (Build.VERSION.SDK_INT == 30) {
320
- // RequestPermissionsTask task = new RequestPermissionsTask(getReactApplicationContext(),
321
- // new RequestPermissionsTask.Callback() {
322
- // @Override
323
- // public void onResult(boolean enabled) {
324
- // if (enabled) {
325
- // Appoxee.instance().startGeoFencing();
326
- // RequestPermissionsTask task2 = new RequestPermissionsTask(getReactApplicationContext(),
327
- // new RequestPermissionsTask.Callback() {
328
- // @Override
329
- // public void onResult(boolean enabled) {
330
- // if (enabled) {
331
- // Appoxee.instance().startGeoFencing();
332
- // }
333
- // }
334
- // });
335
- // task2.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_BACKGROUND_LOCATION);
336
- //
337
- // }
338
- // }
339
- // });
340
- // task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
341
- // }
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
+ }
342
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();
343
316
  }
344
317
 
318
+ /**
319
+ * Deprecated in Java. Use method {@link #stopGeofencing(ResultCallback)}
320
+ */
321
+ @Deprecated
345
322
  @ReactMethod
346
323
  public void stopGeoFencing() {
347
324
  Appoxee.instance().stopGeoFencing();
@@ -369,8 +346,6 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
369
346
  promise.resolve(messageToJson(message));
370
347
  }
371
348
  });
372
-
373
-
374
349
  }
375
350
 
376
351
  @ReactMethod
@@ -96,6 +96,10 @@ RCT_EXPORT_METHOD(setPostponeNotificationRequest: (BOOL) postpone) {
96
96
  [[Appoxee shared] setPostponeNotificationRequest:postpone];
97
97
  }
98
98
 
99
+ RCT_EXPORT_METHOD(setShowNotificationsAtForeground: (BOOL) value) {
100
+ [[Appoxee shared] setShowNotificationsOnForeground:value];
101
+ }
102
+
99
103
  RCT_EXPORT_METHOD(showNotificationAlertView) {
100
104
  [[Appoxee shared] showNotificationAlertDialog];
101
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-mapp-plugin",
3
- "version": "1.0.11-beta1",
3
+ "version": "1.0.11-beta5",
4
4
  "description": "Mapp SDK for React Native.",
5
5
  "main": "index.js",
6
6
  "scripts": {