Android TV push
While not a native feature, Android TV push integration is made possible by leveraging the Braze Android SDK and Firebase Cloud Messaging to register a push token for Android TV. It is, however, necessary to build a UI to display the notification payload once it is received.
- Integrate the Braze Android SDK
First, you must integrate the Braze Android SDK (If not already completed).
- Integrate push notifications
Next, you must integrate the Android Push Notifications (If not already completed).
- Create a custom toast view
Next, you will need to create a custom toast view for the app to display your notifications.
- Create a custom notification factory
Lastly, you must create a custom notification factory. This will override the default SDK behavior and allow you to manually display the notifications. By returning
null, this will prevent the SDK from processing and will require custom code to display the notification. Once these steps have been completed, you can start sending push to Android TV!
- Set up click analytics tracking (optional)
To track click analytics effectively, it is necessary to handle this manually, as Braze does not handle the display of the messages automatically. This can be achieved by creating a custom
BroadcastReceiverto listen for Braze push opened and received intents.
Note that these notifications will not persist and will only be visible to the user when the device displays them. This is due to Android TV’s notification center not supporting historical notifications.
How to test push on Android TV
To test if your push implementation is successful, send a notification from the Braze dashboard as you would normally for an Android device.
- If the application is closed: The push message will display a toast notification in the corner of the screen.
- If the application is open: You have the opportunity to display the message in your own hosted UI. We recommend following the UI styling of our Android Mobile SDK in-app messages.
For a marketing end user in Braze, launching a campaign to Android TV will be identical to launching a push to Android mobile apps. To target these devices exclusively, we recommend selecting the Android TV App in segmentation.
The delivered and clicked response returned by FCM will follow the same convention as a mobile Android device; therefore, any errors will be visible in the message activity log.