We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
GuidesPush KitAndroidOther CapabilitiesNotification Message Content Hiding on the Lock Screen

Notification Message Content Hiding on the Lock Screen

Notification message content hiding on the lock screen means that if the screen of a user device is locked, the content of a received notification message will not be displayed on the lock screen. To enable this function, set the visibility parameter. The options of the parameter are as follows:

  • VISIBILITY_UNSPECIFIED: The visibility is not specified, which has the same effect as PRIVATE.
  • PUBLIC: The content of a received notification message is displayed on the lock screen.
  • SECRET: A received notification message is not displayed on the lock screen.
  • PRIVATE: If a user has set a lock screen password and enabled Hide notification content under Settings > Notifications, the content of a received notification message is hidden on the lock screen.

Message body example:

Collapse
Word wrap
Dark theme
Copy code
  1. {
  2. "message": {
  3. "notification": {
  4. "title": "message title",
  5. "body": "message body"
  6. },
  7. "android": {
  8. "notification": {
  9. "visibility": "PRIVATE",
  10. "click_action": {
  11. "type": 3
  12. }
  13. }
  14. },
  15. "token": ["pushtoken1"]
  16. }
  17. }