fbsamples / audience-network

Open source projects to demonstrate SDK and sample code usages and integration, and to collaborate and support peers in this community.
https://developers.facebook.com/docs/audience-network
Other
319 stars 370 forks source link

"UI API called from background thread" warning is produced when load facebook native ad first time #102

Closed MayueCastbox closed 3 years ago

MayueCastbox commented 5 years ago

One line summary of the issue here "UI API called from background thread" warning is produced after loading facebook ad very first time in app life cycle.

Device model and OS Version:

iPhone XR iOS 12.2

Xcode Version:

Version 10.2.1 (10E1001)

Observed behavior:

There got the warning in console, and also main thread was blocked for a while, as UI wasn't responsible.

Evidence:

2019-06-11 14:14:30.869504+0800 [MoPub][GoogleAdMobAdapterConfiguration] Google Mobile Ads SDK initialized succesfully. 2019-06-11 14:14:32.175689+0800 [MoPub][MoPub] SDK initialized and ready to display ads. Initialized adapters: FacebookAdapterConfiguration: Adapter version 5.3.2.0, SDK version 5.3.2 GoogleAdMobAdapterConfiguration: Adapter version 7.44.0.0, SDK version 7.44.0

2019-06-11 14:14:56.525316+0800 [MoPub][MPNativeAdRequest][574890e4c790474993693749cfd2b449] Attempting to load ad 2019-06-11 14:14:57.348661+0800 [MoPub][MPNativeAdRequest] Received data from MoPub to construct native ad. 2019-06-11 14:14:57.350067+0800 Castbox[33648:6905860] [MoPub][MPNativeAdRequest] Looking for custom event class named MPGoogleAdMobNativeCustomEvent. 2019-06-11 14:14:57.355336+0800 To get test ads on this device, set: request.testDevices = @[ @"437a4d86ef1833e08306bceafa2411fd" ]; 2019-06-11 14:14:57.356158+0800 [MoPub][MPGoogleAdMobNativeCustomEvent] Google Mobile Ads SDK initialized succesfully. 2019-06-11 14:14:58.462438+0800 [MoPub][MPNativeAdRequest] Received data from MoPub to construct native ad. 2019-06-11 14:14:58.463207+0800 [MoPub][MPNativeAdRequest] Looking for custom event class named FacebookNativeCustomEvent. 2019-06-11 14:14:58.464860+0800 [MoPub][FacebookNativeCustomEvent] Loading Facebook native ad

================================================================= Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] PID: 33648, TID: 6906198, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0 Backtrace: 4 libobjc.A.dylib 0x000000018c9c76f4 + 56 5 CoreMotion 0x0000000193111638 CoreMotion + 292408 6 CoreMotion 0x0000000193111b68 CoreMotion + 293736 7 CoreMotion 0x0000000193111a78 CoreMotion + 293496 8 CoreMotion 0x000000019313f8a8 CoreMotion + 481448 9 CoreMotion 0x000000019313f8ec CoreMotion + 481516 10 CoreFoundation 0x000000018d75378c + 28 11 CoreFoundation 0x000000018d753074 + 276 12 CoreFoundation 0x000000018d74e368 + 2276 13 CoreFoundation 0x000000018d74d764 CFRunLoopRunSpecific + 452 14 CoreFoundation 0x000000018d74e498 CFRunLoopRun + 84 15 CoreMotion 0x000000019313f280 CoreMotion + 479872 16 libsystem_pthread.dylib 0x000000018d3cd920 + 132 17 libsystem_pthread.dylib 0x000000018d3cd87c _pthread_start + 48 18 libsystem_pthread.dylib 0x000000018d3d5dcc thread_start + 4 2019-06-11 14:14:58.478666+0800 Castbox[33648:6906198] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] PID: 33648, TID: 6906198, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0 Backtrace: 4 libobjc.A.dylib 0x000000018c9c76f4 + 56 5 CoreMotion 0x0000000193111638 CoreMotion + 292408 6 CoreMotion 0x0000000193111b68 CoreMotion + 293736 7 CoreMotion 0x0000000193111a78 CoreMotion + 293496 8 CoreMotion 0x000000019313f8a8 CoreMotion + 481448 9 CoreMotion 0x000000019313f8ec CoreMotion + 481516 10 CoreFoundation 0x000000018d75378c + 28 11 CoreFoundation 0x000000018d753074 + 276 12 CoreFoundation 0x000000018d74e368 + 2276 13 CoreFoundation 0x000000018d74d764 CFRunLoopRunSpecific + 452 14 CoreFoundation 0x000000018d74e498 CFRunLoopRun + 84 15 CoreMotion 0x000000019313f280 CoreMotion + 479872 16 libsystem_pthread.dylib 0x000000018d3cd920 + 132 17 libsystem_pthread.dylib 0x000000018d3cd87c _pthread_start + 48 18 libsystem_pthread.dylib 0x000000018d3d5dcc thread_start + 4

sharoni commented 3 years ago

This issue had been addressed.