Current Implentation: When event is generated at server I am sending notifications to android app using FCM, some notification are with normal priority and some with high priority. When notifications with high priority are sent to android app, app trigger custom alarms with sound to inform user about event.
It is working in android 5,6,7 without any issues.
Issue: In phones with android 8+ I am facing issue of late notification due to Doze mode and App Stanby mode, so notifications are sent on time but received late on phone with delay of 20-25 minutes
What I have tried: I have done all required settings like keeping Power saving disabled, Keep app rinning in background, Autostart enabled, Priority notification are enabled, Also sending notifications with normal and high priority but still issue not resolved.
I have tried using foreground service but that remains active untill app is open, as soon as app is closed service stops.
How to send emergency alerts from server to android app in realtime even when app is closed? Using foreground service or by using other channel?