• Registers a listener that will be triggered when a token is received. A token will be received:

    1. On every app launch, including the first install
    2. When a token changes (this may happen if the service invalidates the token for any reason)

    Parameters

    Returns EventListenerRemover

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

    Example

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

    Example

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

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