From 07a872784c15f105935970c4e0959d1076a8cb6e Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Fri, 7 Oct 2016 15:59:10 -0400 Subject: [PATCH] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c16ad27..3db1eef 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); -- 2.26.2