iOS sending push with APNs Auth Key: suddenly “403 Forbidden: {“reason”:”InvalidProviderToken”}”

we have exactly the same problem when sending pushes to different team ids using the same connection. The steps to reproduce are:

  • Open a connection to APNS and use the same connection to:

  • Send a token based push to topic com.companyA.xxx of team id 1234: APNS accepts and delivers the push successfully.

  • Send a token based push to topic io.companyB.xxx of team id 5678: APNS responds HTTP 400 BadRequest The device token does not match the specified topic
  • Send again a token based push to topic io.companyB.xxx of team id 5678: APNS responds HTTP 403 Forbidden: the provider token is not valid or the token signature could not be verified.

After this it becomes impossible to send any push and the connection has to be closed and reopened.

The workaround we ended up doing is to open one connection per team id. The APNS documentation does not mention anything like that so I do consider this as a bug and I opened a bug report.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)