In the iOS8 environment, when you disable the positioning service General switch, you cannot add the APP positioning sub-options to the positioning permission list. ios8app

Source: Internet
Author: User

In the iOS8 environment, when you disable the positioning service General switch, you cannot add the APP positioning sub-options to the positioning permission list. ios8app
Key points:-(void) locationManager :( CLLocationManager *) manager didChangeAuthorizationStatus :( clthorizationstatus) when the APP calls the startUpdatingLocation method for the first time in iOS7, the system will automatically add the positioning sub-options of the APP to the positioning permission list in the settings, and prompt the user whether to authorize the APP positioning service. However, in the iOS8 environment, the method of using the location service has changed compared with the previous version. before calling the startUpdatingLocation method, you need to call the requestWhenInUseAuthorization method to request the location permission. However, when you disable the location service overview switch, using this method alone, you cannot add the sub-options for APP positioning to the positioning permission list. After you enable the positioning General switch, you cannot find the sub-options for the APP, the permission list can be added normally only when the locating Service general switch is enabled. The solution is to place the startUpdatingLocation method enabled and located in the didChangeAuthorizationStatus: proxy method call: 1) first, call the requestWhenInUseAuthorization method to request the positioning permission (iOS7 and previously do not need to call this method); 2) then call the startUpdatingLocation method in didChangeAuthorizationStatus: proxy method to request This solution adds the positioning sub-options of the APP to the positioning permission list regardless of whether the general switch of the positioning service is enabled.

Related Article

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.