I understand that it is possible to set the badge counter when publishing to individual devices, but is it possible to set a device independent counter when publishing to ALL devices subscribed to a certain topic ARN?
Current use case is there could be up to a million users subscribed to a certain topic and having to publish push notifications to each device ARN one by one (opposed to a topic ARN) seems really inefficient, from a server-side standpoint.
Backend: Python Flask framework with BOTO AWS SDK and SQLAlchemy
Frontend: iOS
No, you can't.
Apple dont let you send "+1" as badge number, so sending the same badge number to all users that are subscribed to a specific topic should not help you.
AWS SNS let you make custom payloads per platform on the same topic, so it should not be a problem:
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 don't let you increment the badge number, so I guess sending the same badge number to all users would not be help you.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With