问题:当通过第三方应用程序内置浏览器(如线条、Twitter或Facebook信使)使用时,signInWithPopup
会返回auth/popup-blocked
。Firebase docs的解释是:
触发这一错误的典型顺序是:我的web应用程序的链接被发送到LINE、Twitter或Facebook信使。当用户使用移动设备并在这些应用程序中打开该链接时,他们的内置浏览器将被打开。然后调用signInWithPopup
返回错误。在iOS和Android中,这种行为略有不同,但至少iOS/LINE组合会导致错误。
我正在使用角和建立一个网络应用程序。错误消息是Unable to establish a connection with the popup. It may have been blocked by the browser.
,它来自firebase.js
,而不是我自己的文本。
当在普通浏览器中使用时,注册工作正常。
你知道为什么内置浏览器和signInWithPopup
不一起工作吗?
发布于 2018-05-12 15:59:03
signInWithPopup()
是用于浏览器的,但是,如果您正在运行iOS或Andriod模拟器或设备,则需要调用signInWithCredential
。
signInWithFacebook() {
if (this.platform.is('cordova')) {
return this.fb.login(['email', 'public_profile']).then(res => {
const facebookCredential = firebase.auth.FacebookAuthProvider.credential(res.authResponse.accessToken);
return firebase.auth().signInWithCredential(facebookCredential);
})
}
else {
return this.afAuth.auth
.signInWithPopup(new firebase.auth.FacebookAuthProvider())
.then(res => console.log(res));
}
}
如果您正在使用Ionic + Firebase,您可以找到更多的信息这里
https://stackoverflow.com/questions/39898356
复制相似问题