On macOS, is there a way to reset the authorizationStatus of the CLLocationManager back to kCLAuthorizationStatusNotDetermined (or .notDetermined in Swift)? Disabling the location permission for the app in System Settings only sets it to kCLAuthorizationStatusDenied (.denied) which is not the same thing. Only when not determined, calling requestAlwaysAuthorization has an effect, in all other cases this method has no effect on macOS (that's also how it is documented). But currently I can do that once on a development system and then never again. Even if I clear the Xcode build directory, the app will vanish from System Settings but the moment I re-build it, it's there before even starting it with the last status set, so I cannot re-test prompting the user for access.
Is it possible to reset authorizationStatus of CLLocationManager in macOS?
26 Views Asked by Mecki At
1
There are 1 best solutions below
Related Questions in MACOS
- Error installing Nativescript on Mac M2 Sonoma 14.4.1
- macOS - Most secure way of a GUI SUDO_ASKPASS
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- ZSH function parameters conundrum
- how to make read only file/directory in Mac writable
- macOS BigSur - Unable to run bundled php version or brew php 8
- 9 Digit Addresses in Hexadecimal System in MacOS
- MacOS Bash-Script: while read p and echo
- How to make a range for tail rows on a categorized table in Numbers with JXA scripts?
- Cannot build a basic project with curl on Mac (M2) for Raspberry Pi Pico
- How to recover deleted files from create vite react project
- Can't run built SFML project from Xcode template
- React Native - RealmJS - Linker command failed with exit code 1
- How can I manually add a keyboard shortcut to a Shortcut Action Service directly via the system files, without going through the System Prefs GUI?
Related Questions in TESTING
- Using ES Modules with TS, and Jest testing(cannot use import statement outside module)
- Mocking AmazonS3 listObjects function in scala
- How to refer to the filepath of test data in test sourcecode?
- No tests found for given includes: [com.bright.TwitterAnalog.AuthenticationControllerSpec.Register user with valid request](--tests filter)
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- How to use Mockito for WebClient get call?
- Jest + JavaScript ES Modules
- How to configure api http request with load testing
- How can I make asserts on outbound HTTP requests?
- higher coefficient of determination values in the testing phase compared to the training phase
- Writing test methods with shared expensive set-up
- Slow performance when testing non-local IP services with Playwright
- uiState not updating in Tests
- Incorrect implementation of calloc() introduces division by zero and how to detect it via testing?
- How to test Creating and Cancelling Subscription in ThriveCart in Test Mode
Related Questions in CORE-LOCATION
- UIKit CLLocationButton crash when I tap on a text field in the simulator
- Unable to show user current location in uikit
- Is it possible to reset authorizationStatus of CLLocationManager in macOS?
- iOS app with location only works on iPhone and not on iPad, why?
- allowDeferredLocationUpdates(untilTraveled:timeout:) deprecated
- Why my widget is not refreshing properly?
- Handling async functions in Swift
- Can geocodeAddressString function be made more accurate for landmarks and points of interest
- LocationManager triggering didUpdateLocations twice instead of once for each location change
- How can I retrieve the last created Core Data parent entity along with its 1 to Many related entities in a @FetchRequest?
- How to make MapKit map center user location smoothly? (similar to Apple Maps)
- Is there a way to display a users current address in the textfield on appear of the page?
- Testing ARKit + CoreLocation Integration Outside Supported Regions: Simulators or Alternatives?
- Understanding Different Location Icons in iOS App Background Usage
- Region monitoring not working after 1 hour the app is killed
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The comment from TheNextman pointed me into the right direction. Location permissions are indeed stored in
/var/db/locationd/clients.plist. To edit this file, you must be root; actually you already must be root to view the file or enter its directory. But you also must killlocationdotherwise your edit has no effect. Here is a step by step guide:sudo su -cd /var/db/locationdplutil -p cilents.plist. The identfier will be something likeA436F23B-8069-4F67-B935-1DF9FE5F5903:icom.apple.iCal:defaultswill only work here with absolute path, hence the`pwd`/)locationdto restart:killall locationdAfter those steps the status is back to
kCLAuthorizationStatusNotDetermined(.notDetermined).