Commit bc0baeba authored by Libin Lu's avatar Libin Lu
parents 39e014a4 07a87278
...@@ -158,7 +158,7 @@ Edit `AppDelegate.m`: ...@@ -158,7 +158,7 @@ Edit `AppDelegate.m`:
+ - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler + - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
+ { + {
+ [[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived object:self userInfo:notification.request.content.userInfo]; + [[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); + completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound);
+ }else{ + }else{
+ completionHandler(UNNotificationPresentationOptionNone); + completionHandler(UNNotificationPresentationOptionNone);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment