Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Ionic中的Google(Firebase)身份验证_Ios_Firebase Authentication_Ionic3 - Fatal编程技术网

Ios Ionic中的Google(Firebase)身份验证

Ios Ionic中的Google(Firebase)身份验证,ios,firebase-authentication,ionic3,Ios,Firebase Authentication,Ionic3,我已经创建了一个带有Firebase集成的Ionic应用程序。我正在使用Google身份验证登录Firebase并检索用户的朋友等信息 public signInWithPopup() { const provider = new firebase.auth.GoogleAuthProvider(); firebase.auth().signInWithPopup(provider).then((result) => { // code }) } 使用“ionic ser

我已经创建了一个带有Firebase集成的Ionic应用程序。我正在使用Google身份验证登录Firebase并检索用户的朋友等信息

public signInWithPopup() {
    const provider = new firebase.auth.GoogleAuthProvider();
    firebase.auth().signInWithPopup(provider).then((result) => { // code })
}
使用“ionic serve”在浏览器中进行测试时,此功能非常有效。登录方法打开一个弹出窗口,我输入我的谷歌凭证,我按下“登录”,弹出窗口关闭,我在我的应用程序中登录

当我将应用程序部署到我的iOS设备(ionic cordova run iOS)时,会打开相同的弹出窗口(在iOS safari中),我仍然可以输入我的凭据,但当我按“登录”时,Google会显示一个错误页面:“400。这是一个错误。在此服务器上找不到请求的URL。这就是我们所知道的。”

这里发生了什么,我做错了什么


我猜这可能与它在我的笔记本电脑上测试时试图重定向到应用程序(可能是我浏览器中的url)有关,但我的Ionic应用程序中没有这样的东西,因为它是一个应用程序而不是网页?

您是否遵循Firebase网站上的文档,并为iOS正确配置了所有内容?对于Ionic/Cordova,应使用signInWithRedirect。查看文档以了解有关此方面的更多信息: