Vanethos / flutter_notification_permissions

Plugin for Flutter to check and ask for Notification Permissions
BSD 2-Clause "Simplified" License
81 stars 72 forks source link

SwiftNotificationPermissionsPlugin.swift: runtime: UI API called from background thread: UIApplication.canOpenURL(_:) must be used from main thread only #9

Open anthonycmeow opened 5 years ago

anthonycmeow commented 5 years ago

Hello,

I have implemented the example code in iOS, there is 5 - 10 seconds delays when I click the navigation button to the iOS setting screen. I got the issue log below from Xcode log, could you take a look and see whether it is an issue? Thanks.

================================================================= Main Thread Checker: UI API called on a background thread: -[UIApplication canOpenURL:] PID: 4660, TID: 1359225, Thread name: (none), Queue name: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out, QoS: 0 Backtrace: 4 notification_permissions 0x000000010506070c $s24notification_permissions34SwiftNotificationPermissionsPluginC6handle_6resultySo17FlutterMethodCallCyypSgctFySScfU + 2408 5 notification_permissions 0x0000000105061524 $s24notification_permissions34SwiftNotificationPermissionsPluginC03getD6Status10completionyySSctFySo22UNNotificationSettingsCcfU + 496 6 notification_permissions 0x00000001050616b0 $sSo22UNNotificationSettingsCIegg_ABIeyBy_TR + 80 7 libdispatch.dylib 0x00000001050eb6f0 _dispatch_call_block_and_release + 24 8 libdispatch.dylib 0x00000001050ecc74 _dispatch_client_callout + 16 9 libdispatch.dylib 0x00000001050f4bf4 _dispatch_lane_serial_drain + 712 10 libdispatch.dylib 0x00000001050f58ec _dispatch_lane_invoke + 512 11 libdispatch.dylib 0x00000001050ff77c _dispatch_workloop_worker_thread + 1148 12 libsystem_pthread.dylib 0x0000000196ed9114 _pthread_wqthread + 304 13 libsystem_pthread.dylib 0x0000000196edbcd4 start_wqthread + 4 2019-07-21 16:59:26.520187-0400 Runner[4660:1359225] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication canOpenURL:] PID: 4660, TID: 1359225, Thread name: (none), Queue name: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out, QoS: 0 Backtrace: 4 notification_permissions 0x000000010506070c $s24notification_permissions34SwiftNotificationPermissionsPluginC6handle_6resultySo17FlutterMethodCallCyypSgctFySScfU + 2408 5 notification_permissions 0x0000000105061524 $s24notification_permissions34SwiftNotificationPermissionsPluginC03getD6Status10completionyySSctFySo22UNNotificationSettingsCcfU + 496 6 notification_permissions 0x00000001050616b0 $sSo22UNNotificationSettingsCIegg_ABIeyBy_TR + 80 7 libdispatch.dylib 0x00000001050eb6f0 _dispatch_call_block_and_release + 24 8 libdispatch.dylib 0x00000001050ecc74 _dispatch_client_callout + 16 9 libdispatch.dylib 0x00000001050f4bf4 _dispatch_lane_serial_drain + 712 10 libdispatch.dylib 0x00000001050f58ec _dispatch_lane_invoke + 512 11 libdispatch.dylib 0x00000001050ff77c _dispatch_workloop_worker_thread + 1148 12 libsystem_pthread.dylib 0x0000000196ed9114 _pthread_wqthread + 304 13 libsystem_pthread.dylib 0x0000000196edbcd4 start_wqthread + 4

image image

henrikskul commented 4 years ago

Im having the same issue, did you find any fix @anthonycmeow ?