Last active
July 26, 2021 17:51
-
-
Save enappd/7231aed9f42b609ca6a76a666fdbf2ff to your computer and use it in GitHub Desktop.
Ionic Angular Capacitor Google Login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) | |
export class HomePage { | |
constructor() { } | |
ionViewDidEnter() { | |
GoogleAuth.init(); | |
} | |
async doLogin() { | |
const user = await GoogleAuth.signIn(); | |
if (user) { this.goToHome(user); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment