zero.one
zero.one

Reputation: 1553

Is there anyway to know when the the device receive notifications from oneSingnal

I have built a flutter app and I have used oneSignal for the notifications part of the app

but till yet, I could not find a way to listen to know when a new notification is received by the app regardless the state of app being in the foreground or in the background

Upvotes: 0

Views: 1885

Answers (2)

Patricio Vargas
Patricio Vargas

Reputation: 5522

If you go to your OneSignal Dashboard->Messages-> Click on the message you want to see the data->Then scroll down to Audience Activity-> Confirmed Delivery.

enter image description here

Join our community:

Upvotes: 0

Ilyas Arafath
Ilyas Arafath

Reputation: 691

Future<void> oneSignalInitialise(BuildContext context) async {
  OneSignal.shared.setAppId("$notificationOneSignalAppId");

  ///asking for push notification permission
  OneSignal.shared.promptUserForPushNotificationPermission().then((accepted) {
    print("Accepted permission: $accepted");
  });

  OneSignal.shared.setNotificationOpenedHandler((openedResult) {
    print("notification opened");
  });

  OneSignal.shared.setNotificationWillShowInForegroundHandler((event) {
    print("Notification Forground");
  });

Upvotes: 1

Related Questions