In our app we would like to wake the screen up when notification arrives. This notification logic will be in service. We have tried to use "PARTIAL_WAKE_LOCK", but this is not working. We also tried "FULL_WAKE_LOCK", which was working but as this is deprecated we cannot use it in prod app. We have seen the alternatives for "PARTIAL_WAKE_LOCK" like "turnScreenOn" but this cannot be used from the service.
My question is do we have any other alternative to turn the screen on from the messaging service when notification arrives on the device?
Or, We have settings on the device to enable the wakelock manually right? (settings->display->lock screen->wake screen for notifications.) Can we open this settings page directly from the app somehow programatically?
I have already solved similar problem recently in my project.
Firstly ensure you have added this permission in your manifest.
Once you have done that now just call this code inside your FCM service class onMessageReceived method.
You can play around with aquire & release inside your onPause & onResume to make it work correctly.