"canOpenURL:" on a thread that isn`t main thread?

When I call this method on a thread that isn`t thread. And chose main thread check on target, The Console show the world :

Main Thread Checker: UI API called on a background thread: -[UIApplication canOpenURL:] PID: 8818, TID: 10191278, Thread name: (none), Queue name: com.myqueue.canopen, QoS: 0 Backtrace: 4 TestDemo 0x0000000102f6c068 __39-[AppTools isExists:]_block_invoke_3 + 892 5 CoreFoundation 0x000000019e22995c 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 1042780 6 CoreFoundation 0x000000019e12ec98 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 15512 7 TestDemo 0x0000000102f6bba0 __39-[AppTools isExists:]_block_invoke_2 + 424 8 libdispatch.dylib 0x0000000103a4d7fc _dispatch_call_block_and_release + 24 9 libdispatch.dylib 0x0000000103a4ebd8 _dispatch_client_callout + 16 10 libdispatch.dylib 0x0000000103a55b48 _dispatch_lane_serial_drain + 744 11 libdispatch.dylib 0x0000000103a566e4 _dispatch_lane_invoke + 448 12 libdispatch.dylib 0x0000000103a61adc _dispatch_workloop_worker_thread + 1324 13 libsystem_pthread.dylib 0x000000019df72b88 _pthread_wqthread + 276 14 libsystem_pthread.dylib 0x000000019df75760 start_wqthread + 8

Thanks for the post, can you provide a little more information about the URL you are passing or just the code you are using when that message shows in your console? As that API can be called in a thread that is not the main thread as shows in the documentation:

You can call this method safely on a thread that isn’t the main thread.

https://developer.apple.com/documentation/uikit/uiapplication/canopenurl(_:)

Interesting to see what URL are you calling, the method should return a true or false only. Providing a focused sample and iOS version, Xcode and macOS is always a good idea.

Thanks Albert Pascual
  Worldwide Developer Relations.

"canOpenURL:" on a thread that isn`t main thread?
 
 
Q