lastKnownPushToken property

Future<String?> lastKnownPushToken

Get the last known push token. This might be null if the SDK never successfully registered to push notifcations.

A number of issues can cause this: Invalid configuration, no permission to display notifications, running on an iOS simulator, Firebase unavailability, ... See your logs for more information.

Note: Calling this method too early in the application lifecycle might return an out of date value.

Implementation

Future<String?> get lastKnownPushToken async {
  return await _channel.invokeMethod('push.getLastKnownPushToken');
}