I work in an Android application that will send notifications to the user. However, I have the notification-history Activity
that displays the notifications sent previously to the user. How can I get these old notifications? Is there a way to get it without storing the notifications in my database? I use the Firebase database.

- 23,691
- 13
- 78
- 98

- 25
- 1
- 1
- 3
1 Answers
In order to show the notification history of each user, you may consider storing the notification sent to each user in a different node in your firebase database by yourself. Because, as per my knowledge, Firebase does not provide any API to query the notifications sent to a specific user of your application as this does not store any specific user data. It just has the registration id, based on which, it sends the notification to that specific registration id. Please keep in mind that, a user can have a multiple registration id if they are using multiple devices for your application.
Firebase gives you an overall idea of how many notifications were sent, how many delivered, how many of them were clicked etc. You can log into your firebase console and check the Cloud Messaging section for the detailed overview of the notifications sent. You can check this answer as well for better understanding.
To understand more about the lifetime of a message, you can see their developer documentation here.
However, you can check the delivery status of your messages sent I think.
Hope that helps!

- 23,691
- 13
- 78
- 98
-
thank you, but I didn't send notification from firebase , only firebase store the user data and other data related to my application .... notifications is basic without firebase – mSU Feb 13 '19 at 20:38
-
So aren't you talking about push-notification? – Reaz Murshed Feb 13 '19 at 21:47