react-native-mapp-plugin 1.0.10 → 1.0.11-beta11

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.
Files changed (45) hide show
  1. package/Mapp.js +23 -2
  2. package/RNMappPlugin.podspec +1 -1
  3. package/__package.json +2 -2
  4. package/android/.classpath +1 -1
  5. package/android/.settings/org.eclipse.buildship.core.prefs +2 -2
  6. package/android/build.gradle +10 -11
  7. package/android/src/main/AndroidManifest.xml +3 -2
  8. package/android/src/main/java/com/reactlibrary/ActivityListener.java +1 -1
  9. package/android/src/main/java/com/reactlibrary/HelperActivity.java +23 -205
  10. package/android/src/main/java/com/reactlibrary/IntentNotificationEvent.java +0 -2
  11. package/android/src/main/java/com/reactlibrary/MessageService.java +22 -2
  12. package/android/src/main/java/com/reactlibrary/RNMappPluginModule.java +37 -62
  13. package/ios/Frameworks/AppoxeeSDK.xcframework/Info.plist +46 -0
  14. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXClientDevice.h +0 -0
  15. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXInterfaceService.h +0 -0
  16. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXPushNotification.h +0 -0
  17. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXPushNotificationAction.h +0 -0
  18. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXPushNotificationActionButton.h +0 -0
  19. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXPushNotificationActionButtonAction.h +0 -0
  20. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/APXRichMessage.h +0 -0
  21. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/Appoxee.h +0 -0
  22. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/AppoxeeManager.h +0 -0
  23. package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64_armv7}/Headers/AppoxeeSDK.h +0 -0
  24. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_armv7/libAppoxeeSDK.a +0 -0
  25. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXClientDevice.h +26 -0
  26. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXInterfaceService.h +49 -0
  27. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXPushNotification.h +92 -0
  28. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXPushNotificationAction.h +20 -0
  29. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXPushNotificationActionButton.h +19 -0
  30. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXPushNotificationActionButtonAction.h +35 -0
  31. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/APXRichMessage.h +58 -0
  32. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/Appoxee.h +840 -0
  33. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/AppoxeeManager.h +386 -0
  34. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/Headers/AppoxeeSDK.h +12 -0
  35. package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_i386_x86_64-simulator/libAppoxeeSDK.a +0 -0
  36. package/ios/RNMappEventEmmiter.h +1 -1
  37. package/ios/RNMappPluginModule.h +1 -1
  38. package/ios/RNMappPluginModule.m +12 -0
  39. package/package.json +5 -5
  40. package/.idea/React-native-plugin.iml +0 -12
  41. package/.idea/modules.xml +0 -8
  42. package/.idea/vcs.xml +0 -7
  43. package/.idea/workspace.xml +0 -146
  44. package/android/src/main/java/com/reactlibrary/RequestPermissionsTask.java +0 -58
  45. package/ios/Frameworks/AppoxeeSDK.framework/Versions/A/AppoxeeSDK +0 -0
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
  }
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source = { :git => "https://github.com/MappCloud/React-native-plugin", :tag => "#{s.version}" }
17
17
 
18
18
  s.source_files = "ios/**/*.{h,c,m,swift}"
19
- s.vendored_framework = "ios/Frameworks/AppoxeeSDK.framework", "ios/Frameworks/AppoxeeLocationServices.framework", "ios/Frameworks/AppoxeeInapp.framework"
19
+ s.vendored_framework = "ios/Frameworks/AppoxeeSDK.xcframework", "ios/Frameworks/AppoxeeLocationServices.framework", "ios/Frameworks/AppoxeeInapp.framework"
20
20
  s.resources = "ios/Frameworks/AppoxeeSDKResources.bundle", "ios/Frameworks/AppoxeeInappResources.bundle"
21
21
  s.preserve_path = "ios/Frameworks/"
22
22
  # s.public_header_files = "ios/Frameworks/AppoxeeSDK.framework/Headers/"
package/__package.json CHANGED
@@ -18,12 +18,12 @@
18
18
  "author": "Mapp",
19
19
  "license": "MIT",
20
20
  "peerDependencies": {
21
- "react": "^16.8.1",
21
+ "react": "^18.0.0",
22
22
  "react-native": ">=0.60.0-rc.0 <1.0.x"
23
23
  },
