From e2fc9a04320c07655a36cb2e2a28ab6be37d4e95 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 4 Apr 2016 00:05:34 -0400 Subject: [PATCH 1/2] feat(plugin): add web intent plugin --- src/plugins/webintent.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/plugins/webintent.ts diff --git a/src/plugins/webintent.ts b/src/plugins/webintent.ts new file mode 100644 index 000000000..f23c2d241 --- /dev/null +++ b/src/plugins/webintent.ts @@ -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 {return} + + @Cordova() + static hasExtra (extra : any) : Promise {return} + + @Cordova() + static getExtra (extra : any) : Promise {return} + + @Cordova() + static getUri () : Promise {return}; + + @Cordova() + static onNewIntent() : Promise {return}; + + @Cordova() + static sendBroadcast(options : {action:string, extras?:{option:boolean}}) : Promise {return} + +} \ No newline at end of file From f357b56886ecfd5867ac8aa4ddcc4d22f4eb1383 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 4 Apr 2016 00:11:13 -0400 Subject: [PATCH 2/2] feat(webintent): add plugin to index --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6044e5dea..5137d505c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, @@ -89,7 +90,8 @@ export { StatusBar, Toast, TouchID, - Vibration + Vibration, + WebIntent } export * from './plugins/plugin'; @@ -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