From 070a34e30d80b19b9044c1d148055eb97894ee9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 13 Feb 2019 13:19:59 +0100 Subject: [PATCH] ios: enable proximity sensor on the main thread Fixes this issue: Main Thread Checker: UI API called on a background thread: -[UIApplication setExpectsFaceContact:inLandscape:] PID: 25442, TID: 10886619, Thread name: (none), Queue name: com.facebook.react.ProximityQueue, QoS: 0 Backtrace: 4 JitsiMeet 0x000000010a0eaadc -[Proximity setEnabled:] + 64 5 CoreFoundation 0x00000001fea34630 + 144 6 CoreFoundation 0x00000001fe912450 + 292 7 CoreFoundation 0x00000001fe913034 + 60 8 JitsiMeet 0x000000010a4e08e8 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 492 9 JitsiMeet 0x000000010a4e7a10 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 248 10 JitsiMeet 0x000000010a4e776c ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 88 11 libdispatch.dylib 0x000000010b943824 _dispatch_call_block_and_release + 24 12 libdispatch.dylib 0x000000010b944dc8 _dispatch_client_callout + 16 13 libdispatch.dylib 0x000000010b94ce6c _dispatch_lane_serial_drain + 720 14 libdispatch.dylib 0x000000010b94db60 _dispatch_lane_invoke + 460 15 libdispatch.dylib 0x000000010b957bfc _dispatch_workloop_worker_thread + 1220 16 libsystem_pthread.dylib 0x00000001fe6490dc _pthread_wqthread + 312 17 libsystem_pthread.dylib 0x00000001fe64bcec start_wqthread + 4 --- ios/sdk/src/Proximity.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/sdk/src/Proximity.m b/ios/sdk/src/Proximity.m index 246a2b362..6288fb7c8 100644 --- a/ios/sdk/src/Proximity.m +++ b/ios/sdk/src/Proximity.m @@ -25,6 +25,10 @@ RCT_EXPORT_MODULE(); +- (dispatch_queue_t)methodQueue { + return dispatch_get_main_queue(); +} + /** * Enables / disables the proximity sensor monitoring. On iOS enabling the * proximity sensor automatically dims the screen and disables touch controls,