diff --git a/README.md b/README.md index c16ad27b7db0964469c7829ca46279c07dd2b2f1..3db1eef48023eaeb772836e4e0af9cb6b108d556 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Edit `AppDelegate.m`: + - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler + { + [[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived object:self userInfo:notification.request.content.userInfo]; -+ if([notification.request.content.userInfo valueForKey:@"show_in_foreground"]){ ++ if([[notification.request.content.userInfo valueForKey:@"show_in_foreground"] isEqual:@YES]){ + completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound); + }else{ + completionHandler(UNNotificationPresentationOptionNone);