1 | export interface TwitterConnectResponse {
|
2 | /**
|
3 | * Twitter Username
|
4 | */
|
5 | userName: string;
|
6 | /**
|
7 | * Twitter User ID
|
8 | */
|
9 | userId: string;
|
10 | /**
|
11 | * Twitter OAuth Secret
|
12 | */
|
13 | secret: string;
|
14 | /**
|
15 | * Twitter OAuth Token
|
16 | */
|
17 | token: string;
|
18 | }
|
19 | /**
|
20 | * @name Twitter Connect
|
21 | * @description
|
22 | * Plugin to use Twitter Single Sign On
|
23 | * Uses Twitter's Fabric SDK
|
24 | * ```typescript
|
25 | * import {TwitterConnect} from 'ionic-native';
|
26 | *
|
27 | * function onSuccess(response) {
|
28 | * console.log(response);
|
29 | *
|
30 | * // Will console log something like:
|
31 | * // {
|
32 | * // userName: 'myuser',
|
33 | * // userId: '12358102',
|
34 | * // secret: 'tokenSecret'
|
35 | * // token: 'accessTokenHere'
|
36 | * // }
|
37 | * }
|
38 | *
|
39 | * TwitterConnect.login().then(onSuccess, onError);
|
40 | *
|
41 | * TwitterConnect.logout().then(onLogoutSuccess, onLogoutError);
|
42 | * ```
|
43 | * @interfaces
|
44 | * TwitterConnectResponse
|
45 | */
|
46 | export declare class TwitterConnect {
|
47 | /**
|
48 | * Logs in
|
49 | * @returns {Promise<TwitterConnectResponse>} returns a promise that resolves if logged in and rejects if failed to login
|
50 | */
|
51 | static login(): Promise<TwitterConnectResponse>;
|
52 | /**
|
53 | * Logs out
|
54 | * @returns {Promise<any>} returns a promise that resolves if logged out and rejects if failed to logout
|
55 | */
|
56 | static logout(): Promise<any>;
|
57 | /**
|
58 | * Returns user's profile information
|
59 | * @returns {Promise<any>} returns a promise that resolves if user profile is successfully retrieved and rejects if request fails
|
60 | */
|
61 | static showUser(): Promise<any>;
|
62 | }
|