Skip to main content

Messages

Messages, located in the Messages Inbox, are used to notify users about important information.

Technically, they are implemented as add-ons (see the add-on documentation).

The JSON files are validated via JSON Schema files: https://github.com/mozilla-mobile/mozilla-vpn-client/tree/main/scripts/ci/jsonSchemas

On this page, we want to describe how to write a message.

JSON format

The Message JSON files are add-on JSON objects, with type "message" and a "message" property object with the following properties:

PropertyDescriptionTypeRequired
idA unique identifier for the messageStringYes
usesSharedStringsWhether it uses the translation file shared between all messages (default: false)BooleanNo
shortVersionA human-readable version number to insert into user-facing stringsStringsYes if usesSharedStrings is true, No otherwise
titleThe subject of the messageStringYes
subtitleA brief description of the messageStringNo
title_commentAn optional comment to describe the meaning of the titleStringNo
subtitle_commentAn optional comment to describe the meaning of the subtitleStringNo
dateThe date the message was received (using seconds since epoch time)NumberNo
badgeA label used to tag a message (options: warning, critical, new_update, whats_new, survey, subscription )StringNo
notifyShould we notify the user about this message via system notifications (Default: true)BooleanNo
blocksAn array of graphical blocks that compose the user interface of the message's contents (see more info here)Array of Block objectsYes