olucurious / PyFCM

Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)
http://olucurious.github.io/PyFCM/
MIT License
802 stars 204 forks source link

fix: refresh access token #335

Closed Niccari closed 2 months ago

Niccari commented 2 months ago

fix: #334.

Supported access token refresh when it expires. According to the official documentation, access tokens expire in 30 minutes.

checks

$ export GOOGLE_APPLICATION_CREDENTIALS="service_account.json"
$ export FCM_TEST_PROJECT_ID=test
$ python -m pytest

============================================================================= test session starts ==============================================================================
platform darwin -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /Users/***/Desktop/PyFCM
plugins: mock-3.14.0
collected 4 items                                                                                                                                                              

tests/test_baseapi.py ..                                                                                                                                                 [ 50%]
tests/test_fcm.py ..                                                                                                                                                     [100%]

============================================================================== 4 passed in 0.01s ===============================================================================