didUpdateHeading标题从未在iOS 11下调用过

使用XCode版本9.0(9A235),但使用Swift 3.x

我的应用程序在iOS 10.x didUpdateHeading调用工作良好调用看起来不错,但在iOS 11.x下相同的应用程序崩溃导致didUpdateHeading永远不会被调用。

我错过了一些权限更改使用指南针或IOS 11.x中的东西

好的,我在WWDC 2017find了答案。

https://developer.apple.com/videos/play/wwdc2017/713/

两件事情。

我要求授权总是我没有被授予在iOS 11.x中,我需要添加所有四个这些键。

<key>NSLocationAlwaysUsageDescription</key> <string>Blah Blah</string> <key>NSLocationUsageDescription</key> <string>Blah Blah</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Blah Blah</string> 

 <key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>This one is new</string> 

现在它的作品!