Function useMessagingToken

  • Returns the messaging token. The token never updates.

    Parameters

    • messaging: Messaging

      Firebase Messaging instance

    • Optionaloptions: UseMessagingTokenOptions

      Options to configure how the token will be fetched

    Returns UseMessagingTokenResult

    Token, loading state, and error

    • value: Messaging token; undefined if token is currently being fetched, or an error occurred
    • loading: true while fetching the token; false if the token was fetched successfully or an error occurred
    • error: undefined if no error occurred