TeadsSDK-iOS
TeadsSDK-iOS copied to clipboard
Main thread checker issue on ad click
Hi @github-lucas-bon,
Is it expected to call "willPresentModalView" on a background thread? Normally, at this point, the application or the SDK tries to determine which is the current top most UIViewController. In the example below I will return nil on the "willPresentModalView" callback and the Main Thread Checker is triggered. It's reproducible on the latest Teads SDK v5.1.3 after tapping on a video ad.
Could you please look into this and try to resolve the main thread warning?
public func willPresentModalView(ad: TeadsAd) -> UIViewController? {
return nil
}
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView nextResponder]
PID: 38013, TID: 1546556, Thread name: (none), Queue name: com.teads.adcore.jsengine, QoS: 0
Backtrace:
4 TeadsSDK 0x0000000107614c78 block_destroy_helper.21 + 3488
5 TeadsSDK 0x00000001076013d0 block_destroy_helper.21 + 760
6 TeadsSDK 0x00000001076016f4 block_destroy_helper.21 + 1564
7 TeadsSDK 0x000000010764703c block_destroy_helper + 9436
8 TeadsSDK 0x0000000107644f14 block_destroy_helper + 948
9 CoreFoundation 0x00000001a2c59b24 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 138020
10 CoreFoundation 0x00000001a2c77610 6B22DD81-3585-3BE6-BC77-BA19810EC0F2 + 259600
11 JavaScriptCore 0x00000001ae30ee34 E76B377F-C862-395A-9439-D12B09A59E07 + 4668980
12 JavaScriptCore 0x00000001ae30e830 E76B377F-C862-395A-9439-D12B09A59E07 + 4667440
13 JavaScriptCore 0x00000001ae30c9b8 E76B377F-C862-395A-9439-D12B09A59E07 + 4659640
14 JavaScriptCore 0x00000001ae2a2fa8 E76B377F-C862-395A-9439-D12B09A59E07 + 415226984
15 JavaScriptCore 0x00000001ae29f848 E76B377F-C862-395A-9439-D12B09A59E07 + 4212808
16 JavaScriptCore 0x00000001ae29f848 E76B377F-C862-395A-9439-D12B09A59E07 + 4212808
17 JavaScriptCore 0x00000001ae29f790 E76B377F-C862-395A-9439-D12B09A59E07 + 4212624
18 JavaScriptCore 0x00000001ae29f848 E76B377F-C862-395A-9439-D12B09A59E07 + 4212808
19 JavaScriptCore 0x00000001ae29f848 E76B377F-C862-395A-9439-D12B09A59E07 + 4212808
20 JavaScriptCore 0x00000001ae275780 E76B377F-C862-395A-9439-D12B09A59E07 + 4040576
21 JavaScriptCore 0x00000001aea6dda4 E76B377F-C862-395A-9439-D12B09A59E07 + 12397988
22 JavaScriptCore 0x00000001aed35538 _ZN3JSC8evaluateEPNS_14JSGlobalObjectERKNS_10SourceCodeENS_7JSValueERN3WTF8NakedPtrINS_9ExceptionEEE + 236
23 JavaScriptCore 0x00000001ae316700 JSEvaluateScript + 584
24 JavaScriptCore 0x00000001ade9d158 E76B377F-C862-395A-9439-D12B09A59E07 + 8536
25 TeadsSDK 0x000000010760aff8 block_destroy_helper + 6932
26 TeadsSDK 0x00000001075d8b5c block_destroy_helper + 6184
27 libdispatch.dylib 0x0000000107240c70 _dispatch_call_block_and_release + 32
28 libdispatch.dylib 0x00000001072427c0 _dispatch_client_callout + 20
29 libdispatch.dylib 0x000000010724a8a4 _dispatch_lane_serial_drain + 984
30 libdispatch.dylib 0x000000010724b5e0 _dispatch_lane_invoke + 428
31 libdispatch.dylib 0x0000000107258168 _dispatch_workloop_worker_thread + 908
32 libsystem_pthread.dylib 0x0000000213e690bc _pthread_wqthread + 288
33 libsystem_pthread.dylib 0x0000000213e68e5c start_wqthread + 8