expo-beacon 0.5.4 → 0.5.5
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.
|
@@ -309,11 +309,17 @@ public class ExpoBeaconModule: Module {
|
|
|
309
309
|
self.defaults.removeObject(forKey: EXIT_DISTANCE_KEY)
|
|
310
310
|
}
|
|
311
311
|
self.defaults.set(true, forKey: IS_MONITORING_KEY)
|
|
312
|
-
self.requestLocationPermission
|
|
312
|
+
self.requestLocationPermission { granted in
|
|
313
313
|
guard granted else {
|
|
314
|
-
promise.reject("PERMISSION_DENIED", "
|
|
314
|
+
promise.reject("PERMISSION_DENIED", "Location permission required for monitoring")
|
|
315
315
|
return
|
|
316
316
|
}
|
|
317
|
+
// Request Always authorization non-blockingly for background support.
|
|
318
|
+
// On iOS 13+ requestAlwaysAuthorization() from WhenInUse may be a
|
|
319
|
+
// no-op if the user already made their choice — don't block on it.
|
|
320
|
+
if self.locationManager.authorizationStatus != .authorizedAlways {
|
|
321
|
+
self.locationManager.requestAlwaysAuthorization()
|
|
322
|
+
}
|
|
317
323
|
self.requestNotificationPermission()
|
|
318
324
|
self.startRegionMonitoring()
|
|
319
325
|
promise.resolve(nil)
|