有没有办法Firebase 身份验证 https://firebase.google.com/docs/auth/?gclid=EAIaIQobChMIhKuIo_zV4wIVhRx9Ch1VwAh7EAAYASAAEgLRrvD_BwE在开源应用程序中工作,无需SHA-1
key?
我已经开源了安卓代码 https://github.com/AdamSHurwitz/Coinverse for 币逆 https://play.google.com/store/apps/details?id=app.coinverse,第一个用于移动音频广播的加密货币新闻应用程序,旨在分享 Android 最佳实践和架构。目标是让开发人员从 Android Studio 运行反编译的应用程序并登录。
我已经对 Firestore 数据库、存储、YouTube API 等执行了以下操作,以便开发人员从 GitHub 下载项目时能够按预期工作:
- New 开源Firebase 项目
- 新的 API 密钥
- Firestore数据库预算限额 https://firebase.google.com/docs/firestore/quotas#manage_spending
- Firestore安全火库 https://firebase.google.com/docs/firestore/security/get-started and Storage https://firebase.google.com/docs/storage/security/start rules
共享和私有 Firebase 实例
Strategy- 创建两个开源 sharedFirebase 实例提供对共享数据和 Cloud Functions 的访问,并让下载 GitHub 项目的开发人员创建自己的实例private用于身份验证的 Firebase 实例通过以下方式用作默认实例谷歌服务.json file.
Pro-tip- 一定要确定一个独特的SHA-1
key 与每个需要它的 Firebase 项目,否则会出现身份验证错误此处概述 https://stackoverflow.com/questions/57281788/firebaseuiexception-code-10-initializing-multiple-projects/57281818#57281818.
共享 Firebase 项目
- 初始化共享开源Firebase 项目与在您的应用程序中使用多个项目 https://firebase.google.com/docs/projects/multiprojects#use_multiple_projects_in_your_application程序化实施(与非共享项目分开的项目)staging and 生产用于发布的项目)。 -
FirebaseApp.getInstance("openSourceProject")
Note: setProjectId(...)
还需要设置为FirebaseOptions
尽管上面的链接中没有提及以及所使用的服务(例如存储)的任何其他设置器。
- 使用共享 Firestore 项目中的公共内容和价格数据填充应用程序 -
FirebaseFirestore.getInstance(FirebaseApp.getInstance("openSourceProject"))
- 使用共享的 Cloud Functions 和 Firebase Storage 来创建.mp3存储中的文件.txt文件和访问.mp3s来自存储。 -
FirebaseStorage.getInstance(FirebaseApp.getInstance("openSourceProject"))
and FirebaseFunctions.getInstance(FirebaseApp.getInstance("openSourceProject"))
用户的私人 Firebase 项目
- 通过以下方式初始化为默认 Firebase 项目实例谷歌服务.json file.
- 用于与他们进行身份验证
SHA-1
key
- 将登录的用户数据保存到其 Firestore 实例 -
FirebaseFirestore.getInstance()
- 创建 Firebase 令牌删除用户功能 https://github.com/firebase/snippets-node/tree/master/firestore/solution-deletes#setup
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)