From e2fc9a04320c07655a36cb2e2a28ab6be37d4e95 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 4 Apr 2016 00:05:34 -0400 Subject: [PATCH 01/13] 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 02/13] 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 From 804c9ee4634976e059c7b2e3cdd5b4817766a29c Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Tue, 5 Apr 2016 21:55:24 +1000 Subject: [PATCH 03/13] feat(plugin): add email composer plugin --- src/index.ts | 3 ++ src/plugins/emailcomposer.ts | 63 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/plugins/emailcomposer.ts diff --git a/src/index.ts b/src/index.ts index 6044e5dea..bfc2b22e8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,6 +25,7 @@ import {DeviceMotion} from './plugins/devicemotion'; import {DeviceOrientation} from './plugins/deviceorientation'; import {Diagnostic} from './plugins/diagnostic'; import {Dialogs} from './plugins/dialogs'; +import {EmailComposer} from './plugins/emailcomposer'; import {Facebook} from './plugins/facebook'; import {File} from './plugins/file'; import {Flashlight} from './plugins/flashlight'; @@ -69,6 +70,7 @@ export { DeviceOrientation, Dialogs, Diagnostic, + EmailComposer, Facebook, File, Flashlight, @@ -117,6 +119,7 @@ window['IonicNative'] = { DeviceOrientation: DeviceOrientation, Dialogs: Dialogs, Diagnostic: Diagnostic, + EmailComposer: EmailComposer, Facebook: Facebook, File: File, Flashlight: Flashlight, diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts new file mode 100644 index 000000000..6d5d9b4a9 --- /dev/null +++ b/src/plugins/emailcomposer.ts @@ -0,0 +1,63 @@ +import {Plugin, Cordova} from './plugin'; + +/** + * Email object for Opening Email Composer + */ +export interface email { + to: string | Array, + cc: string | Array, + bcc: string | Array, + attachments: Array, + subject: string, + body: string, + isHtml: boolean +} + +/** + * @name Email Composer + * @description + * + * Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/katzer/cordova-plugin-email-composer). + * + * @usage + * ```ts + * import {EmailComposer} from 'ionic-native'; + * + * + * let email = { + * to: 'max@mustermann.de', + * cc: 'erika@mustermann.de', + * bcc: ['john@doe.com', 'jane@doe.com'], + * attachments: [ + * 'file://img/logo.png', + * 'res://icon.png', + * 'base64:icon.png//iVBORw0KGgoAAAANSUhEUg...', + * 'file://README.pdf' + * ], + * subject: 'Cordova Icons', + * body: 'How are you? Nice greetings from Leipzig', + * isHtml: true + * }; + * + * // Send a text message using default options + * EmailComposer.send(email); + * + * ``` + */ +@Plugin({ + plugin: 'cordova-plugin-email-composer', + pluginRef: 'emailComposer', + repo: 'https://github.com/katzer/cordova-plugin-email-composer.git', + platforms: ['Android', 'iOS', 'Windows Phone 8'] +}) +export class EmailComposer { + + /** + * Opens Email Composer with email contents + * @param email {email} Email + * @returns {Promise} Resolves promise when the EmailComposer has been opened + */ + @Cordova() + static open(email: email): Promise { return } + +} From 213330379db07483eea756254f53c6cd5ea4eb9c Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Wed, 6 Apr 2016 00:24:50 +1000 Subject: [PATCH 04/13] Update methods and pluginRef --- src/plugins/emailcomposer.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts index 6d5d9b4a9..14ebbcdb3 100644 --- a/src/plugins/emailcomposer.ts +++ b/src/plugins/emailcomposer.ts @@ -46,18 +46,27 @@ export interface email { */ @Plugin({ plugin: 'cordova-plugin-email-composer', - pluginRef: 'emailComposer', + pluginRef: 'cordova.plugins.email', repo: 'https://github.com/katzer/cordova-plugin-email-composer.git', platforms: ['Android', 'iOS', 'Windows Phone 8'] }) export class EmailComposer { + + @Cordova() + static isAvailable() : Promise {return} + @Cordova() + static addAlias(app: String, schema: any) : Promise {return} + /** * Opens Email Composer with email contents * @param email {email} Email * @returns {Promise} Resolves promise when the EmailComposer has been opened */ - @Cordova() - static open(email: email): Promise { return } + @Cordova({ + successIndex: 1, + errorIndex: 3 + }) + static open(email: email, scope : any) : Promise {return} } From f2c85d038a9a0af01bf471b72c48a881b1b98255 Mon Sep 17 00:00:00 2001 From: Eduardo Eidelwein Berlitz Date: Tue, 5 Apr 2016 13:41:35 -0300 Subject: [PATCH 05/13] Fix documentation for LocalNotifications plugin --- src/plugins/localnotifications.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/localnotifications.ts b/src/plugins/localnotifications.ts index a54ba2c59..5f095d213 100644 --- a/src/plugins/localnotifications.ts +++ b/src/plugins/localnotifications.ts @@ -35,8 +35,8 @@ import {Plugin, Cordova} from './plugin'; * * // Schedule delayed notification * LocalNotifications.schedule({ - * t ext: "Delayed Notification", - * at: new Date(new Date() + 3600), + * text: "Delayed Notification", + * at: new Date(new Date().getTime() + 3600), * led: "FF0000", * sound: null * }); @@ -273,4 +273,4 @@ export interface Notification { * Default: FFFFFF */ led? : string -} \ No newline at end of file +} From f96ec32be7eb9a62db6aef22afa5162f82502fe4 Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Wed, 6 Apr 2016 21:00:26 +1000 Subject: [PATCH 06/13] Fix is available callback --- src/plugins/emailcomposer.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts index 14ebbcdb3..076b8cadc 100644 --- a/src/plugins/emailcomposer.ts +++ b/src/plugins/emailcomposer.ts @@ -4,6 +4,7 @@ import {Plugin, Cordova} from './plugin'; * Email object for Opening Email Composer */ export interface email { + app?: string, to: string | Array, cc: string | Array, bcc: string | Array, @@ -52,11 +53,14 @@ export interface email { }) export class EmailComposer { - @Cordova() - static isAvailable() : Promise {return} + @Cordova({ + successIndex: 1, + errorIndex: 3 + }) + static isAvailable(app: string, scope: any) : Promise {return} @Cordova() - static addAlias(app: String, schema: any) : Promise {return} + static addAlias(alias: string, packageName: string): void {} /** * Opens Email Composer with email contents @@ -67,6 +71,6 @@ export class EmailComposer { successIndex: 1, errorIndex: 3 }) - static open(email: email, scope : any) : Promise {return} + static open(email: email, scope: any) : Promise {return} } From ce92e6ac8f8e1722ed173ccc0bdf28361549d636 Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Wed, 6 Apr 2016 22:06:46 +1000 Subject: [PATCH 07/13] Refactor isAvailable --- src/plugins/emailcomposer.ts | 39 ++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts index 076b8cadc..d07e46d49 100644 --- a/src/plugins/emailcomposer.ts +++ b/src/plugins/emailcomposer.ts @@ -1,5 +1,7 @@ import {Plugin, Cordova} from './plugin'; +declare var cordova; + /** * Email object for Opening Email Composer */ @@ -24,6 +26,12 @@ export interface email { * ```ts * import {EmailComposer} from 'ionic-native'; * + * + * EmailComposer.isAvailable().then((available) =>{ + * if(available) { + * //Now we know we can send + * } + * }); * * let email = { * to: 'max@mustermann.de', @@ -53,24 +61,39 @@ export interface email { }) export class EmailComposer { - @Cordova({ - successIndex: 1, - errorIndex: 3 - }) - static isAvailable(app: string, scope: any) : Promise {return} + /** + * Verifies if sending emails is supported on the device. + * + * @param app {string?} An optional app id or uri scheme. Defaults to mailto. + * @param scope {any?} An optional scope for the promise + * @returns {Promise} Resolves promise with boolean whether EmailComposer is available + */ + static isAvailable (app? : string, scope? : any) : Promise { + return new Promise((resolve, reject) => { + cordova.plugins.email.isAvailable(app, resolve, scope); + }); + } + /** + * Adds a new mail app alias. + * + * @param alias {string} The alias name + * @param packageName {string} The package name + */ @Cordova() - static addAlias(alias: string, packageName: string): void {} + static addAlias(alias : string, packageName : string): void {} /** - * Opens Email Composer with email contents + * Displays the email composer pre-filled with data. + * * @param email {email} Email + * @param scope {any?} An optional scope for the promise * @returns {Promise} Resolves promise when the EmailComposer has been opened */ @Cordova({ successIndex: 1, errorIndex: 3 }) - static open(email: email, scope: any) : Promise {return} + static open(email : email, scope? : any) : Promise {return} } From d42d24c60ba0656d663d968f0bce26b41d9bc9c7 Mon Sep 17 00:00:00 2001 From: "CT14.IT" Date: Thu, 7 Apr 2016 14:26:46 +0100 Subject: [PATCH 08/13] Minor typo fixes --- src/plugins/actionsheet.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index 8c0189ff8..bf1719a64 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -38,10 +38,10 @@ export class ActionSheet { * |-------------------------------|-----------|----------------------------------------------| * | title |`string` | The title for the actionsheet | * | buttonLabels |`string[]` | the labels for the buttons. Uses the index x | - * | androidTheme |`number` | Theme to bue used on Android | + * | androidTheme |`number` | Theme to be used on Android | * | androidEnableCancelButton |`boolean` | Enable a cancel on Android | - * | winphoneEnableCancelButton |`boolean` | Enable a cancel on Android | - * | addCancelButtonWithLabel |`string` | Add a cancle button with text | + * | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone | + * | addCancelButtonWithLabel |`string` | Add a cancel button with text | * | addDestructiveButtonWithLabel |`string` | Add a destructive button with text | * | position |`number[]` | On an iPad, set the X,Y position | * From c36fa0fa7f00c50fb54b44d773527ac354d76f84 Mon Sep 17 00:00:00 2001 From: James Cheuk Date: Fri, 15 Apr 2016 18:20:41 +0800 Subject: [PATCH 09/13] update docs statusbar.ts It should be overlaysWebView --- src/plugins/statusbar.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/statusbar.ts b/src/plugins/statusbar.ts index cc04e569b..3be40ae6d 100644 --- a/src/plugins/statusbar.ts +++ b/src/plugins/statusbar.ts @@ -74,7 +74,7 @@ export class StatusBar { * Set the status bar to a specific named color. Valid options: * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown. * - * iOS note: you must call StatusBar.setOverlay(false) to enable color changing. + * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing. * * @param {string} colorName The name of the color (from above) */ @@ -86,7 +86,7 @@ export class StatusBar { /** * Set the status bar to a specific hex color (CSS shorthand supported!). * - * iOS note: you must call StatusBar.setOverlay(false) to enable color changing. + * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing. * * @param {string} hexString The hex value of the color. */ From 17fa1c72b753d26cba53e5746696f080b464f6ff Mon Sep 17 00:00:00 2001 From: Koray S Date: Fri, 15 Apr 2016 14:25:02 +0200 Subject: [PATCH 10/13] documentation wrong for watchAcceleration documentation was wrong. watchPosition instead of watchAcceleration.. --- src/plugins/devicemotion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/devicemotion.ts b/src/plugins/devicemotion.ts index 0dc6676ec..3156c2a7b 100644 --- a/src/plugins/devicemotion.ts +++ b/src/plugins/devicemotion.ts @@ -52,7 +52,7 @@ export interface accelerometerOptions { * ); * * // Watch device acceleration - * var subscription = DeviceMotion.watchPosition().subscribe(acceleration => { + * var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => { * console.log(acceleration); * }); * From ec6d8b14f3614d566212268d9b5befc5749591aa Mon Sep 17 00:00:00 2001 From: Hackfrag Date: Sat, 16 Apr 2016 17:13:40 +0200 Subject: [PATCH 11/13] Added GoogleAnalytics --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index a0b6cf60a..1996c0234 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,6 +31,7 @@ import {File} from './plugins/file'; import {Flashlight} from './plugins/flashlight'; import {Geolocation} from './plugins/geolocation'; import {Globalization} from './plugins/globalization'; +import {GoogleAnalytics} from './plugins/googleanalytics'; import {Hotspot} from './plugins/hotspot'; import {ImagePicker} from './plugins/imagepicker'; import {InAppBrowser} from './plugins/inappbrowser'; @@ -77,6 +78,7 @@ export { Flashlight, Geolocation, Globalization, + GoogleAnalytics, Hotspot, ImagePicker, InAppBrowser, @@ -127,6 +129,7 @@ window['IonicNative'] = { Flashlight: Flashlight, Geolocation: Geolocation, Globalization: Globalization, + GoogleAnalytics: GoogleAnalytics, Hotspot: Hotspot, ImagePicker: ImagePicker, InAppBrowser: InAppBrowser, From 923e384e43511d7956547753e2f5aede3c094bd9 Mon Sep 17 00:00:00 2001 From: mrybnik Date: Tue, 19 Apr 2016 01:03:43 +0200 Subject: [PATCH 12/13] Correct battery-status "status" event name --- src/plugins/batterystatus.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/batterystatus.ts b/src/plugins/batterystatus.ts index a71f2c052..b8e738cec 100644 --- a/src/plugins/batterystatus.ts +++ b/src/plugins/batterystatus.ts @@ -37,7 +37,7 @@ export class BatteryStatus { */ @Cordova({ eventObservable: true, - event: 'batterylevel' + event: 'batterystatus' }) static onChange () : Observable {return} @@ -73,4 +73,4 @@ export interface StatusObject { * A boolean that indicates whether the device is plugged in */ isPlugged : boolean -} \ No newline at end of file +} From f22c9fc51eeb0f11c1b231ec6c9a95d3dcebebc1 Mon Sep 17 00:00:00 2001 From: mhartington Date: Tue, 19 Apr 2016 09:07:33 -0400 Subject: [PATCH 13/13] docs(): update plugin install command References https://github.com/driftyco/ionic-site/pull/555 --- scripts/docs/templates/common.template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 3eeeff32c..d22083a10 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -118,7 +118,7 @@ docType: "<$ doc.docType $>" <@- if doc.decorators @> <@ for prop in doc.decorators[0].argumentInfo @> -
$ <@ if prop.install @><$ prop.install $><@ else @>cordova plugin add <$ prop.plugin $><@ endif -@>
+
$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif -@>

Repo: <$ prop.repo $>