Home > Net >  How do I migrate my legacy FCM HTTP requests to HTTP V1?
How do I migrate my legacy FCM HTTP requests to HTTP V1?

Time:02-10

I received an email from Google informing me that I need to migrate my Android app that uses FCM for client-to-client communication by early May 2022 to the more secure V1 protocol, along with a link to instructions. Following the link, I modified my server endpoint but am not sure where to get the authorization token:

        final String serverKey = "Authorization: Bearer <valid Oauth 2.0 token>";

The docs () go on to say the following:

Depending on the details of your server environment, use a combination of these strategies to authorize server requests to Firebase services:

Google Application Default Credentials (ADC)
A service account JSON file
A short-lived OAuth 2.0 access token derived from a service account

At first glance, it looked like I needed to authenticate via ADC, but after more reading, it seems that ADC is used if I have my own code running on a Google server. I don't; I'm just pushing notifications to the user. So how should I proceed?

CodePudding user response:

  •  Tags:  
  • Related