iOS 8 MKMapView User Location Request Failure

后端 未结 2 1050
长发绾君心
长发绾君心 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:28

    Finally I have succeeded to run my gpx file on the simulator. It seems that after installing Xcode 6 the first time, there might be a bug causing for gpx files to simulate. Here is how I overcame the problem:

    1. I have deleted my app from the simulator
    2. Under App->Capabilities enabled Background Modes->Location updates
    3. Run the app and let it install on simulator
    4. Allow access, and I was able to locate the user with GPX
    5. Afterwards I disabled Location Updates.

    I don't know why, but this did the trick for me.

    0 讨论(0)
  • 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:

    <!-- for requestAlwaysAuthorization -->
    <key>NSLocationAlwaysUsageDescription</key>
    <string>Explain for what are you using the user location</string>
    <!-- for requestWhenInUseAuthorization -->
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Explain for what are you using the user location</string>
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题