Skip to content

Conversation

@yamazaki-sensei
Copy link
Contributor

Hi.

While using this lib, some warnings are shown in Xcode console like below,
and it seems that some methods must be called on main thread.

This PR fixes this problem. Thanks.

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication registerUserNotificationSettings:]
PID: 498, TID: 239918, Thread name: (none), Queue name: com.facebook.react.RNVoipPushNotificationManagerQueue, QoS: 0
Backtrace:
4   pc                                  0x0000000101b688d8 -[RNVoipPushNotificationManager registerUserNotification:] + 552
5   pc                                  0x0000000101b695f0 -[RNVoipPushNotificationManager requestPermissions:] + 92
6   CoreFoundation                      0x00000001847caad0 <redacted> + 144
7   CoreFoundation                      0x00000001846a936c <redacted> + 292
8   CoreFoundation                      0x00000001846ade1c <redacted> + 60
9   pc                                  0x0000000101976324 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2064
10  pc                                  0x0000000101a1b030 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 664
11  pc                                  0x0000000101a1abc0 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 132
12  pc                                  0x0000000101a1ab30 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
13  libdispatch.dylib                   0x0000000103ac52cc _dispatch_call_block_and_release + 24
14  libdispatch.dylib                   0x0000000103ac528c _dispatch_client_callout + 16
15  libdispatch.dylib                   0x0000000103ad3f80 _dispatch_queue_serial_drain + 696
16  libdispatch.dylib                   0x0000000103ac87ec _dispatch_queue_invoke + 332
17  libdispatch.dylib                   0x0000000103ad4f6c _dispatch_root_queue_drain_deferred_wlh + 428
18  libdispatch.dylib                   0x0000000103adc020 _dispatch_workloop_worker_thread + 652
19  libsystem_pthread.dylib             0x00000001843eaf1c _pthread_wqthread + 932
20  libsystem_pthread.dylib             0x00000001843eab6c start_wqthread + 4
2018-10-02 15:13:38.470781+0900 pc[498:239918] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication registerUserNotificationSettings:]
PID: 498, TID: 239918, Thread name: (none), Queue name: com.facebook.react.RNVoipPushNotificationManagerQueue, QoS: 0
Backtrace:
4   pc                                  0x0000000101b688d8 -[RNVoipPushNotificationManager registerUserNotification:] + 552
5   pc                                  0x0000000101b695f0 -[RNVoipPushNotificationManager requestPermissions:] + 92
6   CoreFoundation                      0x00000001847caad0 <redacted> + 144
7   CoreFoundation                      0x00000001846a936c <redacted> + 292
8   CoreFoundation                      0x00000001846ade1c <redacted> + 60
9   pc                                  0x0000000101976324 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2064
10  pc                                  0x0000000101a1b030 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 664
11  pc                                  0x0000000101a1abc0 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 132
12  pc                                  0x0000000101a1ab30 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
13  libdispatch.dylib                   0x0000000103ac52cc _dispatch_call_block_and_release + 24
14  libdispatch.dylib                   0x0000000103ac528c _dispatch_client_callout + 16
15  libdispatch.dylib                   0x0000000103ad3f80 _dispatch_queue_serial_drain + 696
16  libdispatch.dylib                   0x0000000103ac87ec _dispatch_queue_invoke + 332
17  libdispatch.dylib                   0x0000000103ad4f6c _dispatch_root_queue_drain_deferred_wlh + 428
18  libdispatch.dylib                   0x0000000103adc020 _dispatch_workloop_worker_thread + 652
19  libsystem_pthread.dylib             0x00000001843eaf1c _pthread_wqthread + 932
20  libsystem_pthread.dylib             0x00000001843eab6c start_wqthread + 4
2018-10-02 15:13:38.777157+0900 pc[498:239918] [RNVoipPushNotificationManager] voipRegistration
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 498, TID: 239918, Thread name: (none), Queue name: com.facebook.react.RNVoipPushNotificationManagerQueue, QoS: 0
Backtrace:
4   pc                                  0x0000000101b689bc -[RNVoipPushNotificationManager voipRegistration] + 156
5   pc                                  0x0000000101b69608 -[RNVoipPushNotificationManager requestPermissions:] + 116
6   CoreFoundation                      0x00000001847caad0 <redacted> + 144
7   CoreFoundation                      0x00000001846a936c <redacted> + 292
8   CoreFoundation                      0x00000001846ade1c <redacted> + 60
9   pc                                  0x0000000101976324 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2064
10  pc                                  0x0000000101a1b030 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 664
11  pc                                  0x0000000101a1abc0 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 132
12  pc                                  0x0000000101a1ab30 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
13  libdispatch.dylib                   0x0000000103ac52cc _dispatch_call_block_and_release + 24
14  libdispatch.dylib                   0x0000000103ac528c _dispatch_client_callout + 16
15  libdispatch.dylib                   0x0000000103ad3f80 _dispatch_queue_serial_drain + 696
16  libdispatch.dylib                   0x0000000103ac87ec _dispatch_queue_invoke + 332
17  libdispatch.dylib                   0x0000000103ad4f6c _dispatch_root_queue_drain_deferred_wlh + 428
18  libdispatch.dylib                   0x0000000103adc020 _dispatch_workloop_worker_thread + 652
19  libsystem_pthread.dylib             0x00000001843eaf1c _pthread_wqthread + 932
20  libsystem_pthread.dylib             0x00000001843eab6c start_wqthread + 4
2018-10-02 15:13:38.833667+0900 pc[498:239918] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 498, TID: 239918, Thread name: (none), Queue name: com.facebook.react.RNVoipPushNotificationManagerQueue, QoS: 0
Backtrace:
4   pc                                  0x0000000101b689bc -[RNVoipPushNotificationManager voipRegistration] + 156
5   pc                                  0x0000000101b69608 -[RNVoipPushNotificationManager requestPermissions:] + 116
6   CoreFoundation                      0x00000001847caad0 <redacted> + 144
7   CoreFoundation                      0x00000001846a936c <redacted> + 292
8   CoreFoundation                      0x00000001846ade1c <redacted> + 60
9   pc                                  0x0000000101976324 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2064
10  pc                                  0x0000000101a1b030 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 664
11  pc                                  0x0000000101a1abc0 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 132
12  pc                                  0x0000000101a1ab30 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
13  libdispatch.dylib                   0x0000000103ac52cc _dispatch_call_block_and_release + 24
14  libdispatch.dylib                   0x0000000103ac528c _dispatch_client_callout + 16
15  libdispatch.dylib                   0x0000000103ad3f80 _dispatch_queue_serial_drain + 696
16  libdispatch.dylib                   0x0000000103ac87ec _dispatch_queue_invoke + 332
17  libdispatch.dylib                   0x0000000103ad4f6c _dispatch_root_queue_drain_deferred_wlh + 428
18  libdispatch.dylib                   0x0000000103adc020 _dispatch_workloop_worker_thread + 652
19  libsystem_pthread.dylib             0x00000001843eaf1c _pthread_wqthread + 932
20  libsystem_pthread.dylib             0x00000001843eab6c start_wqthread + 4

@zxcpoiu zxcpoiu merged commit 617bfa3 into react-native-webrtc:master Dec 20, 2018
@zxcpoiu
Copy link
Member

zxcpoiu commented Dec 20, 2018

thanks

zxcpoiu added a commit to zxcpoiu/react-native-voip-push-notification that referenced this pull request Feb 18, 2019
bdba92d added requiresMainQueueSetup to remove Warning (react-native-webrtc#27)  ( Steven Golemme 2019-02-17 23:26:48 -0500)
617bfa3 Call methods on main thread if required (react-native-webrtc#22)  ( hira 2018-12-20 18:07:13 +0900)
cf32233 Add podspec file (react-native-webrtc#23)  ( Richard Samuelson 2018-12-20 10:06:20 +0100)
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

Successfully merging this pull request may close these issues.

2 participants