Skip to content

iOS: Push notifications are shown when in foreground #817

Open
@ghost

Description

On iOS Push notifications are shown although the app is in foreground. This bug was introduced in the commit 06a8b2d.

As per Apple developer documentation: https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate

func userNotificationCenter(UNUserNotificationCenter, willPresent: UNNotification, withCompletionHandler: (UNNotificationPresentationOptions) -> Void)
Asks the delegate how to handle a notification that arrived while the app was running in the foreground.

So the completion handler should be called with completionHandler(UNNotificationPresentationOptionNone);, which doesn't show the Push notification anymore when the app is in foreground.

I think the default behavior of this plugin should be not to show Push notification when in foreground.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions