evanshortiss / sns-mobile

Push notifications to Android, Kindle, and iOS devices easily using this module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Batch sending

santimacia opened this issue · comments

commented

How can I send a 1000 push different notification to a different users at the same time efficiently? For the same message I guess I can use the publish topic but if are different?

You can use the topic features of SNS, or do something like this:

function doSend (user, next) {
  // Assume user is a user entry from a db
  // Assume sns is a valid sns instance created earlier
  sns.sendMessage(user.endpointArn, 'Hi There!', next);
}

function done (err) {
  console.log('finsihed sending to all users');
}

async.each(userList, doSend, done);

@santimacia, since this does not appear to be an issue with the module I'll close this. Feel free to reopen if you think otherwise.