【发布时间】:2018-05-29 21:34:25
【问题描述】:
我正在尝试使用 google 和 facebook 将 Firebase oauth 添加到我的项目中。
我添加到项目中的插件:
- cordova-plugin-browsertab 0.2.0 "cordova-plugin-browsertab"
- cordova-plugin-buildinfo 2.0.1 “BuildInfo”
- cordova-plugin-compat 1.2.0“兼容”
- cordova-plugin-inappbrowser 1.7.2“InAppBrowser”
- cordova-plugin-whitelist 1.3.3“白名单”
- cordova-universal-links-plugin 1.2.1“通用链接插件”
我现在使用 Android 6.2.3 作为我的平台,我正在考虑以后添加 iOS。
我的问题是,对于使用 firebase 服务的每个登录请求,我都会收到 auth/redirect-cancelled-by-user 作为响应。
我已按照官方教程中的说明进行操作。我添加了:
<universal-links>
<host name="URL" scheme="https" />
<host name="package name" scheme="https">
<path url="/__/auth/callback" />
</host>
</universal-links>
进入我的 config.xml 文件。
【问题讨论】:
-
确保将
authDomain替换为package_name。还要确保您的 FDL 域也添加到universal-links。如果您碰巧使用自定义authDomain,请确保使用该.firebaseapp.com而不是.firebaseapp.com。 -
我已经检查过了,我没有使用自定义 AuthDomain。
-
你的链接拦截明显有问题。尝试查看是否收到传入链接:
universalLinks.subscribe(null, function(event) {console.log(event.url);}); -
我已经试过了,没有日志,我不知道我是否把它放在正确的地方。我正在 onDeviceReady 的 index.js 中订阅
-
如果没有记录任何内容,那么您的重定向设置有问题。无法根据可用信息判断哪个部分。尝试使用该插件进行基本的网络到移动重定向。
标签: android cordova firebase oauth firebase-authentication