HTML Push Notifications
In Braze SDK version 3.1.1, HTML can be sent to a device to render multicolor text in push notifications.
The above example is rendered with the following HTML:
1
<p><span style="color: #99cc00;">M</span>u<span style="color: #008080;">lti</span>Colo<span style="color: #ff6600;">r</span> <span style="color: #000080;">P</span><span style="color: #00ccff;">u</span><span style="color: #ff0000;">s</span><span style="color: #808080;">h</span></p>
1
<p><em>test</em> <span style="text-decoration: underline; background-color: #ff6600;"><strong>message</strong></span></p>
Android OS limits what HTML elements/tags are valid in push notifications. For example,
marquee
is not allowed.
Implementation
In your braze.xml
:
1
<bool translatable="false" name="com_appboy_push_notification_html_rendering_enabled">true</bool>
Or in your AppboyConfig:
1
2
3
4
AppboyConfig appboyConfig = new AppboyConfig.Builder()
.setPushHtmlRenderingEnabled(true)
.build();
Appboy.configure(this, appboyConfig);
1
2
3
4
val appboyConfig = AppboyConfig.Builder()
.setPushHtmlRenderingEnabled(true)
.build()
Appboy.configure(this, appboyConfig)