我正在从 Amazon SNS 向 iOS 设备发送“推送通知”。在发送通知时,我想隐藏 url 并在通知中向用户显示剩余的字符串。
For Instance :
Notification is like this "Hi customers https://www.google.co.in/?gfe_rd=cr&ei=zCyeVbuiMZK_-APxlYHoBA welcome"
Show the notification to the user as "Hi customers welcome"
And i want to store the entire notification message in database.
If user clicks on notification then i have to open that link in embedded browser. But that url will not be visible to the user
是否可以在通知中隐藏消息的某些部分?预先感谢您的帮助。
最佳答案
来自 Apple Push Notification Service :
Providers can specify custom payload values outside the Apple-reserved aps namespace. Custom values must use the JSON structured and primitive types: dictionary (object), array, string, number, and Boolean. You should not include customer information (or any sensitive data) as custom payload data. [...]
文档中提供了一个示例:
{
"aps" : { "alert" : "Message received from Bob" },
"acme2" : [ "bang", "whiz" ]
}
在您的情况下,我建议使用这样的有效负载:
{
"aps" : { "alert" : "Welcome Customers!" },
"welcome-url" : "https://www.google.co.in/?gfe_rd=cr&ei=zCyeVbuiMZK_-APxlYHoBA"
}
关于ios - 是否可以在 iOS 通知中隐藏部分消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31311797/