Skip to content

Commit

Permalink
Merge pull request #105 from driftyco/webintent-plugin
Browse files Browse the repository at this point in the history
feat(plugin): add web intent plugin
  • Loading branch information
ihadeed committed Apr 11, 2016
2 parents beeb075 + f357b56 commit 3c2f227
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {StatusBar} from './plugins/statusbar';
import {Toast} from './plugins/toast';
import {TouchID} from './plugins/touchid';
import {Vibration} from './plugins/vibration';
import {WebIntent} from './plugins/webintent';

export {
ActionSheet,
Expand Down Expand Up @@ -89,7 +90,8 @@ export {
StatusBar,
Toast,
TouchID,
Vibration
Vibration,
WebIntent
}

export * from './plugins/plugin';
Expand Down Expand Up @@ -137,7 +139,8 @@ window['IonicNative'] = {
StatusBar: StatusBar,
Toast: Toast,
TouchID: TouchID,
Vibration: Vibration
Vibration: Vibration,
WebIntent: WebIntent
};

// To help developers using cordova, we listen for the device ready event and
Expand Down
38 changes: 38 additions & 0 deletions src/plugins/webintent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {Cordova, CordovaProperty, Plugin} from './plugin';
declare var window;
@Plugin({
plugin: 'https://github.com/Initsogar/cordova-webintent.git',
pluginRef: 'window.plugins.webintent',
repo: 'https://github.com/Initsogar/cordova-webintent.git'
})
export class WebIntent {

@CordovaProperty
static get ACTION_VIEW () {
return window.plugins.webintent.ACTION_VIEW;
}

@CordovaProperty
static get EXTRA_TEXT () {
return window.plugins.webintent.EXTRA_TEXT;
}

@Cordova()
static startActivity (options : {action:any,url:string}) : Promise<any> {return}

@Cordova()
static hasExtra (extra : any) : Promise<any> {return}

@Cordova()
static getExtra (extra : any) : Promise<any> {return}

@Cordova()
static getUri () : Promise<string> {return};

@Cordova()
static onNewIntent() : Promise<string> {return};

@Cordova()
static sendBroadcast(options : {action:string, extras?:{option:boolean}}) : Promise<any> {return}

}

0 comments on commit 3c2f227

Please sign in to comment.