Ionic push API - detecting unregistered token


#1

How can I detect an unregistered push token, i.e., a the event when a user has unregistered from push notifications? There are several reasons one might want to do this, e.g., APNS specifically says not to send notifications to unregistered devices; it would be useful to remove unused tokens from our backend; etc.

  1. The API doesn’t seem to provide any such info when attempting to send a notification to an unregistered token.
  2. Another way of going about this would be to query the push API endpoint for token status, but I can’t seem to find a way to acquire the token_id from the actual token (the only information provided by push.register() is the token, not token_id, whereas querying https://api.ionic.io/push/tokens only provides recent tokens and no way of getting token_id from any token).
  3. I noticed there was a webhook at some point, but not sure if that will be active going forward and how reliable it is.

Any help is appreciated.