iPhone 升级到iOS 11后发现的定位功能不可用,通过调试发现异常,系统后台打印:
This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys with string values explaining to the user how the app uses this data
在info.plist加入NSLocationAlwaysAndWhenInUseUsageDescription和NSLocationWhenInUseUsageDescription之后问题解决,如图:

官方解释如下:

网友评论