-4

Im using inoic with cordova-plugin-fcm

There's any way to handle when user dismiss a notification, because I need to do store some data when a notification arrives.

tks for any help.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

0

There are two types of messages that you can send with FCM:

  • notification messages, which are primarily meant to be displayed to the user.

  • data messages, which are handled by your application code.

If you send a notification messages, then your code can handle the message while the app is active. But if your app is not active, the message is handled by the system and displayed to the user. Your code is not invoked in this case.

If you send a data message, it is always handled by your code. For your use-case, these sound like the better match.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Ok, I got that...and this is working fine, but when my app are close or backgrounded and the user dismiss the notification the event onNotification() dont fire, so I cant do anything with the data. If there's others ways to handle that please give me a help, Im stuck on this. – Rodrigo Malavasi Mar 22 '18 at 14:36