我想在twilio中的可编程聊天的推送提名中将标题显示为$ {USER_FRIENDLY_NAME},将正文显示为$ {MESSAGE}
我试图在twilio控制台的可编程聊天的“推送通知配置”模块中进行配置。
现在显示:
预期结果:
如果有人可以提供帮助,将不胜感激:)
最佳答案
您可以通过在Xcode项目中设置NotificationServiceExtension
和NotificationContent
来捕获推送通知的每个细节。如果您对这些内容一无所知,可以在丰富的推送通知中使用它们。
在您的UNNotificationServiceExtension
中,您可以在那里捕获数据并决定向用户显示什么。
func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void)
有用的网址:
https://www.raywenderlich.com/8164-push-notifications-tutorial-getting-started
https://www.pluralsight.com/guides/creating-ios-rich-push-notifications