UNPKG

2.95 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Google Plus
11 * @description
12 * @usage
13 * ```typescript
14 * import { GooglePlus } from 'ionic-native';
15 *
16 * GooglePlus.login()
17 * .then(res => console.log(res))
18 * .catch(err => console.error(err));
19 *
20 * ```
21 */
22var GooglePlus = (function () {
23 function GooglePlus() {
24 }
25 /**
26 * The login function walks the user through the Google Auth process.
27 * @param options
28 * @returns {Promise<any>}
29 */
30 GooglePlus.login = function (options) { return; };
31 /**
32 * You can call trySilentLogin to check if they're already signed in to the app and sign them in silently if they are.
33 * @param options
34 * @returns {Promise<any>}
35 */
36 GooglePlus.trySilentLogin = function (options) { return; };
37 /**
38 * This will clear the OAuth2 token.
39 * @returns {Promise<any>}
40 */
41 GooglePlus.logout = function () { return; };
42 /**
43 * 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.
44 * @returns {Promise<any>}
45 */
46 GooglePlus.disconnect = function () { return; };
47 __decorate([
48 plugin_1.Cordova({
49 successIndex: 1,
50 errorIndex: 2
51 })
52 ], GooglePlus, "login", null);
53 __decorate([
54 plugin_1.Cordova()
55 ], GooglePlus, "trySilentLogin", null);
56 __decorate([
57 plugin_1.Cordova()
58 ], GooglePlus, "logout", null);
59 __decorate([
60 plugin_1.Cordova()
61 ], GooglePlus, "disconnect", null);
62 GooglePlus = __decorate([
63 plugin_1.Plugin({
64 pluginName: 'GooglePlus',
65 plugin: 'cordova-plugin-googleplus',
66 pluginRef: 'window.plugins.googleplus',
67 repo: 'https://github.com/EddyVerbruggen/cordova-plugin-googleplus',
68 platforms: ['Web', 'Android', 'iOS'],
69 install: 'ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid'
70 })
71 ], GooglePlus);
72 return GooglePlus;
73}());
74exports.GooglePlus = GooglePlus;
75//# sourceMappingURL=google-plus.js.map
\No newline at end of file