getInitialNotification method
Retrieves the initial notification when app is opened from terminated state by notification.
This method returns a Future that resolves to a dynamic value. The value
may be a Map containing notification data in the form of key-value pairs,
where keys are strings and values are dynamic types, or null if there
was no initial notification.
You can use this method to check if your Flutter application was launched as a result of a user tapping a notification and retrieve the associated notification data.
Example usage:
Future<void> handleInitialNotification() async {
final initialNotification = await RetenoPlugin.getInitialNotification();
if (initialNotification != null) {
// Handle the initial notification here
print("Initial notification: $initialNotification");
} else {
// The app was launched without a notification
print("No initial notification.");
}
}
Returns a Future that resolves to a dynamic value representing the
initial notification or null if there was no initial notification.
Implementation
Future<dynamic> getInitialNotification() {
return _platform.getInitialNotification();
}