Change of location service in IOS8 (Cllocationmanager protocol method does not respond, unable to return the GPS method, does not appear to get permission prompt)

Source: Internet
Author: User

Recently, when writing a lbs project, because of the adaptation of IOS8, the project was migrated to the Xcode6.0.1, there was a problem that could not get the location service permissions properly.

Self.manger =//  metersself.manger. delegate == kcllocationaccuracybestfornavigation;[ Self.manger Startupdatinglocation];

The above is iOS8 before the call method, when the user opens the app, will actively ask whether to allow access to the location service permissions, now in IOS8, whether it is the simulator or the real machine, are not prompted, after a review of official documents-- Locationawarenesspgintroduction found that Apple has enhanced the control of privacy access in iOS8 and must call new methods to get the user's permission

  [Self.manager requestwheninuseauthorization];

and add in the Info.plist file

Nslocationwheninuseusagedescription BOOL YES
Nslocationalwaysusagedescription string "Hint description"
Two fields for proper access to service in IOS8

In the use of high-and Baidu map, there has been a compilation error, the approximate reason is because the default in Xcode6 to use 64 compilation caused, if resolved, post-blog will be updated

Change of location service in IOS8 (Cllocationmanager protocol method does not respond, unable to return the GPS method, does not appear to get permission prompt)

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.