Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 278
user348398 Avatar asked Jan 06 '14 21:01

user348398


1 Answers

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.

like image 70
Rohan Deshpande Avatar answered Nov 11 '22 08:11

Rohan Deshpande