From 34d20af4b0bfc6d0b7f34ac00ddff944bd7fbb75 Mon Sep 17 00:00:00 2001 From: HarshaR1642 Date: Thu, 17 Oct 2024 13:29:44 +0530 Subject: [PATCH] do not request location if asked previously --- ios/Geofencing.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Geofencing.swift b/ios/Geofencing.swift index f8c2861..35333b4 100644 --- a/ios/Geofencing.swift +++ b/ios/Geofencing.swift @@ -83,6 +83,11 @@ class Geofencing: RCTEventEmitter, CLLocationManagerDelegate { return } + if CLLocationManager.authorizationStatus() != .notDetermined { + successCallback([["success": true, "location": getLocationAuthorizationStatus()]]) + return + } + self.allowWhileUsing = allowWhileUsing self.allowAlways = allowAlways authorizationSuccessCallback = successCallback