问题
I have tried to integrate Gmail Api in my android app using the follwing tutorial https://developers.google.com/gmail/api/quickstart/android#step_5_setup_the_sample
I followed every steps , but when i tried to test gmail api
The following error occurred:
403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "Access Not Configured. Gmail API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/gmail/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason" : "accessNotConfigured",
"extendedHelp" : "https://console.developers.google.com/apis/api/gmail/overview?project=608941808256"
} ],
"message" : "Access Not Configured. Gmail API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/gmail/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
I have enabled Gmail Api and Google plus Api too . still the problem exist
Edit : My developer console page
回答1:
I think i found what mistake i have made , The SHA1 KEY I provided in the developer console is the signed version of my app , which is not placed in play store yet I changed the SHA1 Key to debug version of the app and it worked
回答2:
I registered the SHA1 key for the androiddebug (debug.keystore) and the key for the signed-release version (your own keystore) creating two OAuth 2.0 client IDs. This allowed me to test my app. Remember that sometimes the changes take a few hours to be reflected.
来源:https://stackoverflow.com/questions/37136085/how-to-integrate-gmail-api-in-android-app