I am currently working on a project that involves subscribing a set of device tokens to specific topics using Firebase Cloud Messaging (FCM). However, during the implementation, I encountered the following error:
Error:
From my understanding, FCM has deprecated the use of the server key for authentication in topic subscriptions, and now it requires using an OAuth2 token. My current implementation includes a service account JSON file to fetch an OAuth2 access token. Below is the method I am using to subscribe the tokens to a topic:
Despite this, I am still receiving the error. Could you kindly advise on any changes or updates I should make to resolve this issue? I would greatly appreciate your guidance on how to properly authenticate using the OAuth2 token with FCM.
Thank you in advance for your assistance.