addOnBackgroundMessage method

VoidCallback addOnBackgroundMessage(
  1. MessageHandler handler
)

Called when notification is received when app is terminated or in the background.

Implementation

VoidCallback addOnBackgroundMessage(MessageHandler handler) {
  _sendAndroidReadyToProcessMessages();
  _onBackgroundMessageHandlers.add(handler);
  return () {
    _onBackgroundMessageHandlers.remove(handler);
  };
}