@woosmap/react-native-plugin-geofencing 0.6.0-beta.3 → 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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.6.0
2
+ - Upgrade Gradle plugin to 8.9 and upgrade plugin and example app dependencies
3
+
4
+
1
5
  ## 0.5.1
2
6
  - Fixes: Internal bug fixed regarding WoosmapGeofencing (4.3.6)
3
7
 
@@ -88,7 +88,7 @@ dependencies {
88
88
  implementation 'com.google.android.gms:play-services-location:21.3.0'
89
89
  implementation 'com.google.code.gson:gson:2.10.1'
90
90
  implementation "com.github.Woosmap:geofencing-core-android-sdk:core_geofence_2.+"
91
- implementation "com.webgeoservices.woosmapgeofencing:woosmap-mobile-sdk:06122024-Beta-1"
91
+ implementation "com.webgeoservices.woosmapgeofencing:woosmap-mobile-sdk:4.+"
92
92
  implementation 'com.google.android.gms:play-services-maps:19.0.0'
93
93
  implementation 'androidx.room:room-runtime:2.6.1'
94
94
  annotationProcessor 'androidx.room:room-compiler:2.6.1'
@@ -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
- WoosmapGeofenceManager.shared.didBecomeActive()
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 let savedProfile = ConfigurationProfile(rawValue: defaultProfile) {
303
- WoosmapGeofenceManager.shared.startTracking(configurationProfile: savedProfile)
304
- }
305
- // else{ //Default tracking
306
- // WoosmapGeofenceManager.shared.startTracking(configurationProfile: ConfigurationProfile.passiveTracking)
307
- // }
308
- // Check if the authorization Status of location Manager
309
- if CLLocationManager.authorizationStatus() != .notDetermined {
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.6.0-beta.3",
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",