【发布时间】:2018-02-24 12:12:36
【问题描述】:
我遵循了 firebase 文档中的说明:Authenticate Using OAuth Providers with Cordova,当尝试从 android 设备进行身份验证时,使用 firebase SDK 进行身份验证,我收到以下错误:redirect-cancelled-by-user。
尝试从 Web 进行身份验证,有效!
代码示例:
firebase.auth().signInWithRedirect(provider).then(function() {
return firebase.auth().getRedirectResult();
}).then(function(result) {
// This gives you a Google Access Token.
// You can use it to access the Google API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
});
我看到了几个替代解决方案,但我对使用 firebase SDK 很感兴趣,所以有人可以解释一下,我哪里出错了吗?
【问题讨论】:
-
确保您使用的是最新版本。在 4.9.1 中修复了通用链接检测问题:firebase.google.com/support/release-notes/js#4.9.1
标签: android cordova firebase firebase-authentication ionic3