10

I have successfully implemented HTML5 Push Notifications for my site, for news updates and user events. If an endpoint is no longer valid (for whatever reason, but generally because a user revoked permission in their browser) I get a 404 or 410 status from the push server when I try to send a notification. Then I remove that endpoint from my records.

But what I would like is to be a little more proactive and check if an endpoint is valid, so my stats of subscribed users are more realistic and are not updated only when a notification fails to send (which could take days or weeks).

I thought of sending an invalid push message (for example with the wrong VAPID keys) but I don't have the guarantee that a server would check the validity of the endpoint before the validity of the payload, so even if this worked it could break in any moment.

Is there any more elegant way that I could do this?

MM.
  • 2,653
  • 4
  • 26
  • 36
  • 2
    No, there's no way to achieve that at the moment. As you said, you know that an endpoint is invalid only when you send an actual message to it. – collimarco Jan 16 '18 at 12:38
  • 2
    Is this still the case? Is there a way to atleast identify the source that is sending the endpoint information to my backend system? – Aparna Mar 05 '19 at 06:17
  • And how would you check if push endpoint was valid to begin with? What if someone decided to forge a url and send it to your backend server wher eyou store those endpoints. – astralmaster Feb 26 '20 at 17:51

0 Answers0