iOS 8 MKMapView User Location Request Failure

后端 未结 2 1051
长发绾君心
长发绾君心 2020-12-20 01:54

I have been trying to move my iOS7 app with MKMapview to support iOS8. However I couldn\'t get the new request for users to share their locations to work properly. I create

2条回答
  •  失恋的感觉
    2020-12-20 02:45

    I had the same problem a few days ago. The solution was adding the string keys NSLocationAlwaysUsageDescription (for [CLLocationManager requestAlwaysAuthorization]) or NSLocationWhenInUseUsageDescription (for [CLLocationManager requestWhenInUseAuthorization]) to your Supporting Files/Info.plist

    You can also edit the source code of the Info.Plist with Right click > open as > Source code and add these lines:

    
    NSLocationAlwaysUsageDescription
    Explain for what are you using the user location
    
    NSLocationWhenInUseUsageDescription
    Explain for what are you using the user location
    

    Hope this helps.

提交回复
热议问题