Amplify JS API Documentation
    Preparing search index...

    Variable onNotificationReceivedInForegroundConst

    onNotificationReceivedInForeground: OnNotificationReceivedInForeground

    Registers a listener that will be triggered when a notification is received while app is in a foreground state.

    A callback handler to be invoked with the received PushNotificationMessage.

    • An object with a remove function to remove the listener.
    // Register a listener
    onNotificationReceivedInForeground(message => {
    doSomething(message);
    });
    // Register multiple listeners
    onNotificationReceivedInForeground(message => {
    doSomething(message);
    });

    onNotificationReceivedInForeground(message => {
    doSomethingElse(message);
    });