1.

How to integrate Google login in an Ionic app?

Answer»

One of the ways to integrate google login in an IONIC app is by using Cordova and Ionic Native plugins. 

Run following two commands to install the plugins 

ionic cordova plugin add cordova-plugin-googleplus --variable  REVERSED_CLIENT_ID=yourreversedclientid  npm install --save @ionic-native/google-plus

Add google-plus plugin to your app.module.ts file as below 

import { GooglePlus } from '@ionic-native/google-plus';  Add GooglePlus in providers LIST in app.module.ts.  Import GooglePlus plugin and make it AVAILABLE in your component's constructor  import { GooglePlus } from '@ionic-native/google-plus';  constructor( PRIVATE googlePlus: GooglePlus) {  } SAMPLE Code  this.googlePlus.login({})  .then(res => console.log(res))  .catch(err => console.error(err));


Discussion

No Comment Found