4

In Android, if a user has lock screen and has selected hide sensitive information option, the notification's description shows as "content-hidden" while the screen is locked. I understand that this is how the feature is designed but is there a way for the notification of my app to be displayed as normal notification in this case too?

My app is solely based on Notifications so I want to give user a change to always see the notifications, if he wishes. I tried searching for a way to always show notification text but couldn't find any.

Rohan Kandwal
  • 9,112
  • 8
  • 74
  • 107

1 Answers1

11

The Notifications guide on visibility notes that you can use setVisibility() with VISIBILITY_PUBLIC to always allow users to view your notification, even when they have "Hide sensitive information" enabled.

You can also use setPublicVersion() to build a separate notification that shows only non-sensitive information to specifically handle this case.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443