expo-beacon 0.3.0 → 0.3.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.
@@ -513,8 +513,11 @@ public class ExpoBeaconModule: Module {
513
513
 
514
514
  fileprivate func handleDidChangeAuthorization(_ status: CLAuthorizationStatus) {
515
515
  let granted = (status == .authorizedAlways || status == .authorizedWhenInUse)
516
- permissionCompletion?(granted)
516
+ // Nil out BEFORE calling so the closure can set a new permissionCompletion
517
+ // (e.g. the notDetermined → whenInUse → always two-step upgrade flow).
518
+ let completion = permissionCompletion
517
519
  permissionCompletion = nil
520
+ completion?(granted)
518
521
  }
519
522
 
520
523
  fileprivate func handleDidRange(_ beacons: [CLBeacon], satisfying constraint: CLBeaconIdentityConstraint) {
@@ -713,8 +716,8 @@ private class LocationDelegate: NSObject, CLLocationManagerDelegate {
713
716
  self.module = module
714
717
  }
715
718
 
716
- func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
717
- module?.handleDidChangeAuthorization(status)
719
+ func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
720
+ module?.handleDidChangeAuthorization(manager.authorizationStatus)
718
721
  }
719
722
 
720
723
  func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying constraint: CLBeaconIdentityConstraint) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-beacon",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Expo module for scanning, pairing, and monitoring iBeacons on Android and iOS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",