Multiple providers on a single HTTP/2 connection

Hi!


I'm setting up a service that sends push notifications to three different apps, using the token based authentication over HTTP/2.


My initial approach was to use a single connection for all app providers, caching each JWT during an hour, and then recreating it. So every call to my service would contain an identifier for the app that is expected to receive the notification, get its JWT from the cached dictionnary (or recreating it if it's not present), and do the request to APNS.


With one app enabled, worked well, but when I added a second one, I started receiving 403, "reason":"InvalidProviderToken" for both apps (the one that previously worked and the recently added). I did tests and the JWT are correctly cached and retreived for each app, so my question is if APNS expects to receive calls always for the same provider on a connection, and if I want to support multiple providers I should use different connections?

Answered by pnikosis in 212859022

OK, I did some additional tests. It seems I have to stick with one provider per HTTP/2 connection, so I should create a pool of connections, each one with its own JWT manager.

Accepted Answer

OK, I did some additional tests. It seems I have to stick with one provider per HTTP/2 connection, so I should create a pool of connections, each one with its own JWT manager.

Multiple providers on a single HTTP/2 connection
 
 
Q