Skip to content

Instantly share code, notes, and snippets.

@geeksilva97
Created February 18, 2020 15:33
Show Gist options
  • Select an option

  • Save geeksilva97/77b578aff018f2d0552ec987fd8c6f05 to your computer and use it in GitHub Desktop.

Select an option

Save geeksilva97/77b578aff018f2d0552ec987fd8c6f05 to your computer and use it in GitHub Desktop.
SignIn with Google
import { Component } from '@angular/core';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
userData: any = {};
constructor(
private googlePlus: GooglePlus
) {}
googleSignIn() {
this.googlePlus.login({})
.then(result => this.userData = result)
.catch(err => this.userData = `Error ${JSON.stringify(err)}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment