是否可以在 iOS 通知中隐藏部分消息?

Is it possible to hide some part of message in iOS Notification?

我正在从 Amazon SNS 发送 "Push Notification" 到 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"
}