gpt4 book ai didi

ios - 发布到主题时 Apple 推送通知的 Amazon SNS 更新角标(Badge)计数器

转载 作者:可可西里 更新时间:2023-11-01 03:31:38 26 4
gpt4 key购买 nike

我知道在发布到单个设备时可以设置角标(Badge)计数器,但是在发布到订阅了特定主题 ARN 的所有 设备时是否可以设置独立于设备的计数器?

当前的用例是,可能有多达一百万的用户订阅了某个主题,并且必须将推送通知一个一个地发布到每个设备 ARN(与主题 ARN 相对),从服务器端的角度来看,这似乎效率很低.

使用的框架

后端:Python 带有 BOTO AWS SDK 和 SQLAlchemy 的 Flask 框架

前端:iOS

最佳答案

简答

不,你不能。

Apple 不允许您发送“+1”作为角标(Badge)编号,因此向订阅特定主题的所有用户发送相同的角标(Badge)编号应该对您没有帮助。

长答案

亚马逊社交网站

AWS SNS 允许您针对同一主题为每个平台制作自定义负载,因此这应该不是问题:

To send a message to an app installed on devices for multiple platforms, such as GCM and APNS, you must first subscribe the mobile endpoints to a topic in Amazon SNS and then publish the message to the topic. The following example shows a message to send to subscribed mobile endpoints on APNS, GCM, and ADM

http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html#mobile-push-send-multiplatform

{ 
"default": "This is the default message which must be present when publishing a message to a topic. The default message will only be used if a message is not present for
one of the notification platforms.",
"APNS": "{\"aps\":{\"alert\": \"Check out these awesome deals!\",\"url\":\"www.amazon.com\"} }",
"GCM":"{\"data\":{\"message\":\"Check out these awesome deals!\",\"url\":\"www.amazon.com\"}}",
"ADM": "{ \"data\": { \"message\": \"Check out these awesome deals!\",\"url\":\"www.amazon.com\" }}"
}

苹果

Apple 不允许您增加角标(Badge)编号,所以我想向所有用户发送相同的角标(Badge)编号对您没有帮助。

Key: Badge

Type: Number

Description: The number to display as the badge of the app icon. If this property is absent, the badge is not changed. To remove the badge, set the value of this property to 0.

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html

关于ios - 发布到主题时 Apple 推送通知的 Amazon SNS 更新角标(Badge)计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31912153/

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