@woosmap/react-native-plugin-geofencing 0.6.0 → 0.7.0-beta.1
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.
|
@@ -116,9 +116,12 @@ extension CLRegion {
|
|
|
116
116
|
|
|
117
117
|
/// This callback received when application become active
|
|
118
118
|
@objc func appDidBecomeActive() {
|
|
119
|
+
let status = CLLocationManager.authorizationStatus()
|
|
120
|
+
if status == .authorizedAlways || status == .authorizedWhenInUse {
|
|
119
121
|
DispatchQueue.main.async {
|
|
120
|
-
|
|
122
|
+
WoosmapGeofenceManager.shared.didBecomeActive()
|
|
121
123
|
}
|
|
124
|
+
}
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
/// This callback recived when application enter in background mode
|
|
@@ -273,6 +276,7 @@ extension CLRegion {
|
|
|
273
276
|
|
|
274
277
|
/// activating WoosmapGeofencing with default parameters
|
|
275
278
|
private func activateGeofenceService() {
|
|
279
|
+
let status = CLLocationManager.authorizationStatus()
|
|
276
280
|
// Set private Woosmap key API
|
|
277
281
|
WoosmapGeofenceManager.shared.setWoosmapAPIKey(key: woosmapKey)
|
|
278
282
|
#if DEBUG
|
|
@@ -299,15 +303,20 @@ extension CLRegion {
|
|
|
299
303
|
WoosmapGeofenceManager.shared.setPoiRadius(radius: formatedRadius(radius: defaultPOIRadius))
|
|
300
304
|
}
|
|
301
305
|
|
|
302
|
-
if
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
if status == .authorizedAlways || status == .authorizedWhenInUse {
|
|
307
|
+
if let savedProfile = ConfigurationProfile(rawValue: defaultProfile) {
|
|
308
|
+
if Thread.isMainThread {
|
|
309
|
+
WoosmapGeofenceManager.shared.startTracking(configurationProfile: savedProfile)
|
|
310
|
+
} else {
|
|
311
|
+
DispatchQueue.main.async {
|
|
312
|
+
WoosmapGeofenceManager.shared.startTracking(configurationProfile: savedProfile)
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// Check if the authorization Status of location Manager
|
|
317
|
+
if CLLocationManager.authorizationStatus() != .notDetermined {
|
|
310
318
|
WoosmapGeofenceManager.shared.startMonitoringInBackground()
|
|
319
|
+
}
|
|
311
320
|
}
|
|
312
321
|
|
|
313
322
|
NotificationCenter.default.addObserver(self,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woosmap/react-native-plugin-geofencing",
|
|
3
|
-
"version":"0.
|
|
3
|
+
"version":"0.7.0-beta.1",
|
|
4
4
|
"description": "This react-native plugin extends the functionality offered by the Woosmap Geofencing Mobile SDKs. Find more about the Woosmap Geofencing SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|