How to retrieve response from push service to know if a token is still valid?


#1

When I do a POST request to the management API to notify a specific device with a wrong or oudated token, how can I get the response from the push service (for example, APNS or Firebase) telling me the token is not valid ?

Because for now, when doing a POST request to the management API, as long as the installation id is in the right format, I get the response from the management API that it is OK even though the id is false.

Thanks in advance for any clarification,


#2

Hi Victor,

Whenever you use our API to send a notification, a validation takes place, you get a 202 Accepted response immediately, and the actual processing happens asynchronously.
WonderPush automatically invalidates push tokens that are returned as invalid by the push provider after an attempted delivery.
Subsequent deliveries are hence not attempted and do not count towards your quota.

Thus you can simply continue sending notifications without ever worrying about invalidated tokens.

If you want to know which installations are being invalidated, you can scan your user base using the GET /v1/installations end-point, possibly filtering using the updateDateFrom parameter.

Best.


#3

Thanks for the answer !