user3563654
user3563654

Reputation: 21

How to stop sending notification if Device Subscription Expired - GCM PushSharp

I would like to know how can I stop sending notification to the Expired Device Subscription IDs? In my database I have Expired Device Token and at this moment I have no way to remove them. Currently my users are receiving duplicate notifications. I need to know which part of GcmPushChannel.cs required to modify to achieve above task? OR How can I validate Device Token without sending a notification, just making a call to GCM via PushSharp?

Upvotes: 2

Views: 1717

Answers (1)

John
John

Reputation: 1296

In your PushBroker, just handle the OnDeviceSubscriptionExpired event. That will fire after sending the 2nd (and subsequent) notification to the expired device token. In your handler, just remove that device token from your database so that you don't attempt any more notifications to it.

Upvotes: 4

Related Questions