24
24
  "devDependencies": {
25
25
  "jest": "^24.9.0",
26
- "react": "^16.9.0",
26
+ "react": "^18.0.0",
27
27
  "react-native": "^0.61.5"
28
28
  },
29
29
  "repository": {
@@ -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-11/"/>
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(7.1.1))
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/temurin-11.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-special17'
74
+ }
75
+
@@ -25,7 +25,7 @@
25
25
  </receiver>
26
26
  <activity
27
27
  android:name=".HelperActivity"
28
- android:exported="true"
28
+ android:exported="false"
29
29
  android:theme="@style/HelperActivityStyle">
30
30
 
31
31
  <intent-filter android:label="mapp">
@@ -42,7 +42,8 @@
42
42
  </intent-filter>
43
43
 
44
44
  </activity>
45
- <service android:name=".MessageService">
45
+ <service android:name=".MessageService"
46
+ android:exported="false">
46
47
  <intent-filter>
47
48
  <action android:name="com.google.firebase.MESSAGING_EVENT" />
48
49
  </intent-filter>
@@ -26,7 +26,7 @@ public class ActivityListener extends Activity {
26
26
  launchIntent.setData(intent.getData());
27
27
  launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
28
28
  startActivity(launchIntent);
29
- Appoxee.handleRichPush(Appoxee.instance().getLastActivity(),intent);
29
+ Appoxee.handleRichPush(this,intent);
30
30
  finish();
31
31
  }
32
32
 
@@ -1,19 +1,12 @@
1
1
  package com.reactlibrary;
2
2
 
3
3
  import android.app.Activity;
4
- import android.content.Context;
4
+ import android.content.ComponentName;
5
5
  import android.content.Intent;
6
6
  import android.content.pm.PackageManager;
7
- import android.os.Build;
8
7
  import android.os.Bundle;
9
- import android.os.Handler;
10
- import android.os.Looper;
11
- import android.os.ResultReceiver;
12
- import androidx.annotation.NonNull;
13
- import androidx.annotation.Nullable;
14
- import androidx.annotation.WorkerThread;
15
- import androidx.core.content.ContextCompat;
16
8
 
9
+ import androidx.annotation.Nullable;
17
10
 
18
11
  import java.util.Objects;
19
12
 
@@ -23,22 +16,6 @@ import java.util.Objects;
23
16
  */
