Amazon SNS Mobile Push - how to bulk subscribe endpoints to a topic?

user348398 picture user348398 · Jan 6, 2014 · Viewed 10.9k times · Source

I am trying to move my existing iOS push notification infrastructure over to amazon SNS mobile push.

I exported all my tokens from my local db into an SNS application (using CSV). Now I want to send push notification to all my 10,000 users. I think the only way is to create a topic and subscribe all the users to that topic then publish message to that topic.

Is there any easy way to subscribe all the 10,000 users who I have imported into the system to a topic?

Thanks for any help!

Answer

Rohan Deshpande picture Rohan Deshpande · Jan 16, 2014

It sounds like you have created the Amazon SNS Platform Application and imported your tokens as Amazon SNS Platform Endpoints.

What kind of notification are you sending?

  • If you send a custom message to each user, use Direct Addressing. With this approach, you Publish to each EndpointARN.

  • If you send the same message to all users, use topics. You need to subscribe your endpoints to a topic. When you are ready to send, Publish to the TopicARN. Amazon SNS will handle delivery to all endpoints subscribed to that topic. Amazon SNS currently does not provide a bulk subscribe API, so you will have to invoke Subscribe once per EndpointARN.

Full disclosure: I work for AWS on Amazon SNS.