gpt4 book ai didi

收到推送通知时 iOS 13 崩溃?

转载 作者:行者123 更新时间:2023-12-01 15:33:37 25 4
gpt4 key购买 nike

我们在 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即使它是可选方法。
正如苹果提到的 in the documentation :

If you do not call the completion handler in time, your app is terminated



快速修复:正确实现此委托(delegate)...... iOS 13 应该让你离开。

旁注:iOS 13 对所有历史背景的东西都非常挑剔,如果看起来你在学术上不使用背景功能,Apple 添加了那种看门狗来杀死你……对于许多使用 VoIP 推送的应用程序来说,同样的悲惨故事;- )

关于收到推送通知时 iOS 13 崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58059127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com