Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行 mpush_swift_ios_demo ,然后按Home键将应用进入后台运行 报UI API called on a background thread: 错误 #244

Open
DeqiuTseng opened this issue Sep 27, 2018 · 6 comments

Comments

@DeqiuTseng
Copy link

运行 mpush_swift_ios_demo ,然后按Home键将应用进入后台运行 报UI API called on a background thread: 错误!!!!

以下是运行日志
User authored notification.
2018-09-27 16:59:08.234031+0800 mpush_ios_swift_demo[2094:1240257] [CloudPush Debug]: Network status changed.
2018-09-27 16:59:08.234058+0800 mpush_ios_swift_demo[2094:1240257] [CloudPush Debug]: Connect to network, status: 1
2018-09-27 16:59:08.236468+0800 mpush_ios_swift_demo[2094:1240256] [CloudPush Debug]: Load session config from local cache success.
2018-09-27 16:59:08.237453+0800 mpush_ios_swift_demo[2094:1240256] [CloudPush Debug]: Session init success.
2018-09-27 16:59:08.237930+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: Connect to AS, IP: 140.205.252.12, Port: 443
2018-09-27 16:59:08.239774+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: CCP socket start monitor reading and writing.
2018-09-27 16:59:08.282983+0800 mpush_ios_swift_demo[2094:1240189] [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-09-27 16:59:08.283420+0800 mpush_ios_swift_demo[2094:1240189] [MC] Loaded MobileCoreServices.framework
Get deviceToken from APNs success.
2018-09-27 16:59:08.308611+0800 mpush_ios_swift_demo[2094:1240270] [CloudPush Debug]: Request url is: https://mpush-api.aliyun.com/apns-token
2018-09-27 16:59:08.326140+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: Start CCP protocol shake hands.
2018-09-27 16:59:08.328423+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: CCP protocol shake hands, send auth info, waiting for ack.
2018-09-27 16:59:08.328453+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: MPChannelStatusConnecting
2018-09-27 16:59:08.453651+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: CCP connect ack statusCode is 0
Push SDK init success, deviceId: b3634765884247fc95b204ab735b11c5
2018-09-27 16:59:08.454271+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: CCP channel connected success time: Jan 2 2018 18:06:39
2018-09-27 16:59:08.454697+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: CCP channel connected, cancel timeout timer.
2018-09-27 16:59:08.454757+0800 mpush_ios_swift_demo[2094:1240265] [CloudPush Debug]: AS connect ack, seq: 1, statusCode: 0
Push SDK channel opened.
2018-09-27 16:59:08.594186+0800 mpush_ios_swift_demo[2094:1240270] [CloudPush Debug]: Register deviceToken success.
Upload deviceToken to Push Server, deviceToken: 594ccb395f17cd280ddf0574ae76fed2f2b49782d09583a1730b7baf2b0d8f4c

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 2094, TID: 1240257, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4 mpush_ios_swift_demo 0x0000000100f1c4f0 -[UTSelfStaticsManager getAppState] + 60
5 mpush_ios_swift_demo 0x0000000100f1c3ec -[UTSelfStaticsManager onEventForCrash] + 256
6 mpush_ios_swift_demo 0x0000000100efa930 __40-[UTMCSystemHook appDIdEnterBackground:]_block_invoke.51 + 196
7 libdispatch.dylib 0x0000000101d9d2cc _dispatch_call_block_and_release + 24
8 libdispatch.dylib 0x0000000101d9d28c _dispatch_client_callout + 16
9 libdispatch.dylib 0x0000000101da93dc _dispatch_queue_override_invoke + 984
10 libdispatch.dylib 0x0000000101dae9d0 _dispatch_root_queue_drain + 624
11 libdispatch.dylib 0x0000000101dae6f4 _dispatch_worker_thread3 + 136
12 libsystem_pthread.dylib 0x0000000184d6306c _pthread_wqthread + 1268
13 libsystem_pthread.dylib 0x0000000184d62b6c start_wqthread + 4
2018-09-27 16:59:10.756739+0800 mpush_ios_swift_demo[2094:1240257] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 2094, TID: 1240257, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4 mpush_ios_swift_demo 0x0000000100f1c4f0 -[UTSelfStaticsManager getAppState] + 60
5 mpush_ios_swift_demo 0x0000000100f1c3ec -[UTSelfStaticsManager onEventForCrash] + 256
6 mpush_ios_swift_demo 0x0000000100efa930 __40-[UTMCSystemHook appDIdEnterBackground:]_block_invoke.51 + 196
7 libdispatch.dylib 0x0000000101d9d2cc _dispatch_call_block_and_release + 24
8 libdispatch.dylib 0x0000000101d9d28c _dispatch_client_callout + 16
9 libdispatch.dylib 0x0000000101da93dc _dispatch_queue_override_invoke + 984
10 libdispatch.dylib 0x0000000101dae9d0 _dispatch_root_queue_drain + 624
11 libdispatch.dylib 0x0000000101dae6f4 _dispatch_worker_thread3 + 136
12 libsystem_pthread.dylib 0x0000000184d6306c _pthread_wqthread + 1268
13 libsystem_pthread.dylib 0x0000000184d62b6c start_wqthread + 4
2018-09-27 16:59:11.273304+0800 mpush_ios_swift_demo[2094:1240189] [CloudPush Debug]: Support multi task, set background task handler.
2018-09-27 16:59:11.274137+0800 mpush_ios_swift_demo[2094:1240258] [CloudPush Debug]: CCP channel connected, disconnect it.
2018-09-27 16:59:11.274193+0800 mpush_ios_swift_demo[2094:1240258] [CloudPush Debug]: Close CCP channel without retry.
2018-09-27 16:59:11.274765+0800 mpush_ios_swift_demo[2094:1240258] [CloudPush Debug]: End background task handler
2018-09-27 16:59:11.274963+0800 mpush_ios_swift_demo[2094:1240256] [CloudPush Debug]: Task isNeedRetry is NO.

@evan-cai
Copy link

我也遇到了

@DeqiuTseng
Copy link
Author

我也遇到了

之前我还以为是自己的问题,结果运行官方demo一样的,用主线程包裹也没用

@tuxi
Copy link

tuxi commented Sep 11, 2019

我也占个坑, 待解决!

@BakerInGit
Copy link

我也占个坑, 待解决! 气死~

@skyinemas
Copy link
Contributor

skyinemas commented Oct 11, 2019

此问题已在AlicloudUT 5.2.0.8版本中修复,有2个升级方法:
1、请执行pod update并在Podfile.lock查看AlicloudUT版本是否为5.2.0.8
2、下载压缩包,解压得到UTMini.framework,替换同名库

@DeqiuTseng
Copy link
Author

更新到最新是可以的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants