firebase::messaging::Listener

This is an abstract class.

#include <messaging.h>

Base class used to receive messages from Firebase Cloud Messaging.

Summary

You need to override base class methods to handle any events required by the application. Methods are invoked asynchronously and may be invoked on other threads.

Inheritance

Direct Known Subclasses:firebase::messaging::PollableListener

Constructors and Destructors

~Listener()

Public functions

OnMessage(const Message & message)=0
virtual void
Called on the client when a message arrives.
OnRegistrationReceived(const char *installationId)
virtual void
Called on the client when the current app instance has been successfully registered with FCM.
OnTokenReceived(const char *token)
virtual void
Deprecated. Use OnRegistrationReceived(const char*) instead.
Called on the client when a registration token arrives.
OnUnregistrationReceived(const char *installationId)
virtual void
Called on the client when the current app instance has been successfully unregistered from FCM via a call to Unregister().

Public functions

OnMessage

virtual void OnMessage(
  const Message & message
)=0

Called on the client when a message arrives.

Details
Parameters
message
The data describing this message.

OnRegistrationReceived

virtual void OnRegistrationReceived(
  const char *installationId
)

Called on the client when the current app instance has been successfully registered with FCM.

This callback provides the unique Firebase Installation ID (FID), which should be used to target this app instance for direct-send messaging.

Details
Parameters
installationId
The Firebase Installation ID used for sending messages to the current app instance.

OnTokenReceived

virtual void OnTokenReceived(
  const char *token
)

Called on the client when a registration token arrives.

This function will eventually be called in response to a call to firebase::messaging::Initialize(...).

Deprecated. Use OnRegistrationReceived(const char*) instead.

Details
Parameters
token
The registration token.

OnUnregistrationReceived

virtual void OnUnregistrationReceived(
  const char *installationId
)

Called on the client when the current app instance has been successfully unregistered from FCM via a call to Unregister().

Details
Parameters
installationId
The Firebase Installation ID of the current app instance that was unregistered with FCM.

~Listener

virtual  ~Listener()