2

I developped an application that uses gmail api to get all the mails sent by the user. Then I divided this app in a sample (almost empty) and a fragment that does everything, so I can later integrate my fragment easily in my team's project's settings.

This project uses firebase so I'm following this tutorial to connect to Gmail from this project just with my fragment. I developped my fragment with the Gmail Quickstart so I have a GoogleAccountCredential but when I try to use the GoogleAccountCredential.getToken method, i have the following error :

[GetToken] GetToken failed with status code: UNREGISTERED_ON_API_CONSOLE

I've created new credentials from the Google API console with the right package name.

What did I do wrong ?

Diiscord
  • 101
  • 1
  • 7

2 Answers2

1

I answered this in my other post here

Looks like when I create credentials keys in the API manager Google console, it doesn't add the SHA1 keys in all the apps of the project in Firebase.

All I had to do (after a week of hard work) was to copy paste the SHA1 from tha app "linked" to the Google API console in the other app

I hope it can help

Diiscord
  • 101
  • 1
  • 7
  • This put me on the right track. I was having some massive problem signing in my app with Google Play Games account (especially for new installs). After reading this I've started to look everywhere for SHA1 entries (Firebase and Google Play Console/Google Games Services). It turned out that the different SHA1 key was used in the GP Console/Google Games Services/Configuration of the game. Life saver! – Eric Feb 12 '21 at 09:24
0

This issue could be related to wrong sha1 signed certificate, wrong app package name, and missing client ID. You may try to double check the client ID and package name details in your manifest and gradle files.

You may also refer to these links 1 and 2 for more details on how to resolve your error.

abielita
  • 13,147
  • 2
  • 17
  • 59