Skip to content

Commit

Permalink
feat(twitter-connect): add twitter connect plugin
Browse files Browse the repository at this point in the history
closes #308
  • Loading branch information
ihadeed committed Jul 20, 2016
1 parent 5807dd7 commit 979838f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -145,6 +146,7 @@ export {
StatusBar,
TouchID,
Transfer,
TwitterConnect,
Vibration,
WebIntent
}
Expand Down Expand Up @@ -220,6 +222,7 @@ window['IonicNative'] = {
Toast: Toast,
TouchID: TouchID,
Transfer: Transfer,
TwitterConnect: TwitterConnect,
Vibration: Vibration,
WebIntent: WebIntent
};
Expand Down
45 changes: 45 additions & 0 deletions src/plugins/twitter-connect.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 979838f

Please sign in to comment.