Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48979

"Something went wrong" Google sign in android

$
0
0

I’m trying to implement Google sign in my app:

import { Component, OnInit } from '@angular/core';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss'],
})
export class LoginComponent implements OnInit {
  constructor() {}

  ngOnInit() {}

  // ionViewDidEnter() {
  //   GoogleAuth.init();
  // }

  async doLogin() {
    const user = await GoogleAuth.signIn();
    if (user) {
      console.log('user', user);
    } else{
      console.log('no user');
    }
  }
}

Works fine on ios but on android I was getting an error of googleauth.init() is not implemented on android ionic So I commented out the GoogleAuth.init() part and now I’m getting an error of Something went wrong. Very insightful error message I must say.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48979

Trending Articles