【发布时间】:2018-04-19 00:01:40
【问题描述】:
我在 Swift 3 中编写了一个应用程序,在升级到 iOS 11.1 后,它在启动时进入后台,而不是提示允许应用程序访问用户位置。
【问题讨论】:
标签: ios swift swift3 cllocationmanager
我在 Swift 3 中编写了一个应用程序,在升级到 iOS 11.1 后,它在启动时进入后台,而不是提示允许应用程序访问用户位置。
【问题讨论】:
标签: ios swift swift3 cllocationmanager
发现应用会抛出一个断言:
Assertion failure in -[CLLocationManager setAllowsBackgroundLocationUpdates:]
在我的代码中,我发现为了解决问题而删除了这一行:
locationManager.allowsBackgroundLocationUpdates = true
【讨论】: