Trying to implement Firebase Cloud Messaging API (V1) as Cloud Messaging API (Legacy) is getting depreciated from 20/06/2024, I’m trying to generate API key for the new API v1, but there seems to be no way around it. The attached screenshot is my firebase console. It said there is no option to generate an API key.
if not FCM, is there any other platform which can help me deploy push notifications.
2
Answers
The versioned API of Firebase Cloud Messaging no longer allows using just an API key for authorization. From the documentation on upgrading to the v1 API, specifically the section on updating the authorization of send requests:
So you’ll have to instead create an OAuth token and pass that with the call.
Also see the documentation on authorizing send requests in the v1 API.
There is no API key in v1. You can generate a .json with the credentials of a service account, a OAuth token (with refresh token too) or use Google’s ADC.
I implemented with the JSON file and no problems with that.