Commit bc0baeba authored by Libin Lu's avatar Libin Lu
parents 39e014a4 07a87278
......@@ -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);
......
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