New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNS: Fetching the Token for confirmSubscription() #724
Comments
Hi @pree011235, The token will be provided in a message sent to the endpoint you're subscribing to an SNS channel. The endpoint will receive a POST message with a JSON payload containing, among other fields, a |
@pree011235 I'm marking this as closed as it is not an SDK issue. As @jeskew mentioned, the Feel free to reopen this issue or open another issue if you have other questions. |
I'm trying to do this same thing, using the sms protocol. I too was placing the confirmSubscription in the subscribe callback. @pree011235 in my case, when I call the subscribe, my test phone gets the SMS message and I have to reply YES in order to confirm the subscribe. From a coding standpoint, How do I confirm that phone subscribed? |
@aadamsx You can call |
Thank you @jeskew I'm going to use listSubscriptionsByTopic. But it only returns 100 subscriptions, requiring a NextToken in order to get more. Do you have any sudo-code that would help? This is what I came up with:
|
Hi @aadamsx, The callback passed to var sns = new AWS.SNS({region: 'us-west-2'})
var paginate = function (err, data) {
if (err) {
console.log(err);
} else {
// current page of data is available as 'data'
if (this.hasNextPage()) {
this.nextPage(paginate);
}
}
};
sns.listSubscriptions(paginate); |
Thank you, this is exactly the feedback I was looking for! I got things working, but without the nextToken. I was confused what to do about it, and you just clear it up for me! |
var nextToken = null; got the error ListSubscriptionsByTopic function not found |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Trying to do a seemingly simple confirm subscription but I keep hitting the Invalid Token 400 issue:
Where can I get the endpoint Token from, right after the subscribe (Tried to look up my
this
but that didn't have it either? Thanks!The text was updated successfully, but these errors were encountered: