Forum Xamarin.Forms

Amazon AWS - Delete endpoint on Xamarin Forms

RianDutraRianDutra USMember ✭✭
edited April 2017 in Xamarin.Forms

I'm developing an app which uses Amazon SNS to receive push notifications.

Amazon SNS works with token for each user.
However, everytime user opens/closes the app, it gets a new token. Thus, users don't have always the same token.

My issue is, when user opens the app, it registers his token to the Amazon SNS. So, if user opens 10 times, app will register 10 token for that user.

The Amazon sample is:

I know how to delete an endpoint (token) doing this:

var test = await SnsClient.DeleteEndpointAsync(new DeleteEndpointRequest {
   EndpointArn = "mytokenstring123123"

However, when user opens the app, I do not have the previous arn anymore. So, I can't delete it because I don't know the token string. And I can't do it when user closes the app because he still has to receive push notifications.

Any ideia how to handle that?

Sign In or Register to comment.