diff --git a/ios/RNFirebase/notifications/RNFirebaseNotifications.m b/ios/RNFirebase/notifications/RNFirebaseNotifications.m index d3aa1e3696..317a354402 100644 --- a/ios/RNFirebase/notifications/RNFirebaseNotifications.m +++ b/ios/RNFirebase/notifications/RNFirebaseNotifications.m @@ -105,12 +105,22 @@ - (void)didReceiveLocalNotification:(nonnull UILocalNotification *)localNotifica void (^fetchCompletionHandler)(UIBackgroundFetchResult) = fetchCompletionHandlers[handlerKey]; if (fetchCompletionHandler != nil) { fetchCompletionHandlers[handlerKey] = nil; - fetchCompletionHandler(fetchResult); + @try { + fetchCompletionHandler(fetchResult); + } + @catch (NSException * e) { + NSLog(@"Exception fetchCompletionHandler: %@", e); + }; } else { void(^completionHandler)(void) = completionHandlers[handlerKey]; if (completionHandler != nil) { completionHandlers[handlerKey] = nil; - completionHandler(); + @try { + completionHandler(); + } + @catch (NSException * e) { + NSLog(@"Exception completionHandler: %@", e); + }; } } }