The iOS simulator sometimes has issues with location permissions. Testing on a physical device.
If the problem continues, please ensure the alert code is executed on the main thread.