gpt4 book ai didi

iOS 通过 AWS SNS 推送通知

转载 作者:行者123 更新时间:2023-12-01 20:05:28 24 4
gpt4 key购买 nike

iOS 通过 AWS SNS 推送通知。负载在 iOS 设备通知面板中显示,而不是消息。

例如:

{
"default": "Sample message",
"APNS": {
"aps": {
"alert": {
"body": "You have new message",
"title": "Sample message"
}
}
}
}

最佳答案

问题是您将 aps 保留在 APNS 中。

根据苹果文档,有效载荷应该是这样的,

{
"aps" : {
"alert" : {
"title" : "Game Request",
"body" : "Bob wants to play poker",
"action-loc-key" : "PLAY"
},
"badge" : 5
},
"acme1" : "bar",
"acme2" : [ "bang", "whiz" ]
}

注意:“aps”应该直接在键中可用,你不应该将它包含在其他值中。

文档:https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW1 ),

关于iOS 通过 AWS SNS 推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39037496/

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