Having a similar issue. Each server refreshes the token every 50 minutes. We also tend to send a burst of like 10 notifications in parallel tasks (on one of the servers). It'll work fine for some amount of time until we randomly get back an InvalidProviderToken response for each parallel job. Or at least it seems to be spurious. It could be the result of us pushing updates to the servers, which causes the server process to restart and a new token to be generated outside of the usual schedule. In any case, in response to InvalidProviderToken, the affected server will invalidate the current token, wait for the next attempt to send a push notification, and regenerate a token before sending that batch.
It seems like this doesn't solve the problem. The next batch also often gets InvalidProviderToken.
At this point, we don't know how to proceed. Having just regenerated a token, the documentation implies that we shouldn't generate a new one. As such, we wait a couple of minutes before regenerating a new one, using the bad token in the mean time.
Nevertheless, we still end up getting the 429 occasionally, too.
What's the right algorithm for responding to these error codes???
Topic:
App & System Services
SubTopic:
Notifications
Tags: