OpenTV ENTera & OpenTV Platform Documentation

Message format – general notifications

Overview

An operator can send notifications to client devices using one of the DMM APIs or using Operator Console (OpCon).

Message format

Example payload of a general notification:

JSON
{
  "notification": {
    "body": "20% off all TVOD until Sunday",
    "title": "Discount Movies"
  },
  "data": {
    "body": "20% off all TVOD until Sunday",
    "title": "Discount Movies",
    "referenceType": "NOTIFICATION_UPDATE" 
  }
}

The message is delivered as stringified JSON, and is shown here as regular JSON for readability.

When delivered to the client, the above example JSON will be stringified as follows:

JSON
"{\"notification\":{\"body\":\"20% off all TVOD until Sunday\",\"title\":\"Discount Movies\"},\"data\":{\"body\":\"20% off all TVOD until Sunday\",\"title\":\"Discount Movies\",\"referenceType\":\"NOTIFICATION_UPDATE\"}}"

The client app should check for the presence of a notification block:

  • If a notification block is present, the client should present the notification to the user immediately.

  • If there is no notification block, the client should store the notification so that the user can view it when they choose to (for example, in an inbox).