Unable to insert record into SQLite Database from Firebase Message Service when app is in background or closed state
I am trying out Firebase Notifications. I was able to get the Notification to work properly using this documentation. The message was received and I was able to send a notification to the Notification Bar from within the MyFirebaseMessagingService service class. This happens even when the app is in background or closed. What I need is to collect the data sent in the notification and insert it into an SQLite database. The code I wrote works fine if the app is in foreground, but it does not work if it is closed or in background. Here is what I wrote for the insert. DbHelper dbh=new DbHelper(this