getInitialMessage method

Future<RemoteMessage?> getInitialMessage()

If the application has been opened from a terminated state via a RemoteMessage (containing a Notification), it will be returned, otherwise it will be null.

Once the RemoteMessage has been consumed, it will be removed and further calls to getInitialMessage will be null.

This should be used to determine whether specific notification interaction should open the app with a specific purpose (e.g. opening a chat message, specific screen etc).

on Android, if the message was received in the foreground, and the notification was pressed whilst the app is in a background/terminated state, this will return null.

Implementation

Future<RemoteMessage?> getInitialMessage() {
  return _delegate.getInitialMessage();
}