首页 > 解决方案 > 离子谷歌登录按钮不提示弹出登录

问题描述

所以我正在开发一个按钮,用户可以使用他们的谷歌账户登录他们的账户。

该按钮在ionic serve. 完全能够使用我的 Google 帐户登录我的帐户。然而,在我的 iPhone 上,这个按钮什么也没做。

没有看到其他人有类似问题的文章。也许我忘了在 iPhone 上添加应用权限?

HTML

<button class="google-div" (click)="auth.googleSignIn()">
    <img class="google" src="../../assets/images/googleLogInLight.png">
</button>

身份验证服务 .TS

googleSignIn() {
  const provider = new firebase.auth.GoogleAuthProvider();
  return this.oAuthLogin(provider);
}
private async oAuthLogin(provider) {
  const credential = await this.afAuth.signInWithPopup(provider);
  return this.updateUserData(credential.user);
}

private updateUserData({ uid, email, displayName, photoURL }) {
  const userRef: AngularFirestoreDocument<any> = this.afs.doc(`users/${uid}`);
  const data = {
    uid,
    email,
    displayName,
    photoURL
  };

  email_out.setEmail(email);
  email_out.setid(uid)
  this.router.navigate(['/tabs']);
  return userRef.set(data, { merge: true });
}

XCode 中的错误

⚡️  To Native ->  App addListener 79051384
⚡️  [error] - ERROR Error: Uncaught (in promise): Error: This operation 
is not supported in the environment this application is running on. 
"location.protocol" must be http, https or chrome-extension and web 
storage must be enabled.

我也使用 FireStore 作为我的身份验证。

我还可以使用我的 Google 帐户登录 iPhone 上的其他应用程序。

标签: iosionic-frameworkgoogle-cloud-firestoregoogle-signincapacitor

解决方案


推荐阅读