Use only one JWT token per connection (#80)
This fixes #76 where you a TooManyProviderTokenUpdates if you send notifications to multiple topics over one connection. As Apple states here https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns#2943374 one connection shall use only one single JWT token which should be refreshed no more than once every 20 minutes and no less than once every 60 minutes.
This commit is contained in:
@@ -39,13 +39,6 @@ class TokenCredentialsTestCase(TestCase):
|
||||
self.expiring_header = self.expiring_creds.get_authorization_header(
|
||||
self.topics[0])
|
||||
|
||||
def test_create_multiple_topics(self):
|
||||
h1 = self.normal_creds.get_authorization_header(self.topics[0])
|
||||
self.assertEqual(len(self.normal_creds.get_tokens()), 1)
|
||||
h2 = self.normal_creds.get_authorization_header(self.topics[1])
|
||||
self.assertNotEqual(h1, h2)
|
||||
self.assertEqual(len(self.normal_creds.get_tokens()), 2)
|
||||
|
||||
def test_token_expiration(self):
|
||||
# As long as the token lifetime hasn't elapsed, this should work. To
|
||||
# be really careful, we should check how much time has elapsed to
|
||||
|
||||
Reference in New Issue
Block a user