問題:一覺醒來,很多客戶反映app不能定位了。查詢相關(guān)資料后發(fā)現(xiàn)是定位權(quán)限API有更新。
解決方法:info.plist中同時添加NSLocationAlwaysAndWhenInUseUsageDeion和NSLocationWhenInUseUsageDeion。
原因:
/*
* Either the NSLocationAlwaysAndWhenInUseUsageDeion key or both the
* NSLocationAlwaysUsageDeion and NSLocationWhenInUseUsageDeion
* keys must be specified in your Info.plist; otherwise, this method will do
* nothing, as your app will be assumed not to support Always authorization.
*/
蘋果現(xiàn)在增加了一項新的隱私保護功能 NSLocationAlwaysAndWhenInUseUsageDeion,并且原有的 NSLocationAlwaysUsageDeion 被降級為 NSLocationWhenInUseUsageDeion。