我正在开发一个应用程序,该应用程序必须检测用户位于建筑物中的哪一层。
我尝试过使用CLLocation ( location.floor?.level),但该值始终返回 nil。
请建议我是否有其他方法来获得楼层水平。
应用程序崩溃在iOS 12.0之前的iOS 12.0它运行正常,我用谷歌搜索它但没有得到任何解决方案下面的崩溃日志.
由于未捕获的异常'NSUnknownKeyException'而终止应用程序,原因:'[setValue:forUndefinedKey:]:此类不是密钥值编码兼容的密钥shouldAlwaysAlertWhileAppIsForeground.
let content = UNMutableNotificationContent()
//App crash on below line
content.setValue(true, forKeyPath: "shouldAlwaysAlertWhileAppIsForeground")
Run Code Online (Sandbox Code Playgroud)
有人解决过这样的问题吗?