After set a notification channel to not show notifications at lockscreen, it still is showing the notifications on lockscreen.
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
notificationManager.createNotificationChannel(notificationChannel);
But after the creation of the channel I can debug it and see that the notification channel does not have the lockScreenVisibility set to VISIBILITY_SECRET (-1), it still has the default value, that is -1000.
notificationChannel.getLockscreenVisibility()
Does anyone knows how to set the lockscreen visibility to not show on lockscreen? Or have any idea why it is not being updated?
One more information is that I already have created the channel previously. But I have deleted and recreated the channel with the VISIBILITY_SECRET.
When you delete and recreate a channel, all of the previous settings are restored. You must create a brand new channel (with a different channel ID) or completely uninstall/reinstall the app if you want to change anything other than the channel's name or description.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With