File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -429,14 +429,18 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
429
429
[self sendEventWithName: @" remoteNotificationRegistrationError" body: errorDetails];
430
430
}
431
431
432
- RCT_EXPORT_METHOD (onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result) {
433
- RNCRemoteNotificationCallback completionHandler = self.remoteNotificationCallbacks [notificationId];
434
- if (!completionHandler) {
435
- RCTLogError (@" There is no completion handler with notification id: %@ " , notificationId);
436
- return ;
437
- }
438
- completionHandler (result);
439
- [self .remoteNotificationCallbacks removeObjectForKey: notificationId];
432
+ RCT_EXPORT_METHOD (onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result)
433
+ {
434
+ dispatch_async (dispatch_get_main_queue (), ^{
435
+ RNCRemoteNotificationCallback completionHandler = self.remoteNotificationCallbacks [notificationId];
436
+ if (!completionHandler) {
437
+ RCTLogError (@" There is no completion handler with notification id: %@ " , notificationId);
438
+ return ;
439
+ }
440
+
441
+ completionHandler (result);
442
+ [self .remoteNotificationCallbacks removeObjectForKey: notificationId];
443
+ });
440
444
}
441
445
442
446
/* *
You can’t perform that action at this time.
0 commit comments