Question:
Is it possible to add bold/italic/coloured text to a notification on iOS and Android?
Answer:
Android
Yes. Android renders a limited set of HTML tags in the notification text. For example, to make the text bold, italic and green:
<font color="green"><b><i> Hello, world! </i></b></font>
You can also use inline styles, e.g. <span style="color: green;"><b><i>Hello world!</i></b></span>. Put the markup directly into the Message field in the Control Panel or into the content field of your API request.
Please note: rendering depends on the device manufacturer's notification UI. Some devices and Android versions ignore colour tags (or override text colour to match the system theme), so never rely on colour to convey meaning.
iOS
No. APNs does not support any text markup - HTML tags placed in the title or body are delivered as literal characters. The notification title is always displayed in bold by the system, and the body in regular weight; this is iOS styling, not something you control from the payload.
To make use of that built-in emphasis, send a separate title and message text (the Title field in the Control Panel, or ios_title / preset title via API). If you need genuinely rich formatting on iOS, use Rich Media / in-app messages, or a Notification Service Extension with a custom notification content extension.
Comments
1 comment
How to turn of bold format on notification bar !??
Please sign in to leave a comment.