I am trying to get device current location using CLLocationManage
. I set my method to get location on button click. I can get location successfully but when I get alertview with message "APPNAME would like to use your current location?" with two buttons, "Dont Allow" and "Ok". and I click on "Dont Allow". Then whenever I click on button and I cant get that alertview again to get current location, so I am not able to get the location. So is it possible to get alertview everytime when I click on my button to get location?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
When you click on "don't allow" button on alert, Location permission for your application is restricted.
You can navigate to settings in your phone > privacy >location services, over there you can see services are off for you application. You can turn it on to give permissions
The selected answer is correct, for the user.
However, if you're a programmer and you want user to be notified with the alert, you should call
This will automatically pops the alert when location services are disabled every time I think as you wish.
A common mistake is to check whether location update is enabled and don't bother calling startUpdatingLocation when it's not.
If that's the case, then the alert will not shows up.
Adding this answer so you can more efficiently handle that scenario.
There is no way to force current location permission dialog again, but what you can do is trap its status that user has denied use of location in your app using
CLLocationManagerDelegate
,