Handling Emergency Alert System alerts
Overview
For the US market, OpenTV Video Platform supports the Emergency Alert System (EAS) through integration with Digital Alert Systems. This page explains how a client application should handle the EAS messages that the platform sends.
Prerequisites
Before a client application can receive EAS messages from OpenTV Video Platform, it must:
- Create a device in the platform for the physical device it is running on. (That is, a device ID must have been created for the device.)
- Register the device with Firebase Cloud Messaging (FCM). This is also required to enable non-EAS messaging, as described in Messages.
- Register the device with Open Device Messaging (as described in Messages).
Handling EAS messages
A client application should handle the EAS alert messages it receives from FCM (see EAS message format, below) as follows:
- When it receives a message with an
easEventType
ofSTART LIVE
, it must:- Switch to the live channel specified in
easChannel
in the message at the time specified byeasStartTime
in the same message. - Prevent the user from navigating away from the live channel until it receives a message with an
easEventType
ofSTOP LIVE
. - When it receives a message of type
STOP LIVE
, at the time specified byeasEndTime
in the same message, the app should:- Switch back to the where the user was before the alert.
- Re-enable user navigation.
- Switch to the live channel specified in
- When it receives a message with an
easEventType
ofSTATIC
, it should:- Switch to the live channel specified in
easChannel
in the message at the time specified ineasStartTime
. - Prevent the user from navigating away from the live channel until:
- The time period specified in
easDuration
has passed, or - The time specified in
easEndTime
has been reached.
- The time period specified in
- When the alert has ended (because the
easDuration
time period has ended, oreasEndTime
has been reached), the app should:- Switch back to the where the user was before the alert.
- Re-enable user navigation.
- Switch to the live channel specified in
If the app receives an alert while it is in the background or terminated, when it is brought to the foreground or re-opened, it must switch to the appropriate live channel and disable navigation if the alert is still in effect.
EAS message format
The following is an example of an EAS alert message sent from FCM:
EAS alert messages from Firebase are sent as data messages, not notification messages.
{
"sentTime":1597604888495,
"ttl":2419200,
"data":{
"action":{
"easEventType":"STATIC",
"easChannel":"GLOBAL_88534",
"easDuration":180,
"easDescription":"description",
"extra":"{}",
"name":"tune",
"easType":"RMT",
"easStartTime":1597604888,
"easEndTime":1597605068,
"easFips":"123456"
}
},
"messageId":"0:1597604888521265%ae78e602f9fd7ecd",
"from":"706132353378"
}