0

Is there any way to somehow handle, see or just delete all received firebase messages (notifications) on application start or click on single notification. I'am working on android app using unity. When more than one notification arrives all I can do is click on notifications one by one and after every click only clicked one (notifications) is handled with OnMesageReceived. What I need is some way to handle all received messages on application start or on click on one of the norifications. If that is not possible then even just deleting all received messages after handling clicked one can help.

Zoe
  • 27,060
  • 21
  • 118
  • 148
pereca
  • 75
  • 7
  • You could possibly persist all the notifications your receive from firebase. With that you could build a Notification Center kind of screen within your app. – Dinesh Jun 04 '19 at 08:17
  • That would be great but i don't know how to access received notifications except one that i clicked on. I am talking about notifications received while the app has been in background or completely closed (not launched in other words). – pereca Jun 04 '19 at 08:21
  • You can persist the data that you receive in onMessageReceived() into a data store like SQLite. This way when you open your app you would have all the content that you need to look into. – Dinesh Jun 04 '19 at 09:03
  • For that scenario i would have to write my "messaging system" in native android and use it as plugin for my unity app, but currently I am trying to write it what is possible more just in unity. I already have backend which app contacts on every startup, firebase notifications are just used to well ... notify user. What I need is some way to remove notification from the tray after the user saw its effect from the app. Basically i want to somehow get list of all notifications received from firebase. – pereca Jun 04 '19 at 09:14
  • I don't have an idea about doing it through Unity pereca. – Dinesh Jun 04 '19 at 12:41
  • It sounds like your new messages are meant to replace older messages. In that case, consider "tagging" the messages as shown here: https://stackoverflow.com/questions/45140856/fcm-remove-older-push-notifcation-tiles-when-a-new-push-notiifcation-is-reciev/45141994#45141994 or giving it a `collapse_key` as shown here: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages – Frank van Puffelen Jun 04 '19 at 13:28
  • Well not exactly, i would like to have separate notifications in tray for every event so that user can click on each of them and see what changed, but also if user already saw what changed from app, notification that represents that change should be removed from tray (like new message notification) – pereca Jun 04 '19 at 14:45

0 Answers0