diff --git a/example/ios/ReactNativeGeofencingExample.xcodeproj/project.pbxproj b/example/ios/ReactNativeGeofencingExample.xcodeproj/project.pbxproj index 8079093..b2b8e7e 100644 --- a/example/ios/ReactNativeGeofencingExample.xcodeproj/project.pbxproj +++ b/example/ios/ReactNativeGeofencingExample.xcodeproj/project.pbxproj @@ -598,11 +598,7 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -675,11 +671,7 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/ios/Geofencing.swift b/ios/Geofencing.swift index 35333b4..c9ae742 100644 --- a/ios/Geofencing.swift +++ b/ios/Geofencing.swift @@ -83,11 +83,6 @@ class Geofencing: RCTEventEmitter, CLLocationManagerDelegate { return } - if CLLocationManager.authorizationStatus() != .notDetermined { - successCallback([["success": true, "location": getLocationAuthorizationStatus()]]) - return - } - self.allowWhileUsing = allowWhileUsing self.allowAlways = allowAlways authorizationSuccessCallback = successCallback @@ -206,17 +201,19 @@ class Geofencing: RCTEventEmitter, CLLocationManagerDelegate { if status == .authorizedAlways { locationManager.allowsBackgroundLocationUpdates = true authorizationSuccessCallback?([["success": true, "location": getLocationAuthorizationStatus()]]) + authorizationSuccessCallback = nil } else if status == .authorizedWhenInUse { if self.allowAlways { requestAlwaysAuthorization() } else { authorizationSuccessCallback?([["success": true, "location": getLocationAuthorizationStatus()]]) + authorizationSuccessCallback = nil } } else { authorizationSuccessCallback?([["success": false, "location": getLocationAuthorizationStatus()]]) + authorizationSuccessCallback = nil } - authorizationSuccessCallback = nil } private func isLocationAuthorized() -> Bool { diff --git a/package.json b/package.json index d92a847..1a01493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rn-bridge/react-native-geofencing", - "version": "1.0.0", + "version": "1.0.1", "description": "Native modules to determine if a location is within defined geographical boundaries", "source": "./src/index.tsx", "main": "./lib/commonjs/index.js",