24
17
  public class HelperActivity extends Activity {
25
18
 
26
- @NonNull
27
- public static final String PERMISSIONS_EXTRA = "com.mapp.PERMISSIONS_EXTRA";
28
-
29
- @NonNull
30
- public static final String RESULT_RECEIVER_EXTRA = "com.mapp.RESULT_RECEIVER_EXTRA";
31
-
32
- @NonNull
33
- public static final String RESULT_INTENT_EXTRA = "com.mapp.RESULT_INTENT_EXTRA";
34
-
35
-
36
- @NonNull
37
- public static final String START_ACTIVITY_INTENT_EXTRA = "com.mapp.START_ACTIVITY_INTENT_EXTRA";
38
-
39
- private ResultReceiver resultReceiver;
40
- private static int requestCode = 0;
41
-
42
19
  @Override
43
20
  public final void onCreate(@Nullable Bundle savedInstanceState) {
44
21
  super.onCreate(savedInstanceState);
@@ -49,27 +26,23 @@ public class HelperActivity extends Activity {
49
26
  finish();
50
27
  return;
51
28
  }
52
- if (intent.getAction() != null)
53
- if (!intent.getAction().equals("")) {
29
+
30
+ ComponentName name = intent.getComponent();
31
+ String packageName = getPackageName();
32
+
33
+ if (Objects.equals(name.getPackageName(), packageName)) {
34
+ if (intent.getAction() != null && !intent.getAction().equals("")) {
54
35
  Intent launchIntent = getDefaultActivityIntent();
55
- launchIntent.putExtra("action", intent.getAction());
56
- launchIntent.setData(intent.getData());
57
- launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
58
- startActivity(launchIntent);
59
- EventEmitter.shared().sendEvent(new IntentNotificationEvent(Objects.requireNonNull(intent.getData()), intent.getAction()));
60
- finish();
61
- }
62
- if (savedInstanceState == null) {
63
- Intent startActivityIntent = intent.getParcelableExtra(START_ACTIVITY_INTENT_EXTRA);
64
- String[] permissions = intent.getStringArrayExtra(PERMISSIONS_EXTRA);
36
+ ComponentName launcherComponent = launchIntent.getComponent();
37
+
38
+ if (Objects.equals(launcherComponent.getPackageName(), packageName)) {
39
+ launchIntent.putExtra("action", intent.getAction());
40
+ launchIntent.setData(intent.getData());
41
+ launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
42
+ startActivity(launchIntent);
43
+ }
65
44
 
66
- if (startActivityIntent != null) {
67
- resultReceiver = intent.getParcelableExtra(RESULT_RECEIVER_EXTRA);
68
- startActivityForResult(startActivityIntent, ++requestCode);
69
- } else if (Build.VERSION.SDK_INT >= 23 && permissions != null) {
70
- resultReceiver = intent.getParcelableExtra(RESULT_RECEIVER_EXTRA);
71
- requestPermissions(permissions, ++requestCode);
72
- } else {
45
+ EventEmitter.shared().sendEvent(new IntentNotificationEvent(Objects.requireNonNull(intent.getData()), intent.getAction()));
73
46
  finish();
74
47
  }
75
48
  }
@@ -86,169 +59,14 @@ public class HelperActivity extends Activity {
86
59
  if (intent == null) {
87
60
  return;
88
61
  }
89
- if (intent.getAction() != null)
90
- if (!intent.getAction().equals("")) {
91
- EventEmitter.shared().sendEvent(new IntentNotificationEvent(Objects.requireNonNull(intent.getData()), intent.getAction()));
92
- }
93
- }
94
-
95
- @Override
96
- protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
97
- if (resultReceiver != null) {
98
- Bundle bundledData = new Bundle();
99
- bundledData.putParcelable(RESULT_INTENT_EXTRA, data);
100
- resultReceiver.send(resultCode, bundledData);
101
- }
102
-
103
- super.onActivityResult(requestCode, resultCode, data);
104
- this.finish();
105
- }
106
-
107
- @Override
108
- public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
109
- if (resultReceiver != null) {
110
- Bundle bundledData = new Bundle();
111
- bundledData.putIntArray(RESULT_INTENT_EXTRA, grantResults);
112
- resultReceiver.send(Activity.RESULT_OK, bundledData);
113
- }
114
-
115
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
116
- finish();
117
- }
118
-
119
- /**
120
- * Requests permissions.
121
- *
122
- * @param context The application context.
123
- * @param permissions The permissions to request.
124
- * @return The result from requesting permissions.
125
- */
126
- @WorkerThread
127
- @NonNull
128
- public static int[] requestPermissions(@NonNull Context context, @NonNull String... permissions) {
129
- context = context.getApplicationContext();
130
- boolean permissionsDenied = false;
131
-
132
- final int[] result = new int[permissions.length];
133
- for (int i = 0; i < result.length; i++) {
134
- result[i] = ContextCompat.checkSelfPermission(context, permissions[i]);
135
- if (result[i] == PackageManager.PERMISSION_DENIED) {
136
- permissionsDenied = true;
137
- }
138
- }
139
-
140
- if (!permissionsDenied || Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
141
- return result;
142
- }
143
-
144
- ResultReceiver receiver = new ResultReceiver(new Handler(Looper.getMainLooper())) {
145
- @Override
146
- public void onReceiveResult(int resultCode, Bundle resultData) {
147
- int[] receiverResults = resultData.getIntArray(HelperActivity.RESULT_INTENT_EXTRA);
148
- if (receiverResults != null && receiverResults.length == result.length) {
149
- System.arraycopy(receiverResults, 0, result, 0, result.length);
150
- }
151
-
152
- synchronized (result) {
153
- result.notify();
154
- }
155
- }
156
- };
157
-
158
- Intent startingIntent = new Intent(context, HelperActivity.class)
159
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
160
- .setPackage(context.getPackageName())
161
- .putExtra(HelperActivity.PERMISSIONS_EXTRA, permissions)
162
- .putExtra(HelperActivity.RESULT_RECEIVER_EXTRA, receiver);
163
-
164
- synchronized (result) {
165
- context.startActivity(startingIntent);
166
- try {
167
- result.wait();
168
- } catch (InterruptedException e) {
169
- Thread.currentThread().interrupt();
170
- }
171
- }
172
-
173
- return result;
174
- }
175
-
176
- /**
177
- * Starts an activity for a result.
178
- *
179
- * @param context The application context.
180
- * @param intent The activity to start.
181
- * @return The result of the activity in a ActivityResult object.
182
- */
183
- @NonNull
184
- @WorkerThread
185
- public static ActivityResult startActivityForResult(@NonNull Context context, @NonNull Intent intent) {
186
- context = context.getApplicationContext();
187
- final ActivityResult result = new ActivityResult();
188
-
189
- ResultReceiver receiver = new ResultReceiver(new Handler(Looper.getMainLooper())) {
190
- @Override
191
- public void onReceiveResult(int resultCode, Bundle resultData) {
192
- result.setResult(resultCode, (Intent) resultData.getParcelable(HelperActivity.RESULT_INTENT_EXTRA));
193
- synchronized (result) {
194
- result.notify();
195
- }
196
- }
197
- };
198
62
 
199
- Intent startingIntent = new Intent(context, HelperActivity.class)
200
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
201
- .setPackage(context.getPackageName())
202
- .putExtra(HelperActivity.START_ACTIVITY_INTENT_EXTRA, intent)
203
- .putExtra(HelperActivity.RESULT_RECEIVER_EXTRA, receiver);
63
+ ComponentName name = intent.getComponent();
64
+ String packageName = getPackageName();
204
65
 
205
- synchronized (result) {
206
- context.startActivity(startingIntent);
207
- try {
208
- result.wait();
209
- } catch (InterruptedException e) {
210
- Thread.currentThread().interrupt();
211
- return new ActivityResult();
66
+ if (Objects.equals(name.getPackageName(), packageName)) {
67
+ if (intent.getAction() != null && !intent.getAction().equals("")) {
68
+ EventEmitter.shared().sendEvent(new IntentNotificationEvent(Objects.requireNonNull(intent.getData()), intent.getAction()));
212
69
  }
213
70
  }
214
-
215
- return result;
216
- }
217
-
218
- /**
219
- * Wraps the result code and data from starting an activity
220
- * for a result.
221
- */
222
- public static class ActivityResult {
223
-
224
- private int resultCode = Activity.RESULT_CANCELED;
225
- private Intent intent;
226
-
227
- /**
228
- * Gets the result intent.
229
- *
230
- * @return The result intent from the activity.
231
- */
232
- @Nullable
233
- public Intent getIntent() {
234
- return intent;
235
- }
236
-
237
- /**
238
- * Gets the result code from the activity.
239
- *
240
- * @return The result code from the activity.
241
- */
242
- public int getResultCode() {
243
- return resultCode;
244
- }
245
-
246
- private void setResult(int resultCode, @Nullable Intent intent) {
247
- this.resultCode = resultCode;
248
- this.intent = intent;
249
- }
250
-
251
71
  }
252
-
253
- }
254
-
72
+ }
@@ -49,6 +49,4 @@ public class IntentNotificationEvent implements Event {
49
49
  this.message = message;
50
50
  this.type = type;
51
51
  }
52
-
53
-
54
52
  }
@@ -1,11 +1,17 @@
1
1
  package com.reactlibrary;
2
2
 
3
+ import androidx.annotation.NonNull;
4
+
3
5
  import com.appoxee.Appoxee;
6
+ import com.appoxee.internal.logger.LoggerFactory;
7
+ import com.appoxee.internal.service.AppoxeeServiceAdapter;
4
8
  import com.appoxee.push.fcm.MappMessagingService;
5
9
  import com.google.firebase.messaging.RemoteMessage;
6
10
 
11
+ import java.util.concurrent.TimeUnit;
12
+
7
13
 
8
- public class MessageService extends MappMessagingService {
14
+ public class MessageService extends MappMessagingService {
9
15
 
10
16
  @Override
11
17
  public void onCreate() {
@@ -14,12 +20,26 @@ public class MessageService extends MappMessagingService {
14
20
  }
15
21
 
16
22
  @Override
17
- public void onMessageReceived(RemoteMessage remoteMessage) {
23
+ public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
24
+ waitInitialization();
18
25
  super.onMessageReceived(remoteMessage);
19
26
  }
20
27
 
21
28
  @Override
22
29
  public void onNewToken(String s) {
30
+ waitInitialization();
23
31
  super.onNewToken(s);
24
32
  }
33
+
34
+ private void waitInitialization(){
35
+ int limit=15;
36
+ try{
37
+ while (limit >= 0 && !Appoxee.instance().isReady()) {
38
+ TimeUnit.MILLISECONDS.sleep(300);
39
+ limit--;
40
+ }
41
+ }catch (Exception e){
42
+ LoggerFactory.getDevLogger().e(e.getMessage());
43
+ }
44
+ }
25
45
  }
@@ -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
- public void setRemoteMessage(String msgJson) {
111
- RemoteMessage remoteMessage = getRemoteMessage(msgJson);
112
- if (remoteMessage != null){
113
- Appoxee.instance().setRemoteMessage(remoteMessage);
114
- }
115
- }
112
+ public void setRemoteMessage(String msgJson) {
113
+ RemoteMessage remoteMessage = getRemoteMessage(msgJson);
114
+ if (remoteMessage != null) {
115
+ Appoxee.instance().setRemoteMessage(remoteMessage);
116
+ }
117
+ }
116
118
 
117
119
  @ReactMethod
118
120
  public void isPushFromMapp(String msgJson, Promise promise) {
@@ -284,63 +286,38 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
284
286
  }
285
287
 
286
288
  @ReactMethod
287
- 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
+ }
288
297
 
289
- Appoxee.instance().startGeoFencing();
290
- // if (Build.VERSION.SDK_INT < 23) {
291
- // Appoxee.instance().startGeoFencing();
292
- // } else if (Build.VERSION.SDK_INT <= 28) {
293
- // RequestPermissionsTask task = new RequestPermissionsTask(getReactApplicationContext(),
294
- // new RequestPermissionsTask.Callback() {
295
- // @Override
296
- // public void onResult(boolean enabled) {
297
- // if (enabled) {
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
- // }
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
+ }
341
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();
342
315
  }
