I want to store the firebase push notification into sqlite when the app in any state like app is closed/background/foreground. How can i do this? Is it possible to do this?
public override void OnMessageReceived(RemoteMessage message) { Log.Debug(TAG, "From: " + message.From); Log.Debug(TAG, "Notification Message Body: " + getBody); SendNotification(getBody, message.Data); } public override void HandleIntent(Intent p0)// this method will fire when the app in background and closed state { base.HandleIntent(p0); if (p0.Extras != null) { foreach (var key in p0.Extras.KeySet()) { var value = p0.Extras.GetString(key); Log.Debug(TAG, "Key: {0} Value: {1}", key, value); if(key== "gcm.notification.title") { Log.Debug("Delay Notification Title", "" + value); getBGTitle = value;//declared local variable } else if(key== "gcm.notification.body") { Log.Debug("Delay Notification Body", "" + value); getBGBody = value;//declared local variable insertData(getBGTitle,getBGBody)//call method for store SQLite Insert } } } }
Answers
@Mohanasundharam aram
You want to store what? the notification body?
what exactly you want?
I want to store Notification Title and Body
Have you resolved this problem?
yes. i resolved
Congrats. Could you please share the solution so that others can get help from your case?
Hello all
@jezh yes good idea
thanks to @Mohanasundharam
thanks @Mohanasundharam
Don't say thanks, it's my pleasure