"Similarly, APNs reports an error if you recreate your tokens more than once every 20 minutes". What is mean ? "reports an error"

I migrate apns to jwt token. On this page written
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns.

Similarly, APNs reports an error if you recreate your tokens more than once every 20 minutes.

I check this case, i recreate new jwt, and encrypt, and send message with this encrypted token, on production url, then I repeat this several times. But where i can see this.

APNs reports an error

If i am...

recreate your tokens more than once every 20 minutes.

It'is can be blocked push after some time, or i just give report ?




Answered by Engineer in 666258022
If you change your token too often, you will get an status 429 response with error string 'TooManyProviderTokenUpdates'
At that point, that connection will be unusable until enough time has past so you can create a new token without triggering the same issue.



Accepted Answer
If you change your token too often, you will get an status 429 response with error string 'TooManyProviderTokenUpdates'
At that point, that connection will be unusable until enough time has past so you can create a new token without triggering the same issue.



This is only for Production url or Development url too ?
This is for both environments. You would want to confirm your token generation algorithms against the development environment before going to production.

Important clarification: How is the token refresh policy applied in a clustered environment, with multiple hosts generating their own JWT tokens with the same key? (The documentation does state "You can use the same token from multiple provider servers," but it's unclear what happens when those multiple servers have to refresh the token.)

In other words, let's suppose you have two provider servers posting to APNS. Can each of those hosts generate their own JWT token (such that each server will have its own refresh frequency, f, such that 20 min < f < 60 min, starting at different times t1 and t2, such that t1 <> t2, |t2-t1| < 20 min) without throwing the TooManyProviderTokenUpdates exception? Or would one host need to be aware of the token refresh on the other host, to avoid regeneration within 20 minutes? Above, there is a mention of connection becoming unusable, so is the JWT refresh policy applied per connection, per host, or per organization/key (i.e. single token across all providers) on the APNS side? To build a centralized token refresh management service is not trivial (due to race conditions, single-point-of-failure, etc.), so we are trying to avoid that at all costs.

Finally, we ran a few tests in against development APNS such that we regenerated the token for each request. We did not get any exceptions. Does the validation for the token age behave differently in development and/or is it somehow adaptive whereby the validation kicks in after n occurrences?

(There are multiple questions related to this across different forums, including this one; and I think this thread is closed to answer this question. Thank you!)

We are also looking for clarification on this. We have 10 servers in different geographic locations. Is the refresh per connection?

"Similarly, APNs reports an error if you recreate your tokens more than once every 20 minutes". What is mean ? "reports an error"
 
 
Q