-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(twitter-connect): add twitter connect plugin
closes #308
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |