我们在iOS 13上遇到了很多以下崩溃:
Crashed: com.twitter.crashlytics.ios.exception
0 MyApp 0x1029626ac CLSProcessRecordAllThreads + 376 (CLSProcess.c:376)
1 MyApp 0x102962a94 CLSProcessRecordAllThreads + 407 (CLSProcess.c:407)
2 MyApp 0x102952798 CLSHandler + 26 (CLSHandler.m:26)
3 MyApp 0x102960cc0 __CLSExceptionRecord_block_invoke + 199 (CLSException.mm:199)
4 libdispatch.dylib 0x1994911cc _dispatch_client_callout + 16
5 libdispatch.dylib 0x199443d04 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 MyApp 0x102960768 CLSExceptionRecord + 206 (CLSException.mm:206)
7 MyApp 0x10296059c CLSExceptionRecordNSException + 102 (CLSException.mm:102)
8 MyApp 0x1029601c0 CLSTerminateHandler() + 259 (CLSException.mm:259)
9 libc++abi.dylib 0x199591304 std::__terminate(void (*)()) + 16
10 libc++abi.dylib 0x19959129c std::terminate() + 44
11 libobjc.A.dylib 0x1994ec2dc _objc_terminate() + 10
12 libdispatch.dylib 0x1994911e0 _dispatch_client_callout + 36
13 libdispatch.dylib 0x199443d04 _dispatch_lane_barrier_sync_invoke_and_complete + 56
14 BaseBoard 0x19c307ccc -[BSAction sendResponse:withCompletion:] + 116
15 UIKitCore 0x19d341558 -[UIHandleRemoteNotificationAction sendResponse:] + 128
16 UIKitCore 0x19d7bb250 __91-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:]_block_invoke_3.2661 + 72
17 UIKitCore 0x19d7af014 _runAfterCACommitDeferredBlocks + 316
18 UIKitCore 0x19d79f064 _cleanUpAfterCAFlushAndRunDeferredBlocks + 232
19 UIKitCore 0x19d7ce80c _afterCACommitHandler + 76
20 CoreFoundation 0x1997404f8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
21 CoreFoundation 0x19973b3e4 __CFRunLoopDoObservers + 416
22 CoreFoundation 0x19973b9b0 __CFRunLoopRun + 1308
23 CoreFoundation 0x19973b16c CFRunLoopRunSpecific + 464
24 GraphicsServices 0x1a3573328 GSEventRunModal + 104
25 UIKitCore 0x19d7a5d0c UIApplicationMain + 1936
26 MyApp 0x1021fa41c main + 22 (main.m:22)
27 libdyld.dylib 0x1995c6424 start + 4
带有以下消息:
Fatal Exception: NSInternalInconsistencyException
this request has been neutered - you can't call -sendResponse: twice nor after encoding it
+[_CFXNotificationTokenRegistration keyCallbacks]
有谁知道是什么导致了这次崩溃?以下行15 UIKitCore 0x19d341558 -[UIHandleRemoteNotificationAction sendResponse:] + 128
表示在收到远程通知时发生这种情况,我猜,但不确定。这是否与接收远程通知时未正确调用fetchCompletionHandler
回调有关?感谢您的任何建议,谢谢:)
我认为即使它是一个可选方法,你也应该实现fetchCompletionHandler
。 正如苹果在文档中提到的:
如果未及时调用完成处理程序,则应用将终止
快速修复:正确实现此委托...iOS 13应该让你走。
旁注:iOS 13 对所有历史背景的东西都非常挑剔,苹果添加了这种看门狗,如果你看起来没有在学术上使用背景功能,就会杀死你......对于许多带有VoIP推送的应用程序来说,同样悲伤的故事;-(
虽然我不知道 Crashlytics 的实现细节,但以前众所周知的使用Data
对象注册远程通知的模式在 iOS 13 上不再受支持,并且可能会导致您的崩溃。
这个答案解释了差异:
iOS 13 是否有获取设备通知令牌的新方法?