react-native-mapp-plugin 1.0.11-beta3 → 1.0.11-beta7

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.
@@ -1,7 +1,9 @@
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$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
6
+ </list>
5
7
  <option name="SHOW_DIALOG" value="false" />
6
8
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
7
9
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -77,7 +79,8 @@
77
79
  <workItem from="1633566225798" duration="599000" />
78
80
  <workItem from="1634673153825" duration="3131000" />
79
81
  <workItem from="1635406438746" duration="1187000" />
80
- <workItem from="1635764727836" duration="7302000" />
82
+ <workItem from="1635764727836" duration="11858000" />
83
+ <workItem from="1640361194537" duration="75000" />
81
84
  </task>
82
85
  <task id="LOCAL-00001" summary="new version">
83
86
  <created>1632917445507</created>
@@ -121,7 +124,21 @@
121
124
  <option name="project" value="LOCAL" />
122
125
  <updated>1635776654720</updated>
123
126
  </task>
124
- <option name="localTasksCounter" value="7" />
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
+ <task id="LOCAL-00008" summary="new version with ios Foreground">
135
+ <created>1638346042259</created>
136
+ <option name="number" value="00008" />
137
+ <option name="presentableId" value="LOCAL-00008" />
138
+ <option name="project" value="LOCAL" />
139
+ <updated>1638346042259</updated>
140
+ </task>
141
+ <option name="localTasksCounter" value="9" />
125
142
  <servers />
126
143
  </component>
127
144
  <component name="TypeScriptGeneratedFilesManager">
@@ -150,6 +167,8 @@
150
167
  <MESSAGE value="new version" />
151
168
  <MESSAGE value="Update script to run on all linux systems" />
152
169
  <MESSAGE value="Fixed android issue when engage late" />
153
- <option name="LAST_COMMIT_MESSAGE" value="Fixed android issue when engage late" />
170
+ <MESSAGE value="update version" />
171
+ <MESSAGE value="new version with ios Foreground" />
172
+ <option name="LAST_COMMIT_MESSAGE" value="new version with ios Foreground" />
154
173
  </component>
155
174
  </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,7 +54,6 @@ android {
54
54
  }
55
55
 
56
56
  dependencies {
57
-
58
57
  implementation('com.facebook.react:react-native:+')
59
58
  implementation 'com.android.support:appcompat-v7:28.0.0'
60
59
  implementation 'com.google.code.gson:gson:2.8.5'
@@ -71,5 +70,6 @@ dependencies {
71
70
  }
72
71
  implementation 'androidx.media:media:1.0.1'
73
72
  implementation 'androidx.legacy:legacy-support-v13:1.0.0'
74
- implementation 'com.mapp.sdk:mapp-android:6.0.17-special12'
73
+ implementation 'com.mapp.sdk:mapp-android:6.0.17-special15'
75
74
  }
75
+
@@ -1,5 +1,7 @@
1
1
  package com.reactlibrary;
2
2
 
3
+ import androidx.annotation.NonNull;
4
+
3
5
  import com.appoxee.Appoxee;
4
6
  import com.appoxee.internal.logger.LoggerFactory;
5
7
  import com.appoxee.internal.service.AppoxeeServiceAdapter;
@@ -18,29 +20,25 @@ public class MessageService extends MappMessagingService {
18
20
  }
19
21
 
20
22
  @Override
21
- public void onMessageReceived(RemoteMessage remoteMessage) {
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
- }
23
+ public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
24
+ waitInitialization();
25
+ super.onMessageReceived(remoteMessage);
32
26
  }
33
27
 
34
28
  @Override
35
29
  public void onNewToken(String s) {
36
- int limit = 15;
37
- try {
38
- while (limit >= 0 && (AppoxeeServiceAdapter.getInstance() == null || !AppoxeeServiceAdapter.getInstance().isQueryReady())) {
30
+ waitInitialization();
31
+ super.onNewToken(s);
32
+ }
33
+
34
+ private void waitInitialization(){
35
+ int limit=15;
36
+ try{
37
+ while (limit >= 0 && !Appoxee.instance().isReady()) {
39
38
  TimeUnit.MILLISECONDS.sleep(300);
40
39
  limit--;
41
40
  }
42
- super.onNewToken(s);
43
- } catch (Exception e) {
41
+ }catch (Exception e){
44
42
  LoggerFactory.getDevLogger().e(e.getMessage());
45
43
  }
46
44
  }
@@ -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;
@@ -109,7 +111,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
109
111
  @ReactMethod
110
112
  public void setRemoteMessage(String msgJson) {
111
113
  RemoteMessage remoteMessage = getRemoteMessage(msgJson);
112
- if (remoteMessage != null && Appoxee.instance() != null) {
114
+ if (remoteMessage != null) {
113
115
  Appoxee.instance().setRemoteMessage(remoteMessage);
114
116
  }
115
117
  }
@@ -127,7 +129,6 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
127
129
 
128
130
  @ReactMethod
129
131
  public void setToken(String token) {
130
- if (Appoxee.instance() != null)
131
132
  Appoxee.instance().setToken(token);
132
133
  }
133
134
 
@@ -285,63 +286,38 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
285
286
  }
286
287
 
287
288
  @ReactMethod
288
- public void startGeoFencing() {
289
+ public void startGeofencing(final Promise promise) {
290
+ Appoxee.instance().startGeoFencing(new ResultCallback<String>() {
291
+ @Override
292
+ public void onResult(@Nullable String result) {
293
+ promise.resolve(result);
294
+ }
295
+ });
296
+ }
289
297
 
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
- // }
298
+ @ReactMethod
299
+ public void stopGeofencing(final Promise promise) {
300
+ Appoxee.instance().stopGeoFencing(new ResultCallback<String>() {
301
+ @Override
302
+ public void onResult(@Nullable String result) {
303
+ promise.resolve(result);
304
+ }
305
+ });
306
+ }
342
307
 
308
+ /**
309
+ * This method is deprecated in Java. Use method {@link #startGeofencing(ResultCallback)}}
310
+ */
311
+ @ReactMethod
312
+ @Deprecated()
313
+ public void startGeoFencing() {
314
+ Appoxee.instance().startGeoFencing();
343
315
  }
344
316
 
317
+ /**
318
+ * Deprecated in Java. Use method {@link #stopGeofencing(ResultCallback)}
319
+ */
320
+ @Deprecated
345
321
  @ReactMethod
346
322
  public void stopGeoFencing() {
347
323
  Appoxee.instance().stopGeoFencing();
@@ -369,8 +345,6 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
369
345
  promise.resolve(messageToJson(message));
370
346
  }
371
347
  });
372
-
373
-
374
348
  }
375
349
 
376
350
  @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-beta3",
3
+ "version": "1.0.11-beta7",
4
4
  "description": "Mapp SDK for React Native.",
5
5
  "main": "index.js",
6
6
  "scripts": {