@woosmap/react-native-plugin-geofencing 1.0.0-beta.1 → 1.0.0-beta.3
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/CHANGELOG.md +1 -2
- package/README.md +0 -9
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/AbstractPushHelper.java +1 -1
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/AirshipPushHelper.java +1 -1
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/WoosLocationReadyListener.java +1 -1
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/WoosRegionReadyListener.java +1 -1
- package/android/src/main/java/com/woosmap/reactnativeplugingeofencing/WoosmapGeofencingTurboModule.java +1025 -0
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/WoosmapGeofencingTurboPackage.java +3 -7
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/WoosmapMessageAndKey.java +2 -3
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/WoosmapTask.java +34 -128
- package/android/src/main/java/com/{reactnativeplugingeofencing → woosmap/reactnativeplugingeofencing}/WoosmapUtil.java +1 -1
- package/ios/WoosmapGeofenceMessage.swift +1 -0
- package/ios/WoosmapGeofencingTurbo.mm +110 -10
- package/ios/WoosmapGeofencingTurbo.swift +873 -11
- package/lib/commonjs/NativeWoosmapGeofencingTurbo.js +6 -3
- package/lib/commonjs/NativeWoosmapGeofencingTurbo.js.map +1 -1
- package/lib/commonjs/index.js +37 -131
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeWoosmapGeofencingTurbo.js +6 -3
- package/lib/module/NativeWoosmapGeofencingTurbo.js.map +1 -1
- package/lib/module/index.js +37 -131
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeWoosmapGeofencingTurbo.d.ts +37 -3
- package/lib/typescript/src/NativeWoosmapGeofencingTurbo.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/NativeWoosmapGeofencingTurbo.ts +109 -0
- package/android/src/main/java/com/reactnativeplugingeofencing/PluginGeofencingModule.java +0 -1204
- package/android/src/main/java/com/reactnativeplugingeofencing/PluginGeofencingPackage.java +0 -28
- package/android/src/main/java/com/reactnativeplugingeofencing/WoosmapGeofencingTurboModule.java +0 -185
- package/ios/PluginGeofencing.mm +0 -123
- package/ios/PluginGeofencing.swift +0 -1243
- package/lib/commonjs/internal/nativeInterface.js +0 -13
- package/lib/commonjs/internal/nativeInterface.js.map +0 -1
- package/lib/module/internal/nativeInterface.js +0 -9
- package/lib/module/internal/nativeInterface.js.map +0 -1
- package/lib/typescript/src/internal/nativeInterface.d.ts +0 -3
- package/lib/typescript/src/internal/nativeInterface.d.ts.map +0 -1
- /package/ios/{PluginGeofencing-Bridging-Header.h → WoosmapGeofencing-Bridging-Header.h} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.reactnativeplugingeofencing;
|
|
1
|
+
package com.woosmap.reactnativeplugingeofencing;
|
|
2
2
|
|
|
3
3
|
import androidx.annotation.Nullable;
|
|
4
4
|
|
|
@@ -12,12 +12,8 @@ import java.util.HashMap;
|
|
|
12
12
|
import java.util.Map;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* TurboReactPackage that registers {@link WoosmapGeofencingTurboModule}
|
|
16
|
-
*
|
|
17
|
-
* <p>Kept separate from {@code PluginGeofencingPackage} so the New-Architecture
|
|
18
|
-
* module and the legacy module load independently. To avoid the startup-race
|
|
19
|
-
* register this package <em>before</em> the legacy one
|
|
20
|
-
* in the host app's {@code MainApplication} package list.
|
|
15
|
+
* TurboReactPackage that registers {@link WoosmapGeofencingTurboModule}, the
|
|
16
|
+
* single native module exposed by the plugin.
|
|
21
17
|
*/
|
|
22
18
|
public class WoosmapGeofencingTurboPackage extends TurboReactPackage {
|
|
23
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.reactnativeplugingeofencing;
|
|
1
|
+
package com.woosmap.reactnativeplugingeofencing;
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
import com.webgeoservices.woosmapgeofencing.WoosmapSettings;
|
|
@@ -41,6 +41,7 @@ public class WoosmapMessageAndKey {
|
|
|
41
41
|
protected static String regionErrorCallbackName="woosmapgeofenceRegionError";
|
|
42
42
|
protected static String regionWatchAlreadyStarted="Region watch already added";
|
|
43
43
|
protected static String regionWatchNotStarted="region watch not started";
|
|
44
|
+
protected static String permissionRequestInProgress="A permission request is already in progress";
|
|
44
45
|
protected static String radiusEmptyMessage="Radius value can not be empty";
|
|
45
46
|
protected static String invalidRadiusMessage="POI Radius should be an integer or a string.";
|
|
46
47
|
protected static String regionInfoEmptyMessage="regionInfo cannot be empty or null.";
|
|
@@ -51,10 +52,8 @@ public class WoosmapMessageAndKey {
|
|
|
51
52
|
protected static String requiredVenueId="Venue id cannot be empty";
|
|
52
53
|
protected static String requiredLocationid="Location id cannot be empty or null";
|
|
53
54
|
protected static String invalidRegionid="Unable to fetch region info";
|
|
54
|
-
protected static String invalidLocationid="Unable to fetch POI info";
|
|
55
55
|
protected static String deleteMessage="Deleted";
|
|
56
56
|
protected static String requiredLocationID = "Location id cannot be empty or null";
|
|
57
|
-
protected static String invalidLocationID = "Unable to fetch location info";
|
|
58
57
|
protected static String invalidProfileSourceType = "Provide valid source type type (local/external)";
|
|
59
58
|
protected static String invalidProfileFile = "Invalid profile file";
|
|
60
59
|
protected static String localMode="local";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.reactnativeplugingeofencing;
|
|
1
|
+
package com.woosmap.reactnativeplugingeofencing;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.os.Build;
|
|
@@ -69,55 +69,6 @@ public class WoosmapTask {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
73
|
-
public void enqueGetRegionsRequest(String regionID,Promise promise) {
|
|
74
|
-
CompletableFuture.supplyAsync(() -> {
|
|
75
|
-
try {
|
|
76
|
-
Region region;
|
|
77
|
-
region = WoosmapDb.getInstance(context).getRegionsDAO().getRegionFromId(regionID);
|
|
78
|
-
if(region!=null){
|
|
79
|
-
return WoosmapUtil.getRegionWritableMap(region);
|
|
80
|
-
}
|
|
81
|
-
} catch (Exception ex) {
|
|
82
|
-
throw new CompletionException(ex);
|
|
83
|
-
}
|
|
84
|
-
return null;
|
|
85
|
-
}).whenComplete((data, throwable) -> {
|
|
86
|
-
if (throwable == null) {
|
|
87
|
-
if(data==null){
|
|
88
|
-
promise.reject(WoosmapMessageAndKey.errorCode,WoosmapMessageAndKey.invalidRegionid);
|
|
89
|
-
}else {
|
|
90
|
-
promise.resolve(data);
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
promise.reject(WoosmapMessageAndKey.errorCode,throwable.getMessage());
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
99
|
-
public void enqueGetRegionsRequest(Promise promise) {
|
|
100
|
-
CompletableFuture.supplyAsync(() -> {
|
|
101
|
-
try {
|
|
102
|
-
Region[] regions;
|
|
103
|
-
WritableArray array= Arguments.createArray();
|
|
104
|
-
regions = WoosmapDb.getInstance(context).getRegionsDAO().getAllRegions();
|
|
105
|
-
for (Region region : regions) {
|
|
106
|
-
array.pushMap(WoosmapUtil.getRegionWritableMap(region));
|
|
107
|
-
}
|
|
108
|
-
return array;
|
|
109
|
-
} catch (Exception ex) {
|
|
110
|
-
throw new CompletionException(ex);
|
|
111
|
-
}
|
|
112
|
-
}).whenComplete((data, throwable) -> {
|
|
113
|
-
if (throwable == null) {
|
|
114
|
-
promise.resolve(data);
|
|
115
|
-
} else {
|
|
116
|
-
promise.reject(WoosmapMessageAndKey.errorCode,throwable.getMessage());
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
72
|
/**
|
|
122
73
|
* Resolves regions as a {@link WritableArray} in all cases. Used by the
|
|
123
74
|
* WoosmapGeofencingTurbo module, whose getRegions spec always returns a
|
|
@@ -203,15 +154,24 @@ public class WoosmapTask {
|
|
|
203
154
|
});
|
|
204
155
|
}
|
|
205
156
|
|
|
157
|
+
/** Returns an array; if locationID is null/empty all locations are returned, otherwise the single match. */
|
|
206
158
|
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
207
|
-
public void
|
|
159
|
+
public void enqueueGetLocationsAsArrayRequest(@androidx.annotation.Nullable String locationID, Promise promise) {
|
|
208
160
|
CompletableFuture.supplyAsync(() -> {
|
|
209
161
|
try {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
162
|
+
WritableArray array = Arguments.createArray();
|
|
163
|
+
MovingPosition[] movingPositions = WoosmapDb.getInstance(context).getMovingPositionsDao().getMovingPositions(-1);
|
|
164
|
+
if (locationID == null || locationID.isEmpty()) {
|
|
165
|
+
for (MovingPosition location : movingPositions) {
|
|
166
|
+
array.pushMap(WoosmapUtil.getMovingPositionObject(location));
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
for (MovingPosition location : movingPositions) {
|
|
170
|
+
if (location.id == Integer.parseInt(locationID)) {
|
|
171
|
+
array.pushMap(WoosmapUtil.getMovingPositionObject(location));
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
215
175
|
}
|
|
216
176
|
return array;
|
|
217
177
|
} catch (Exception ex) {
|
|
@@ -221,85 +181,30 @@ public class WoosmapTask {
|
|
|
221
181
|
if (throwable == null) {
|
|
222
182
|
promise.resolve(data);
|
|
223
183
|
} else {
|
|
224
|
-
promise.reject(WoosmapMessageAndKey.errorCode,throwable.getMessage());
|
|
184
|
+
promise.reject(WoosmapMessageAndKey.errorCode, throwable.getMessage());
|
|
225
185
|
}
|
|
226
186
|
});
|
|
227
187
|
}
|
|
188
|
+
|
|
189
|
+
/** Returns an array; if poiID is null/empty all POIs are returned, otherwise the single match. */
|
|
228
190
|
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
229
|
-
public void
|
|
191
|
+
public void enqueueGetPoisAsArrayRequest(@androidx.annotation.Nullable String poiID, Promise promise) {
|
|
230
192
|
CompletableFuture.supplyAsync(() -> {
|
|
231
193
|
try {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if(WoosmapUtil.onlyContainsNumbers(locationID)){
|
|
238
|
-
poi = WoosmapDb.getInstance(context).getPOIsDAO().getPOIbyLocationID(Integer.parseInt(locationID));
|
|
239
|
-
if(poi!=null){
|
|
240
|
-
return WoosmapUtil.getPOIWritableMap(poi);
|
|
241
|
-
}
|
|
194
|
+
WritableArray array = Arguments.createArray();
|
|
195
|
+
if (poiID == null || poiID.isEmpty()) {
|
|
196
|
+
POI[] pois = WoosmapDb.getInstance(context).getPOIsDAO().getAllPOIs();
|
|
197
|
+
for (POI poi : pois) {
|
|
198
|
+
array.pushMap(WoosmapUtil.getPOIWritableMap(poi));
|
|
242
199
|
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if(data==null){
|
|
251
|
-
promise.reject(WoosmapMessageAndKey.errorCode,WoosmapMessageAndKey.invalidLocationid);
|
|
252
|
-
}else {
|
|
253
|
-
promise.resolve(data);
|
|
254
|
-
}
|
|
255
|
-
} else {
|
|
256
|
-
promise.reject(WoosmapMessageAndKey.errorCode,throwable.getMessage());
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
261
|
-
protected void enqueueGetLocationRequest(String locationID,Promise promise) {
|
|
262
|
-
CompletableFuture.supplyAsync(() -> {
|
|
263
|
-
try {
|
|
264
|
-
MovingPosition requiredLocation=null;
|
|
265
|
-
MovingPosition[]movingPosition;
|
|
266
|
-
movingPosition = WoosmapDb.getInstance(context).getMovingPositionsDao().getMovingPositions(-1);
|
|
267
|
-
for (MovingPosition location : movingPosition) {
|
|
268
|
-
if(location.id==Integer.parseInt(locationID)){
|
|
269
|
-
requiredLocation=location;
|
|
270
|
-
break;
|
|
200
|
+
} else {
|
|
201
|
+
POI poi = WoosmapDb.getInstance(context).getPOIsDAO().getPOIbyStoreId(poiID);
|
|
202
|
+
if (poi == null && WoosmapUtil.onlyContainsNumbers(poiID)) {
|
|
203
|
+
poi = WoosmapDb.getInstance(context).getPOIsDAO().getPOIbyLocationID(Integer.parseInt(poiID));
|
|
204
|
+
}
|
|
205
|
+
if (poi != null) {
|
|
206
|
+
array.pushMap(WoosmapUtil.getPOIWritableMap(poi));
|
|
271
207
|
}
|
|
272
|
-
}
|
|
273
|
-
if(requiredLocation!=null){
|
|
274
|
-
return WoosmapUtil.getMovingPositionObject(requiredLocation);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
} catch (Exception ex) {
|
|
278
|
-
throw new CompletionException(ex);
|
|
279
|
-
}
|
|
280
|
-
return null;
|
|
281
|
-
}).whenComplete((data, throwable) -> {
|
|
282
|
-
if (throwable == null) {
|
|
283
|
-
if(data==null){
|
|
284
|
-
promise.reject(WoosmapMessageAndKey.errorCode,WoosmapMessageAndKey.invalidLocationID);
|
|
285
|
-
}else {
|
|
286
|
-
promise.resolve(data);
|
|
287
|
-
}
|
|
288
|
-
} else {
|
|
289
|
-
promise.reject(WoosmapMessageAndKey.errorCode,throwable.getMessage());
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
295
|
-
protected void enqueueGetLocationRequest(Promise promise) {
|
|
296
|
-
CompletableFuture.supplyAsync(() -> {
|
|
297
|
-
try {
|
|
298
|
-
MovingPosition[]movingPosition;
|
|
299
|
-
WritableArray array= Arguments.createArray();
|
|
300
|
-
movingPosition = WoosmapDb.getInstance(context).getMovingPositionsDao().getMovingPositions(-1);
|
|
301
|
-
for (MovingPosition location : movingPosition) {
|
|
302
|
-
array.pushMap(WoosmapUtil.getMovingPositionObject(location));
|
|
303
208
|
}
|
|
304
209
|
return array;
|
|
305
210
|
} catch (Exception ex) {
|
|
@@ -309,10 +214,11 @@ public class WoosmapTask {
|
|
|
309
214
|
if (throwable == null) {
|
|
310
215
|
promise.resolve(data);
|
|
311
216
|
} else {
|
|
312
|
-
promise.reject(WoosmapMessageAndKey.errorCode,throwable.getMessage());
|
|
217
|
+
promise.reject(WoosmapMessageAndKey.errorCode, throwable.getMessage());
|
|
313
218
|
}
|
|
314
219
|
});
|
|
315
220
|
}
|
|
221
|
+
|
|
316
222
|
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
317
223
|
protected void removeAllLocation(final Promise promise){
|
|
318
224
|
CompletableFuture.supplyAsync((Supplier<Void>) () -> {
|
|
@@ -21,6 +21,7 @@ internal struct WoosmapGeofenceMessage {
|
|
|
21
21
|
static let replacePermission = "You already given location permission to app. Do you want to change it? Please modified it from settings at privacy -> location service -> %@"
|
|
22
22
|
static let deniedPermission = "You are previously denied location permission to app. To change it? Please modified it from settings at privacy -> location service -> %@"
|
|
23
23
|
static let samePermission = "Already allow permission for it"
|
|
24
|
+
static let permissionRequestInProgress = "A permission request is already in progress"
|
|
24
25
|
static let initialize = "OK"
|
|
25
26
|
static let invalidGoogleKey = "Google key Not provided"
|
|
26
27
|
static let invalidWoosmapKey = "Woosmap API key not provided"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTEventEmitter.h>
|
|
2
3
|
|
|
3
4
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
5
|
// Generated by codegen from src/NativeWoosmapGeofencingTurbo.ts via the
|
|
@@ -9,13 +10,21 @@
|
|
|
9
10
|
#endif
|
|
10
11
|
|
|
11
12
|
// Bridges the Swift `WoosmapGeofencingTurbo` implementation to React Native.
|
|
12
|
-
// The
|
|
13
|
-
//
|
|
14
|
-
@
|
|
13
|
+
// The base class is RCTEventEmitter (was NSObject) so the module can both
|
|
14
|
+
// expose native methods and fire JS events via NativeEventEmitter.
|
|
15
|
+
// Selectors must match the @objc(...) annotations in WoosmapGeofencingTurbo.swift.
|
|
16
|
+
@interface RCT_EXTERN_MODULE(WoosmapGeofencingTurbo, RCTEventEmitter)
|
|
15
17
|
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
// ── NativeEventEmitter contract ────────────────────────────────────────────
|
|
19
|
+
RCT_EXTERN_METHOD(addListener:(NSString *)eventName)
|
|
20
|
+
RCT_EXTERN_METHOD(removeListeners:(double)count)
|
|
21
|
+
|
|
22
|
+
// ── Lifecycle / initialization ─────────────────────────────────────────────
|
|
23
|
+
RCT_EXTERN_METHOD(initialize:(NSDictionary *)command
|
|
24
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
25
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
26
|
+
|
|
27
|
+
// ── Region CRUD ──────────────────────────────────────────────
|
|
19
28
|
RCT_EXTERN_METHOD(setWoosmapApiKey:(NSString *)apiKey
|
|
20
29
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
21
30
|
reject:(RCTPromiseRejectBlock)reject)
|
|
@@ -39,6 +48,98 @@ RCT_EXTERN_METHOD(removeRegion:(NSString *)regionId
|
|
|
39
48
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
40
49
|
reject:(RCTPromiseRejectBlock)reject)
|
|
41
50
|
|
|
51
|
+
// ── Tracking ─────────────────────────────────────────────────
|
|
52
|
+
RCT_EXTERN_METHOD(startTracking:(NSString *)profile
|
|
53
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
54
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
55
|
+
|
|
56
|
+
RCT_EXTERN_METHOD(stopTracking:(RCTPromiseResolveBlock)resolve
|
|
57
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
58
|
+
|
|
59
|
+
RCT_EXTERN_METHOD(startCustomTracking:(NSString *)mode
|
|
60
|
+
source:(NSString *)source
|
|
61
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
62
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
63
|
+
|
|
64
|
+
// ── Event watches ────────────────────────────────
|
|
65
|
+
RCT_EXTERN_METHOD(watchLocation:(NSString *)watchID
|
|
66
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
67
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
68
|
+
|
|
69
|
+
RCT_EXTERN_METHOD(clearLocationWatch:(NSString *)watchID
|
|
70
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
71
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
72
|
+
|
|
73
|
+
RCT_EXTERN_METHOD(clearAllLocationWatch:(RCTPromiseResolveBlock)resolve
|
|
74
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
75
|
+
|
|
76
|
+
RCT_EXTERN_METHOD(watchRegions:(NSString *)watchID
|
|
77
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
78
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
79
|
+
|
|
80
|
+
RCT_EXTERN_METHOD(clearRegionsWatch:(NSString *)watchID
|
|
81
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
82
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
83
|
+
|
|
84
|
+
RCT_EXTERN_METHOD(clearAllRegionsWatch:(RCTPromiseResolveBlock)resolve
|
|
85
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
86
|
+
|
|
87
|
+
// ── Permission requests ──────────────────────────
|
|
88
|
+
RCT_EXTERN_METHOD(requestPermissions:(BOOL)background
|
|
89
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
90
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
91
|
+
|
|
92
|
+
RCT_EXTERN_METHOD(requestBLEPermissions:(RCTPromiseResolveBlock)resolve
|
|
93
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
94
|
+
|
|
95
|
+
RCT_EXTERN_METHOD(requestNotificationPermissions:(RCTPromiseResolveBlock)resolve
|
|
96
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
97
|
+
|
|
98
|
+
// ── Permission status ───────────────────────────────────────
|
|
99
|
+
RCT_EXTERN_METHOD(getPermissionsStatus:(RCTPromiseResolveBlock)resolve
|
|
100
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
101
|
+
|
|
102
|
+
RCT_EXTERN_METHOD(getBLEPermissionsStatus:(RCTPromiseResolveBlock)resolve
|
|
103
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
104
|
+
|
|
105
|
+
RCT_EXTERN_METHOD(getNotificationPermissionsStatus:(RCTPromiseResolveBlock)resolve
|
|
106
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
107
|
+
|
|
108
|
+
// ── Configuration ────────────────────────────────────────────
|
|
109
|
+
RCT_EXTERN_METHOD(setSFMCCredentials:(NSDictionary *)credentials
|
|
110
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
111
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
112
|
+
|
|
113
|
+
RCT_EXTERN_METHOD(setProtectedRegionSlot:(NSNumber *)slots
|
|
114
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
115
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
116
|
+
|
|
117
|
+
// ── Data queries ─────────────────────────────────────────────
|
|
118
|
+
RCT_EXTERN_METHOD(getLocations:(NSString *)locationId
|
|
119
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
120
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
121
|
+
|
|
122
|
+
RCT_EXTERN_METHOD(getPois:(NSString *)poiId
|
|
123
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
124
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
125
|
+
|
|
126
|
+
RCT_EXTERN_METHOD(getIndoorBeacons:(NSString *)venueId
|
|
127
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
128
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
129
|
+
|
|
130
|
+
// ── Data removal ─────────────────────────────────────────────
|
|
131
|
+
RCT_EXTERN_METHOD(removeLocations:(RCTPromiseResolveBlock)resolve
|
|
132
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
133
|
+
|
|
134
|
+
RCT_EXTERN_METHOD(removePois:(RCTPromiseResolveBlock)resolve
|
|
135
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
136
|
+
|
|
137
|
+
RCT_EXTERN_METHOD(removeIndoorBeacons:(RCTPromiseResolveBlock)resolve
|
|
138
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
139
|
+
|
|
140
|
+
RCT_EXTERN_METHOD(refreshPois:(RCTPromiseResolveBlock)resolve
|
|
141
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
142
|
+
|
|
42
143
|
+ (BOOL)requiresMainQueueSetup
|
|
43
144
|
{
|
|
44
145
|
return YES;
|
|
@@ -47,10 +148,9 @@ RCT_EXTERN_METHOD(removeRegion:(NSString *)regionId
|
|
|
47
148
|
@end
|
|
48
149
|
|
|
49
150
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
50
|
-
// Vends the JSI TurboModule so
|
|
51
|
-
// codegen path
|
|
52
|
-
//
|
|
53
|
-
// cannot be expressed in Swift.
|
|
151
|
+
// Vends the JSI TurboModule so all methods dispatch through the generated
|
|
152
|
+
// codegen path. Implemented as a category on the Swift class because
|
|
153
|
+
// getTurboModule: returns a C++ type that cannot be expressed in Swift.
|
|
54
154
|
@interface WoosmapGeofencingTurbo (TurboModule) <RCTTurboModule>
|
|
55
155
|
@end
|
|
56
156
|
|