Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications not showing up on locked devices for newer version android #62

Open
roeku opened this issue Apr 11, 2021 · 4 comments
Open

Comments

@roeku
Copy link

roeku commented Apr 11, 2021

I've tested this on an OnePlus and it functions fine. But running the same code on Xiaomi devices for some reason doesn't show the notification when the phone is locked. It does show it when you pull the notifications drawer down when the phone is open, but not on the locked screen. I was thinking it might have to do with the NotificationManager.IMPORTANCE_LOW but tried setting that to different levels but that didn't help. Any advice on how to fix would be much appreciated.

@roeku roeku changed the title Notifications not showing up on locked xiaomi devices Notifications not showing up on locked devices for newer version android Apr 15, 2021
@roeku
Copy link
Author

roeku commented Apr 15, 2021

So I've investigated this further and noticed it does have to do with the settings on newer devices, we need to give explicit permission for the notification to appear on locked screens. Without the permissions, it won't appear. I tried updating the code to make it so that we wouldn't need to prompt the user but I couldn't find a way to do it. I did see that spotify does have a way of doing it without the permissions so it should be possible. I couldn't figure it out though.

@jeromexiong
Copy link
Owner

have you open the app settings notification?

@rares45
Copy link

rares45 commented Oct 11, 2021

This is because after Android 11 you need to use Media Controls instead of regular notifications. https://developer.android.com/guide/topics/media/media-controls

@asifwedig2021
Copy link

@roeku @jeromexiong @rares45
have you found any solution for the same Android 11 Quick setting issue as well as locked screen issue.
if any one found any solution please share it.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants