IOS Get app Current location authorization status

Source: Internet
Author: User

1. Call Cllocationmanager's Authorizationstatus method to get the app's current location authorization status:

Clauthorizationstatus status = [Cllocationmanager authorizationstatus];

2. Authorization Status callback processing:

User Authorization Status:

kclauthorizationstatusnotdetermined User has not made a decision whether to enable location services
kclauthorizationstatusrestricted The user is not authorized to use location services and may not be authorized by the user to disable access
Kclauthorizationstatusdenied The user has explicitly banned the app from using location services or the current system location service is turned off
Kclauthorizationstatusauthorizedalways App authorization can always use location services even if the app is not in use
Kclauthorizationstatusauthorizedwheninuse Allow access to location services during use of this app

if (Status = = kclauthorizationstatusnotdetermined)     {//  Authorization status processing }Else if (Status = = kclauthorizationstatusrestricted)     {//  Authorization status processing }Else  if (status = = Kclauthorizationstatusauthorizedalways | | status = =  Kclauthorizationstatusauthorizedwheninuse) {     //  Authorization status Processing }

IOS Get app Current location authorization status

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.