Is there a way to stay logged in to app after destruction for push notifications

Viewed 29

I am trying to create an app that relies on Push Notifications that are customized per user using firebase. The thing is with my app is when you destroy the application and re-open it, it will go through the login in and then logs in automatically by itself using SharedPreferences. Would the destruction of the app lead to the user not receiving their notifications. If so, how may I design the app in such way that it stays logged in even after destruction or device reboot such as Instagram, WhatsApp, Snapchat, etc.?

1 Answers

If you are using FirebaseMessagingService() then it is gonna survive after reboot and get started automatically to receive the pending notifications. What I mean by pending is that if the device is offline for some time then the notifications can live in pending state for almost a month and if device gets online within that timespan then the notifications are delivered.

You can check the doc here FCM

Related