@woosmap/react-native-plugin-geofencing 0.12.1 → 0.12.2
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 +3 -0
- package/ios/PluginGeofencing.swift +2 -2
- package/ios/WoosmapGeofenceService.swift +29 -24
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -264,7 +264,7 @@ class PluginGeofencing: RCTEventEmitter {
|
|
|
264
264
|
resolve(WoosmapGeofenceMessage.samePermission)
|
|
265
265
|
} else {
|
|
266
266
|
resolve(WoosmapGeofenceMessage.showingPermissionBox)
|
|
267
|
-
|
|
267
|
+
Task { @MainActor in
|
|
268
268
|
let appname: String = Bundle.main.infoDictionary?[kCFBundleNameKey as String] as? String ?? ""
|
|
269
269
|
var alertInfo: String = ""
|
|
270
270
|
if status == .denied {
|
|
@@ -296,7 +296,7 @@ class PluginGeofencing: RCTEventEmitter {
|
|
|
296
296
|
resolve(WoosmapGeofenceMessage.samePermission)
|
|
297
297
|
} else {
|
|
298
298
|
resolve(WoosmapGeofenceMessage.showingPermissionBox)
|
|
299
|
-
|
|
299
|
+
Task { @MainActor in
|
|
300
300
|
let appname: String = Bundle.main.infoDictionary?[kCFBundleNameKey as String] as? String ?? ""
|
|
301
301
|
var alertInfo: String = ""
|
|
302
302
|
if status == .denied {
|
|
@@ -132,7 +132,7 @@ extension CLRegion {
|
|
|
132
132
|
@objc func appDidBecomeActive() {
|
|
133
133
|
let status = CLLocationManager().authorizationStatus
|
|
134
134
|
if status == .authorizedAlways || status == .authorizedWhenInUse {
|
|
135
|
-
|
|
135
|
+
Task{ @MainActor in
|
|
136
136
|
self.sdkInstance?.didBecomeActive()
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -141,7 +141,7 @@ extension CLRegion {
|
|
|
141
141
|
/// This callback recived when application enter in background mode
|
|
142
142
|
@objc func appDidEnterBackground() {
|
|
143
143
|
if CLLocationManager().authorizationStatus != .notDetermined {
|
|
144
|
-
|
|
144
|
+
Task { @MainActor in
|
|
145
145
|
self.sdkInstance?.startMonitoringInBackground()
|
|
146
146
|
self.sdkInstance?.getLocationService().stopUpdatingLocation()
|
|
147
147
|
}
|
|
@@ -247,7 +247,8 @@ extension CLRegion {
|
|
|
247
247
|
airshipTrackingEnable: Bool = false,
|
|
248
248
|
protectedRegionSlot: Int = -1
|
|
249
249
|
) {
|
|
250
|
-
|
|
250
|
+
//TODO: Check This
|
|
251
|
+
Task { @MainActor in
|
|
251
252
|
_shared = WoosmapGeofenceService.init(
|
|
252
253
|
woosmapKey,
|
|
253
254
|
configurationProfile,
|
|
@@ -259,7 +260,8 @@ extension CLRegion {
|
|
|
259
260
|
|
|
260
261
|
/// Creating instance for woosGeofencing service
|
|
261
262
|
@objc public static func setup() {
|
|
262
|
-
|
|
263
|
+
//TODO: Check This
|
|
264
|
+
Task { @MainActor in
|
|
263
265
|
_shared = WoosmapGeofenceService.init("", "")
|
|
264
266
|
}
|
|
265
267
|
}
|
|
@@ -284,7 +286,7 @@ extension CLRegion {
|
|
|
284
286
|
/// - Throws: in case of wrong profile provided it return error invalidProfile
|
|
285
287
|
public func startTracking(profile: String) throws {
|
|
286
288
|
if let savedProfile = ConfigurationProfile(rawValue: profile) {
|
|
287
|
-
|
|
289
|
+
Task { @MainActor in
|
|
288
290
|
self.sdkInstance?.startTracking(configurationProfile: savedProfile)
|
|
289
291
|
}
|
|
290
292
|
self.defaultProfile = profile
|
|
@@ -358,10 +360,13 @@ extension CLRegion {
|
|
|
358
360
|
source: String(profilelocation[1])
|
|
359
361
|
)
|
|
360
362
|
if pURL != "" {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
Task{
|
|
364
|
+
let (status, _) = await self.sdkInstance!.startCustomTracking(url: pURL)
|
|
365
|
+
if status {
|
|
366
|
+
_isServiceRunning = true
|
|
367
|
+
}
|
|
364
368
|
}
|
|
369
|
+
|
|
365
370
|
}
|
|
366
371
|
}
|
|
367
372
|
}
|
|
@@ -813,23 +818,23 @@ extension CLRegion {
|
|
|
813
818
|
}
|
|
814
819
|
|
|
815
820
|
if customProfile != "" {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
url: customProfile
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
821
|
+
if let sdk = self.sdkInstance{
|
|
822
|
+
Task {
|
|
823
|
+
let (status, errors) = await sdk.startCustomTracking(url: customProfile)
|
|
824
|
+
|
|
825
|
+
if status == false {
|
|
826
|
+
completion(false, WoosGeofenceError(errors[0]))
|
|
827
|
+
} else {
|
|
828
|
+
completion(true, nil)
|
|
829
|
+
self.defaultProfile = "\(mode):\(source)"
|
|
830
|
+
let defaults = UserDefaults.standard
|
|
831
|
+
defaults.set(
|
|
832
|
+
self.defaultProfile,
|
|
833
|
+
forKey: "WoosmapGeofenceService.profile"
|
|
834
|
+
)
|
|
835
|
+
}
|
|
831
836
|
}
|
|
832
|
-
|
|
837
|
+
}
|
|
833
838
|
}
|
|
834
839
|
}
|
|
835
840
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woosmap/react-native-plugin-geofencing",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
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",
|