Closed AlanWen2016 closed 2 years ago
@AlanWen2016 send local notification, when the remote came
you can change the behavior in your app delegate:
// Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
sounds like you'll want UNNotificationPresentationOptionNone ( other options documented here)
PM doesn' t want to get notification when app in foreground.How can I prevent to receive notification when app in foreground?