Created
February 18, 2020 15:33
-
-
Save geeksilva97/77b578aff018f2d0552ec987fd8c6f05 to your computer and use it in GitHub Desktop.
SignIn with Google
This file contains hidden or 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 { 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