343
316
 
317
+ /**
318
+ * Deprecated in Java. Use method {@link #stopGeofencing(ResultCallback)}
319
+ */
320
+ @Deprecated
344
321
  @ReactMethod
345
322
  public void stopGeoFencing() {
346
323
  Appoxee.instance().stopGeoFencing();
@@ -368,8 +345,6 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
368
345
  promise.resolve(messageToJson(message));
369
346
  }
370
347
  });
371
-
372
-
373
348
  }
374
349
 
375
350
  @ReactMethod
@@ -598,4 +573,4 @@ private RemoteMessage getRemoteMessage(String jsonMsg) {
598
573
  }
599
574
 
600
575
 
601
- }
576
+ }
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>HeadersPath</key>
9
+ <string>Headers</string>
10
+ <key>LibraryIdentifier</key>
11
+ <string>ios-arm64_armv7</string>
12
+ <key>LibraryPath</key>
13
+ <string>libAppoxeeSDK.a</string>
14
+ <key>SupportedArchitectures</key>
15
+ <array>
16
+ <string>arm64</string>
17
+ <string>armv7</string>
18
+ </array>
19
+ <key>SupportedPlatform</key>
20
+ <string>ios</string>
21
+ </dict>
22
+ <dict>
23
+ <key>HeadersPath</key>
24
+ <string>Headers</string>
25
+ <key>LibraryIdentifier</key>
26
+ <string>ios-arm64_i386_x86_64-simulator</string>
27
+ <key>LibraryPath</key>
28
+ <string>libAppoxeeSDK.a</string>
29
+ <key>SupportedArchitectures</key>
30
+ <array>
31
+ <string>arm64</string>
32
+ <string>i386</string>
33
+ <string>x86_64</string>
34
+ </array>
35
+ <key>SupportedPlatform</key>
36
+ <string>ios</string>
37
+ <key>SupportedPlatformVariant</key>
38
+ <string>simulator</string>
39
+ </dict>
40
+ </array>
41
+ <key>CFBundlePackageType</key>
42
+ <string>XFWK</string>
43
+ <key>XCFrameworkFormatVersion</key>
44
+ <string>1.0</string>
45
+ </dict>
46
+ </plist>