@woosmap/react-native-plugin-geofencing 0.12.0 → 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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.12.2
2
+ - Enhancement: Custom Tracking on iOS (use asynchronous execution)
3
+
4
+ ## 0.12.1
5
+ - Enhancement: Update publishing process workflow
6
+
1
7
  ## 0.12.0
2
8
  - Enhancement:
3
9
  1. Use the SPM repo to fetch the Woosmap geofencing SDK instead of COCOAPODS.
@@ -264,7 +264,7 @@ class PluginGeofencing: RCTEventEmitter {
264
264
  resolve(WoosmapGeofenceMessage.samePermission)
265
265
  } else {
266
266
  resolve(WoosmapGeofenceMessage.showingPermissionBox)
267
- DispatchQueue.main.async {
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
- DispatchQueue.main.async {
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
- DispatchQueue.main.async {
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
- DispatchQueue.main.async {
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
- DispatchQueue.main.sync {
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
- DispatchQueue.main.sync {
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
- DispatchQueue.main.sync {
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
- let (status, _) = self.sdkInstance!.startCustomTracking(url: pURL)
362
- if status {
363
- _isServiceRunning = true
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,51 +818,27 @@ extension CLRegion {
813
818
  }
814
819
 
815
820
  if customProfile != "" {
816
- DispatchQueue.main.async {
817
- let (status, errors) = self.sdkInstance!.startCustomTracking(
818
- url: customProfile
819
- )
820
-
821
- if status == false {
822
- completion(false, WoosGeofenceError(errors[0]))
823
- } else {
824
- completion(true, nil)
825
- self.defaultProfile = "\(mode):\(source)"
826
- let defaults = UserDefaults.standard
827
- defaults.set(
828
- self.defaultProfile,
829
- forKey: "WoosmapGeofenceService.profile"
830
- )
831
- }
832
- }
833
- }
834
-
835
- }
836
-
837
- public func startCustomTracking1(mode: String, source: String) throws {
838
- if mode == "local" {
839
- let bundle = Bundle.main //Bundle(for: Self.self)
840
- if let url = bundle.url(forResource: source, withExtension: nil) {
841
- let (status, errors) = self.sdkInstance!.startCustomTracking(
842
- url: url.absoluteString
843
- )
844
- if status == false {
845
- throw WoosGeofenceError(errors[0])
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
+ }
846
836
  }
847
- } else {
848
- throw WoosGeofenceError(WoosmapGeofenceMessage.invalid_profilefile)
849
- }
850
- } else if mode == "external" {
851
- let (status, errors) = self.sdkInstance!.startCustomTracking(url: source)
852
- if status == false {
853
- throw WoosGeofenceError(errors[0])
854
837
  }
855
- } else {
856
- throw WoosGeofenceError(WoosmapGeofenceMessage.invalid_profilesourcetype)
857
838
  }
858
-
859
839
  }
860
840
 
841
+
861
842
  ///Refresh POI info in storage
862
843
  public func refreshPOI() {
863
844
  self.sdkInstance?.refreshPOIs()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/react-native-plugin-geofencing",
3
- "version": "0.12.0",
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",
@@ -24,14 +24,6 @@
24
24
  "!**/__mocks__",
25
25
  "!**/.*"
26
26
  ],
27
- "scripts": {
28
- "example": "yarn workspace react-native-plugin-geofencing-example",
29
- "test": "jest",
30
- "typecheck": "tsc --noEmit",
31
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
32
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
33
- "prepack": "bob build && node scripts/write-module-package.js"
34
- },
35
27
  "keywords": [
36
28
  "react-native",
37
29
  "ios",
@@ -55,7 +47,6 @@
55
47
  "@evilmartians/lefthook": "^1.5.0",
56
48
  "@react-native-community/cli": "19.0.0",
57
49
  "@react-native/eslint-config": "^0.73.1",
58
- "@release-it/conventional-changelog": "^9.0.2",
59
50
  "@types/jest": "^29.5.5",
60
51
  "@types/react": "^19.1.0",
61
52
  "commitlint": "^17.0.2",
@@ -68,7 +59,6 @@
68
59
  "react": "19.1.0",
69
60
  "react-native": "0.80.1",
70
61
  "react-native-builder-bob": "^0.40.12",
71
- "release-it": "^17.10.0",
72
62
  "turbo": "^1.10.7",
73
63
  "typescript": "^5.2.2"
74
64
  },
@@ -79,10 +69,7 @@
79
69
  "react": "*",
80
70
  "react-native": "*"
81
71
  },
82
- "engines": {
83
- "node": ">= 16.0.0"
84
- },
85
72
  "dependencies": {
86
73
  "react-native-uuid": "^2.0.3"
87
74
  }
88
- }
75
+ }