Melody
Melody

Reputation: 1203

How to ignore inactive device while sending push notification using Amazon SNS?

I am trying to implement push notification using Amazon SNS. I have used the sample available in the below link. The application end points are created successfully and i can send notification fine. But how can we ignore inactive device tokens while sending notification? I mean some users may uninstall the app. But the device token was in our endpoint list. How can we ignore these endpoints? https://github.com/awslabs/aws-sdk-net-samples/tree/master/XamarinSamples/SNS/SNSPushNotification/SNSPushNotification.Droid

Upvotes: 1

Views: 260

Answers (1)

Naveen P
Naveen P

Reputation: 77

As per my understanding, there are two ways you can send a notification through Amazon SNS.

  • Create a topic, subscribe endpoints to the topic and send notification to the TopicARN
  • Create an endpoint and send notification to the EndpointARN directly

If you are following option-1, then you don't really know the disabled endpoints. In this case, you have to check if the endpoint is not disabled before subscribing to the topic and update the same in your local tables.

If you are following option-2, then you will get a direct exception (EndpointDisabled) when sending a message to EndpointARN. You can handle this exception and update your local tables.

Upvotes: 0

Related Questions