I use the FirebaseMessagingService to handle incoming notifications. When my app is in the foreground and background the messages are being arrived. When I swipe-out the app, notifications are being arrived. But if I restart my device, notifications are not being arrived until I run my app. In the same way, Telegram and WhatsApp continue receiving notifications after reboot. I have implemented the onNewToken() method and have added logic to send new token to the server but it hasn’t helped. How can I continue receiving notification after reboot?
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
They have a background service which starts the service on bootup. You need to implement such a service. It will increase battery consumption. This might help you.
Actually, If you want to start service after restarted then you have to add intent-filter action. try to add BOOT_COMPLETED action in your intent-filter. Add below lines in the manifest. But basically for Firebase Notification, No need to add this action.