Flutter Push Handling

Getting Initial Notification

When you instantiate the app by clicking on a push notification, you may need to get its payload.
To do it, use the getInitialNotification method:

import 'package:reteno_plugin/reteno.dart';

final Reteno reteno = Reteno();

reteno.getInitialNotification().then((Map<String, dynamic>? payload) {
      // Process payload...
});

Listening for New Push Notifications in an Open App

When the app is open, you may need to track for new push notifications.
For that, the plugin provides the onRetenoNotificationReceived stream you can listen to:

import 'package:reteno_plugin/reteno.dart';

Reteno.onRetenoNotificationReceived.listen((Map<String, dynamic> payload) {
      // Process payload...
});

Handle Interaction with Notification

When notification is pressed you may need to handle that and receive notification's data.
For that, the plugin provides the onRetenoNotificationClicked stream you can listen to:

import 'package:reteno_plugin/reteno.dart';

Reteno.onRetenoNotificationClicked.listen((Map<String, dynamic> payload) {
      // Process payload...
});