From d57a2dc29bf517e365bdb1138119e843bbcb2328 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Thu, 9 Jun 2016 10:27:07 -0400 Subject: [PATCH] add GooglePlus plugin, closes #183 --- src/index.ts | 3 +++ src/plugins/google-plus.ts | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/plugins/google-plus.ts diff --git a/src/index.ts b/src/index.ts index 37fb72b80..da7efec49 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,6 +38,7 @@ import {Transfer} from './plugins/filetransfer'; import {Flashlight} from './plugins/flashlight'; import {Geolocation} from './plugins/geolocation'; import {Globalization} from './plugins/globalization'; +import {GooglePlus} from './plugins/google-plus'; import {GoogleMap} from './plugins/googlemaps'; import {GoogleAnalytics} from './plugins/googleanalytics'; import {Hotspot} from './plugins/hotspot'; @@ -97,6 +98,7 @@ export { Flashlight, Geolocation, Globalization, + GooglePlus, GoogleAnalytics, Hotspot, ImagePicker, @@ -159,6 +161,7 @@ window['IonicNative'] = { Flashlight: Flashlight, Geolocation: Geolocation, Globalization: Globalization, + GooglePlus: GooglePlus, GoogleMap : GoogleMap, GoogleAnalytics: GoogleAnalytics, Hotspot: Hotspot, diff --git a/src/plugins/google-plus.ts b/src/plugins/google-plus.ts new file mode 100644 index 000000000..924b1a1f7 --- /dev/null +++ b/src/plugins/google-plus.ts @@ -0,0 +1,46 @@ +import {Plugin, Cordova} from './plugin'; + +/** + * @name Google Plus + * @description + * @usage + * ``` + * + * ``` + */ +@Plugin({ + plugin: 'cordova-plugin-googleplus', + pluginRef: 'window.plugins.googleplus', + repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus', + platforms: ['Web','Android','iOS'], + install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid' +}) +export class GooglePlus { + + /** + * The login function walks the user through the Google Auth process. + * @param options + */ + @Cordova() + static login(options?: any): Promise {return; } + + /** + * You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are. + * @param options + */ + @Cordova() + static trySilentLogin(options?: any): Promise {return; } + + /** + * This will clear the OAuth2 token. + */ + @Cordova() + static logout(): Promise {return; } + + /** + * 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. + */ + @Cordova() + static disconnect(): Promise {return; } + +} \ No newline at end of file