Search code examples
androidsqlitepush-notificationcordova-plugins

Storing Push Notification messages Locally ,in Phonegap Android App


I am Developing a Phonegap Application for android and i am using PushPlugin for recieving Notifications . I want to store these Notifications Locally using SQLiteDatabase ,So will it be better to store it using SqlitePLugin or I should Store them Locally using SQLite Database. I Hope i am Clear. Thanks in advance


Solution

  • There are two cases (I will consider the app in background / closed case), forground case would be pretty straight (You can use sqlitePlugin in this case):

    1. You receive only one notification - then you will be able to click that notification and store payload details using SqllitePlugin once your app will launch and callback is called.

    2. You receive multiple notifications - In this case you will only get details of the notification you clicked from notification bar in the callback function. You will struggle to get other notification payload. In this particular case it would be good to hack into PushPlugin and store Notifications locally.