gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 01:51:49 24 4
gpt4 key购买 nike

我正在从 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com