My Firebase Messaging Service App fires the onMessageReceived when the App is in the background, foreground and locked (with the screen on). The only time it stops firing is when the screen is off (even though the app is still running in the background). How do I get my onMessageReceived to be called when the screen is off ? All the answers I've seen have pointed to using a wake lock which I tried but this did not work. Is there a work around for this or is a custom solution the only way to go ?
I am making a type of chat application similar to whatsapp, so i need the functionality of events triggered even when the screen is off. If FCM cannot do this can anyone recommend an alternative service or API ?
All help appreciated
Thanks
Posting a solution for reference in case anyone else has this issue.
On Android 6.0 if you add the app to the 'white list' under Settings->Smart Assist->Background Task Cleaner, you get the notifications when the screen is off. No wake locks required.
I would not have thought about looking at the general App settings if it wasn't for your comment @Diego Giorgini so thank you very much.