我正在为一个具有 iOS 和 Android 版本的应用程序集成 FCM。
目前,对于 iOS,我想以多行形式发送标题。我该怎么做呢?我正在尝试使用 Firebase 控制台进行测试。但似乎没有什么对我有用。
我尝试过这些
\n
<br/>
\\n
\r\n
如建议的这个帖子 https://stackoverflow.com/questions/7706818/how-can-i-send-an-apple-push-notification-with-multiple-lines-i-e-with-a-n-c。但没有什么真正起作用。
I basically want the first 2 lines of the notification to be in bold. Any help much appreciated.
![enter image description here](https://i.stack.imgur.com/sb2p9.jpg)
您看到的第一行粗体是通知标题,第二行是副标题,下面是内容(常规字体)。
这些是通知的属性,因为 iOS 10 设置为UN(可变)通知内容 https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent(字幕行以前不可用)。
它们的属性可以在通过 APNS 发送的有效负载中进行配置:
{
"aps": {
"alert": {
"title": "Custom title",
"subtitle": "Custom subtitle",
"body": "Custom message"
}
}
}
此外,您还可以创建 User NotificationServiceExtension 来更新已收到的通知的上述属性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)