在Firebase项目中集成gmail连接 [英] Integrating gmail connection in Firebase project

查看:147
本文介绍了在Firebase项目中集成gmail连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个使用gmail api的应用程序来获取用户的所有邮件。然后,我将这个应用程序分成了一个样本(几乎是空的)和一个完成所有事情的片段,所以我可以稍后将我的片段轻松地集成到我们团队的项目设置中。


$ b 现在我的片段是在另一个项目,gmail connexion不起作用,并给我这些错误:

$ pre $ E c / c异步任务: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
E / Google登录:失败

我觉得这个错误是因为这个项目使用了firebase,并且已经有一个google-services.json文件,我的这个文件没有被使用。
我们在google developper门户中添加了GMail API,并生成了一个新的json文件,但似乎没有成功。



为什么我的GMail连接失败如何解决这个问题?

解决方案

好吧,我设法让它工作。 b $ b

看起来像我在API管理器Google控制台中创建凭证密钥时,它不会在Firebase中项目的所有应用中添加SHA1密钥。



所有我必须做的(经过一个星期的努力)是从应用程序链接到另一个应用程序中的Google API控制台复制粘贴SHA1

我希望它可以帮助

I developped an application that uses gmail api to get all the mails from 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.

Now that my fragment is in the other project, the gmail connexion doesn't work and gives me these errors :

E/Async Task: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
E/Google log in: failed

I think this error is because the project uses firebase and already have a google-services.json file and mine isn't used. We added the GMail API in the google developper portal and generated a new json file but it doesn't seem to work.

Why does my GMail connexion fails and how can I solve it ?

解决方案

Ok, I managed to get it working.

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

这篇关于在Firebase项目中集成gmail连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