Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Google Plus

Improve this doc

Repo: https://github.com/EddyVerbruggen/cordova-plugin-googleplus

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid
    $ npm install --save @ionic-native/google-plus@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { GooglePlus } from '@ionic-native/google-plus';

constructor(private googlePlus: GooglePlus) { }

...

this.googlePlus.login({})
  .then(res => console.log(res))
  .catch(err => console.error(err));

Instance Members

login(options)

The login function walks the user through the Google Auth process.

Param Type Details
options

Returns: Promise<any>

trySilentLogin(options)

You can call trySilentLogin to check if they’re already signed in to the app and sign them in silently if they are.

Param Type Details
options

Returns: Promise<any>

logout()

This will clear the OAuth2 token.

Returns: Promise<any>

disconnect()

This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.

Returns: Promise<any>

getSigningCertificateFingerprint()

This will retrieve the Android signing certificate fingerprint which is required in the Google Developer Console.

Returns: Promise<any>

API

Native

General