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

    Parameters

    Returns EventListenerRemover

    • An object with a remove function to remove the listener.

    Example

    // Register a listener
    onNotificationReceivedInForeground(message => {
    doSomething(message);
    });

    Example

    // Register multiple listeners
    onNotificationReceivedInForeground(message => {
    doSomething(message);
    });

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