Location Services not working in iOS 8

前端 未结 26 1954
滥情空心
滥情空心 2020-11-21 10:23

My app that worked fine on iOS 7 doesn\'t work with the iOS 8 SDK.

CLLocationManager doesn\'t return a location, and I don\'t see my app under

26条回答
  •  囚心锁ツ
    2020-11-21 10:49

    I add those key in InfoPlist.strings in iOS 8.4, iPad mini 2. It works too. I don't set any key, like NSLocationWhenInUseUsageDescription, in my Info.plist.


    InfoPlist.strings:

    "NSLocationWhenInUseUsageDescription" = "I need GPS information....";
    

    Base on this thread, it said, as in iOS 7, can be localized in the InfoPlist.strings. In my test, those keys can be configured directly in the file InfoPlist.strings.

    So the first thing you need to do is to add one or both of the > following keys to your Info.plist file:

    • NSLocationWhenInUseUsageDescription
    • NSLocationAlwaysUsageDescription

    Both of these keys take a string which is a description of why you need location services. You can enter a string like “Location is required to find out where you are” which, as in iOS 7, can be localized in the InfoPlist.strings file.


    UPDATE:

    I think @IOS's method is better. Add key to Info.plist with empty value and add localized strings to InfoPlist.strings.

提交回复
热议问题