mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
parent
5807dd7f09
commit
979838f4b7
@ -72,6 +72,7 @@ import {StatusBar} from './plugins/statusbar';
|
||||
import {ThreeDeeTouch} from './plugins/3dtouch';
|
||||
import {Toast} from './plugins/toast';
|
||||
import {TouchID} from './plugins/touchid';
|
||||
import {TwitterConnect} from './plugins/twitter-connect';
|
||||
import {Vibration} from './plugins/vibration';
|
||||
import {WebIntent} from './plugins/webintent';
|
||||
export * from './plugins/3dtouch';
|
||||
@ -145,6 +146,7 @@ export {
|
||||
StatusBar,
|
||||
TouchID,
|
||||
Transfer,
|
||||
TwitterConnect,
|
||||
Vibration,
|
||||
WebIntent
|
||||
}
|
||||
@ -220,6 +222,7 @@ window['IonicNative'] = {
|
||||
Toast: Toast,
|
||||
TouchID: TouchID,
|
||||
Transfer: Transfer,
|
||||
TwitterConnect: TwitterConnect,
|
||||
Vibration: Vibration,
|
||||
WebIntent: WebIntent
|
||||
};
|
||||
|
45
src/plugins/twitter-connect.ts
Normal file
45
src/plugins/twitter-connect.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
/**
|
||||
* @name Twitter Connect
|
||||
* @description
|
||||
* Plugin to use Twitter Single Sign On
|
||||
* Uses Twitter's Fabric SDK
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'twitter-connect-plugin',
|
||||
pluginRef: 'TwitterConnect',
|
||||
repo: '',
|
||||
install: 'ionic plugin add twitter-connect-plugin --variable FABRIC_KEY=<Fabric API Key>'
|
||||
})
|
||||
export class TwitterConnect {
|
||||
/**
|
||||
* Logs in
|
||||
* @return {Promise<TwitterConnectResponse>} returns a promise that resolves if logged in and rejects if failed to login
|
||||
*/
|
||||
@Cordova()
|
||||
static login(): Promise<TwitterConnectResponse> {return; }
|
||||
/**
|
||||
* Logs out
|
||||
* @return {Promise<any>} returns a promise that resolves if logged out and rejects if failed to logout
|
||||
*/
|
||||
@Cordova()
|
||||
static logout(): Promise<any> {return; }
|
||||
}
|
||||
export interface TwitterConnectResponse {
|
||||
/**
|
||||
* Twitter Username
|
||||
*/
|
||||
userName: string;
|
||||
/**
|
||||
* Twitter User ID
|
||||
*/
|
||||
userId: string;
|
||||
/**
|
||||
* Twitter OAuth Secret
|
||||
*/
|
||||
secret: string;
|
||||
/**
|
||||
* Twitter OAuth Token
|
||||
*/
|
||||
token: string;
|
||||
}
|
Loading…
Reference in New Issue
Block a user