iPhone 升級(jí)到iOS 11后發(fā)現(xiàn)的定位功能不可用,通過(guò)調(diào)試發(fā)現(xiàn)異常桶略,系統(tǒng)后臺(tái)打印:
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之后問(wèn)題解決诲宇,如圖:
iOS11添加定位參數(shù)后顯示.png
官方解釋如下:
關(guān)于如何定位Apple的官方解釋.png