The Messaging SDK does not work in a Node.js environment.

Callable

  • messaging ( app ? :  App ) : Messaging
  • Gets the Messaging service for the default app or a given app.

    firebase.messaging() can be called with no arguments to access the default app's Messaging service or as firebase.messaging(app) to access the Messaging service associated with a specific app.

    Calling firebase.messaging() in a service worker results in Firebase generating notifications if the push message payload has a notification parameter.

    The Messaging SDK does not work in a Node.js environment.

    example
    // Get the Messaging service for the default app
    var defaultMessaging = firebase.messaging();
    example
    // Get the Messaging service for a given app
    var otherMessaging = firebase.messaging(otherApp);
    namespace

    Parameters

    • Optional app: App

      The app to create a Messaging service for. If not passed, uses the default app.

    Returns Messaging

Index

Functions

isSupported

  • isSupported ( ) : boolean
  • Returns boolean