Skip to content

Commit 4523546

Browse files
kylekurzzxcpoiu
authored andcommitted
Run presentLocalNotification on the UI thread (#32)
Xcode requires presentLocalNotification to be run on the UI thread. This commit wraps the call in an async block to dispatch on the UI thread.
1 parent 2af466c commit 4523546

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ios/RNVoipPushNotification/RNVoipPushNotificationManager.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ - (void)handleRemoteNotificationReceived:(NSNotification *)notification
213213

214214
RCT_EXPORT_METHOD(presentLocalNotification:(UILocalNotification *)notification)
215215
{
216-
[RCTSharedApplication() presentLocalNotificationNow:notification];
216+
dispatch_async(dispatch_get_main_queue(), ^{
217+
[RCTSharedApplication() presentLocalNotificationNow:notification];
218+
});
217219
}
218220

219221
+ (BOOL)requiresMainQueueSetup

0 commit comments

Comments
 (0)