I currently use the endpoint
https://iid.googleapis.com/iid/info/{TOKEN}?details=true,
to return topics related to the token.
In the header I send the Authorization - key=CHAVE
But this authentication was discontinued by Google, and now according to their documentation, we have to pass OAuth2.
I followed the example:
https://firebase.google.com/docs/cloud-messaging/auth-server?hl=pt-br#provide-credentials-manuallyand using GoogleCredentials I get the AccessToken and pass it in the request, as per the example:
URL url = new URL(BASE_URL + FCM_SEND_ENDPOINT);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestProperty("Authorization", "Bearer " + getAccessToken());
httpURLConnection.setRequestProperty("Content-Type", "application/json; UTF-8");
return httpURLConnection;
But even after passing this new authentication, I'm getting the following error message:
error='Authentication using server key is deprecated. Please use an OAuth2 token instead.'
Is anyone able to use this endpoint?
Thanks,
Rafael