What is the best practice to store push notifications?

I’m new on Ionic and I’m developing an app that has a notification page. The user will receive push notifications and the app must store all push notifications that it has been received. The app will also show a list of all read/unread notifications and change this status when the user reads the message.

I’m thinking to use the SQLite plugin and create methods to select an specific notification, all notifications, and an alter method to change the status read/unread.

Am I on the right way or there is a best practice to do it?

https://ionicframework.com/docs/storage/ should work (which is backed by SQLite if it is installed)

Be aware that there is no guarantee that a push notification will actually receive the device. If you have a backend server where you store the messages, it might be better to use an API that is called when a push notification is received to update the list of notifications on the device.

1 Like