From 3b7f7c653359ba0edb76938f94d8e0a26a5eb78e Mon Sep 17 00:00:00 2001 From: "Keith D. Moore" Date: Sun, 27 Mar 2016 23:17:07 -0500 Subject: [PATCH 01/24] add comments regarding network plugin usage --- src/plugins/network.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/network.ts b/src/plugins/network.ts index b3c6578a..31d47ff5 100644 --- a/src/plugins/network.ts +++ b/src/plugins/network.ts @@ -23,8 +23,10 @@ declare var navigator; * * // watch network for a connection * let connectSubscription = Network.onConnect().subscribe(() => { - * console.log('network connected!'); - * // use a timeout so that we can determine what type of connection we have + * console.log('network connected!');
* + * // We just got a connection but we need to wait briefly + * 
// before we determine the connection type. Might need to wait
 + * // prior to doing any api requests as well. * setTimeout(() => { * console.log(Network.connection); * if (Network.connection === Connection.WIFI) { From 2aa25969f7390fa9a5a23b17dc3d08a00255fa6d Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 28 Mar 2016 20:24:05 -0400 Subject: [PATCH 02/24] Added diagnostic plugin. --- src/index.ts | 3 + src/plugins/diagnostic.ts | 188 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 src/plugins/diagnostic.ts diff --git a/src/index.ts b/src/index.ts index c2d8f139..6044e5de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,6 +23,7 @@ import {DBMeter} from './plugins/dbmeter'; import {Device} from './plugins/device'; import {DeviceMotion} from './plugins/devicemotion'; import {DeviceOrientation} from './plugins/deviceorientation'; +import {Diagnostic} from './plugins/diagnostic'; import {Dialogs} from './plugins/dialogs'; import {Facebook} from './plugins/facebook'; import {File} from './plugins/file'; @@ -67,6 +68,7 @@ export { DeviceMotion, DeviceOrientation, Dialogs, + Diagnostic, Facebook, File, Flashlight, @@ -114,6 +116,7 @@ window['IonicNative'] = { DeviceMotion: DeviceMotion, DeviceOrientation: DeviceOrientation, Dialogs: Dialogs, + Diagnostic: Diagnostic, Facebook: Facebook, File: File, Flashlight: Flashlight, diff --git a/src/plugins/diagnostic.ts b/src/plugins/diagnostic.ts new file mode 100644 index 00000000..d7599166 --- /dev/null +++ b/src/plugins/diagnostic.ts @@ -0,0 +1,188 @@ +import {Plugin, Cordova} from './plugin'; + +@Plugin({ + plugin: 'cordova.plugins.diagnostic', + pluginRef: 'cordova.plugins.diagnostic' +}) +export class Diagnostic { + /** + * Checks if app is able to access device location. + */ + @Cordova() + static isLocationEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /** + * Checks if Wifi is connected/enabled. On iOS this returns true if the device is connected to a network by WiFi. On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled. + * On Android this requires permission + */ + @Cordova() + static isWifiEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /* + * Checks if the device has a camera. On Android this returns true if the device has a camera. On iOS this returns true if both the device has a camera AND the application is authorized to use it. On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the + * application is authorized to use it. + */ + @Cordova() + static isCameraEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /* + * Checks if the device has Bluetooth capabilities and if so that Bluetooth is switched on (same on Android, iOS and Windows 10 Mobile) + * On Android this requires permission + */ + @Cordova() + static isBluetoothEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /* + * Returns the location authorization status for the application. + * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time. + * + * mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use". + */ + @Cordova() + static requestLocationAuthorization(mode?:string) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /* + * Checks if the application is authorized to use location. + * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time. + */ + @Cordova() + static isLocationAuthorized() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + + + /* + * Checks if camera hardware is present on device. + */ + @Cordova() + static isCameraPresent() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /* + * Checks if the application is authorized to use the camera. + * Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return TRUE as permissions are already granted at installation time. + */ + @Cordova() + static isCameraAuthorized() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /* + * Checks if location mode is set to return high-accuracy locations from GPS hardware. + * Returns true if Location mode is enabled and is set to either: + * - Device only = GPS hardware only (high accuracy) + * - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy) + */ + @Cordova() + static isGpsLocationEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /* + * Checks if location mode is set to return low-accuracy locations from network triangulation/WiFi access points. + * Returns true if Location mode is enabled and is set to either: + * - Battery saving = network triangulation and Wifi network IDs (low accuracy) + * - High accuracy = GPS hardware, network triangulation and Wifi network IDs (high and low accuracy) + */ + @Cordova() + static isNetworkLocationEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /** + * + * Checks if remote (push) notifications are enabled. + * On iOS 8+, returns true if app is registered for remote notifications AND "Allow Notifications" switch is ON AND alert style is not set to "None" (i.e. "Banners" or "Alerts"). + * On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRegisteredForRemoteNotifications(). + */ + @Cordova() + static isRemoteNotificationsEnabled() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + + /** + * + * Indicates if the app is registered for remote (push) notifications on the device. + * On iOS 8+, returns true if the app is registered for remote notifications and received its device token, or false if registration has not occurred, has failed, or has been denied by the user. Note that user preferences for notifications in the Settings app will not affect this. + * On iOS <=7, returns true if app is registered for remote notifications AND alert style is not set to "None" (i.e. "Banners" or "Alerts") - same as isRemoteNotificationsEnabled(). + */ + @Cordova() + static isRegisteredForRemoteNotifications() { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + + +} \ No newline at end of file From 23be4b7e95073382f02ff9208a391f38c648853a Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Tue, 29 Mar 2016 01:57:53 -0400 Subject: [PATCH 03/24] chore(docs): ability to add custom install command for a plugin closes https://github.com/driftyco/ionic-native/issues/93 --- scripts/docs/templates/common.template.html | 3 ++- src/plugins/facebook.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index d01772ee..3eeeff32 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -116,8 +116,9 @@ docType: "<$ doc.docType $>" <@- if doc.decorators @> + <@ for prop in doc.decorators[0].argumentInfo @> -
$ cordova plugin add <$ prop.plugin $>
+
$ <@ if prop.install @><$ prop.install $><@ else @>cordova plugin add <$ prop.plugin $><@ endif -@>

Repo: <$ prop.repo $> diff --git a/src/plugins/facebook.ts b/src/plugins/facebook.ts index e3a86a5b..e59918e5 100644 --- a/src/plugins/facebook.ts +++ b/src/plugins/facebook.ts @@ -80,7 +80,8 @@ import {Plugin, Cordova} from './plugin'; @Plugin({ plugin: 'cordova-plugin-facebook4', pluginRef: 'facebookConnectPlugin', - repo: 'https://github.com/jeduan/cordova-plugin-facebook4' + repo: 'https://github.com/jeduan/cordova-plugin-facebook4', + install: 'cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"' }) export class Facebook { From f342aa819f59fed860f04e1fab5b357a295ef312 Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Thu, 31 Mar 2016 13:24:25 -0500 Subject: [PATCH 04/24] platform -> native --- scripts/docs/update_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs/update_docs.sh b/scripts/docs/update_docs.sh index 15d56d14..d765238b 100755 --- a/scripts/docs/update_docs.sh +++ b/scripts/docs/update_docs.sh @@ -33,7 +33,7 @@ function run { git config --global user.email "hi@ionicframework.com" git config --global user.name "Ionitron" git add -A - git commit -am "Automated build of platform docs driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1" + git commit -am "Automated build of native docs driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1" git push origin master echo "-- Updated docs for $VERSION_NAME succesfully!" From 3b4c84613215b39b50ffc90757b979893ed0c1ba Mon Sep 17 00:00:00 2001 From: drachenbach Date: Thu, 31 Mar 2016 21:38:19 +0200 Subject: [PATCH 05/24] added google analytics wrapper --- src/plugins/googleanalytics.ts | 123 +++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/plugins/googleanalytics.ts diff --git a/src/plugins/googleanalytics.ts b/src/plugins/googleanalytics.ts new file mode 100644 index 00000000..50dc5e29 --- /dev/null +++ b/src/plugins/googleanalytics.ts @@ -0,0 +1,123 @@ +import {Plugin, Cordova} from './plugin'; + +declare var window; + +/** + * @name Google Analytics + * @description + * This plugin connects to Google's native Universal Analytics SDK + * Prerequisites: + * - A Cordova 3.0+ project for iOS and/or Android + * - A Mobile App property through the Google Analytics Admin Console + * - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html) + */ +@Plugin({ + plugin: 'cordova-plugin-google-analytics', + pluginRef: 'analytics', + repo: 'https://github.com/danwilson/google-analytics-plugin', + platforms: ['Android', 'iOS'] +}) +export class GoogleAnalytics { + /** + * In your 'deviceready' handler, set up your Analytics tracker. + * https://developers.google.com/analytics/devguides/collection/analyticsjs/ + * @param {string} id Your Google Analytics Mobile App property + */ + @Cordova() + static startTrackerWithId(id: string): Promise { return } + + /** + * Track a screen + * https://developers.google.com/analytics/devguides/collection/analyticsjs/screens + * + * @param {string} title Screen title + */ + @Cordova() + static trackView(title: string): Promise { return } + + /** + * Track an event + * https://developers.google.com/analytics/devguides/collection/analyticsjs/events + * @param {string} category + * @param {string} action + * @param {string} label + * @param {number} value + */ + @Cordova() + static trackEvent(category: string, action: string, label?: string, value?: number): Promise { return } + + /** + * Track an exception + * @param {string} description + * @param {boolean} fatal + */ + @Cordova() + static trackException(description: string, fatal: boolean): Promise { return } + + /** + * Track User Timing (App Speed) + * @param {string} category + * @param {number} intervalInMilliseconds + * @param {string} variable + * @param {string} label + */ + @Cordova() + static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise { return } + + /** + * Add a Transaction (Ecommerce) + * https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans + * @param {string} id + * @param {string} affiliation + * @param {number} revenue + * @param {number} tax + * @param {number} shipping + * @param {string} currencyCode + */ + @Cordova() + static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise { return } + + /** + * Add a Transaction Item (Ecommerce) + * https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addItem + * @param {string} id + * @param {string} name + * @param {string} sku + * @param {string} category + * @param {number} price + * @param {number} quantity + * @param {string} currencyCode + */ + @Cordova() + static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise { return } + + /** + * Add a Custom Dimension + * https://developers.google.com/analytics/devguides/platform/customdimsmets + * @param {string} key + * @param {string} value + */ + @Cordova() + static addCustomDimension(key: string, value: string): Promise { return } + + /** + * Set a UserId + * https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id + * @param {string} id + */ + @Cordova() + static setUserId(id: string): Promise { return } + + /** + * Enable verbose logging + */ + @Cordova() + static debugMode(): Promise { return } + + /** + * Enable/disable automatic reporting of uncaught exceptions + * @param {boolean} shouldEnable + */ + @Cordova() + static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise { return } +} From e2fc9a04320c07655a36cb2e2a28ab6be37d4e95 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 4 Apr 2016 00:05:34 -0400 Subject: [PATCH 06/24] 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 00000000..f23c2d24 --- /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 07/24] 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 6044e5de..5137d505 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 8a0f828fb023e65d1a23e9a108fbde38ceeade09 Mon Sep 17 00:00:00 2001 From: Nick Gal Date: Mon, 4 Apr 2016 19:34:37 -0700 Subject: [PATCH 08/24] Update barcodescanner.ts Typo --- src/plugins/barcodescanner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/barcodescanner.ts b/src/plugins/barcodescanner.ts index cc76e191..55caba6c 100644 --- a/src/plugins/barcodescanner.ts +++ b/src/plugins/barcodescanner.ts @@ -23,7 +23,7 @@ import {Plugin, Cordova} from './plugin'; plugin: 'phonegap-plugin-barcodescanner', pluginRef: 'cordova.plugins.barcodeScanner', repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner', - pltaforms: ['Android','iOS','Windows Phone 8','Windows 10','Windows 8','BlackBerry 10', 'Browser'] + platforms: ['Android','iOS','Windows Phone 8','Windows 10','Windows 8','BlackBerry 10', 'Browser'] }) export class BarcodeScanner { From 804c9ee4634976e059c7b2e3cdd5b4817766a29c Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Tue, 5 Apr 2016 21:55:24 +1000 Subject: [PATCH 09/24] 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 6044e5de..bfc2b22e 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 00000000..6d5d9b4a --- /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 10/24] 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 6d5d9b4a..14ebbcdb 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 11/24] 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 a54ba2c5..5f095d21 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 12/24] 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 14ebbcdb..076b8cad 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 13/24] 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 076b8cad..d07e46d4 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 14/24] 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 8c0189ff..bf1719a6 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 7fa66abf722267a85bd9e88a6e54d20d749c8c26 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Fri, 8 Apr 2016 16:53:41 -0500 Subject: [PATCH 15/24] chore(): update version to 1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fc9812b..97a8d700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-native", - "version": "1.1.0", + "version": "1.1.1", "description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support", "main": "dist/index.js", "directories": { From beeb0758311a8ae4856a595d5a5cdd1bf515394c Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 11 Apr 2016 10:29:52 -0400 Subject: [PATCH 16/24] fix(vibration): fix plugin reference closes #106 --- src/plugins/vibration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/vibration.ts b/src/plugins/vibration.ts index 77185154..2711ae09 100644 --- a/src/plugins/vibration.ts +++ b/src/plugins/vibration.ts @@ -24,7 +24,7 @@ import {Plugin, Cordova} from './plugin' */ @Plugin({ plugin: 'cordova-plugin-vibration', - pluginRef: 'navigator.vibrate', + pluginRef: 'navigator', repo: 'https://github.com/apache/cordova-plugin-vibration' }) export class Vibration { From c36fa0fa7f00c50fb54b44d773527ac354d76f84 Mon Sep 17 00:00:00 2001 From: James Cheuk Date: Fri, 15 Apr 2016 18:20:41 +0800 Subject: [PATCH 17/24] 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 cc04e569..3be40ae6 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 18/24] 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 0dc6676e..3156c2a7 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 19/24] Added GoogleAnalytics --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index a0b6cf60..1996c023 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 20/24] 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 a71f2c05..b8e738ce 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 21/24] 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 3eeeff32..d22083a1 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 $> From e10d744e7ba82b287ff25acd663b02bc6b796005 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 25 Apr 2016 05:32:36 -0400 Subject: [PATCH 22/24] fix(localnotifications): options can be an array --- src/plugins/localnotifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/localnotifications.ts b/src/plugins/localnotifications.ts index a54ba2c5..98abe5d1 100644 --- a/src/plugins/localnotifications.ts +++ b/src/plugins/localnotifications.ts @@ -57,7 +57,7 @@ export class LocalNotifications { @Cordova({ sync: true }) - static schedule(options? : Notification) : void {} + static schedule(options? : Notification|Array) : void {} /** * Updates a previously scheduled notification. Must include the id in the options parameter. From 3865ea47773b35a257e6d60b74857fb009ccaa0d Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 25 Apr 2016 05:37:26 -0400 Subject: [PATCH 23/24] fix(GoogleAnalytics): addCustomDimension() key param is number closes #131 --- src/plugins/googleanalytics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/googleanalytics.ts b/src/plugins/googleanalytics.ts index 50dc5e29..1436f4a8 100644 --- a/src/plugins/googleanalytics.ts +++ b/src/plugins/googleanalytics.ts @@ -98,7 +98,7 @@ export class GoogleAnalytics { * @param {string} value */ @Cordova() - static addCustomDimension(key: string, value: string): Promise { return } + static addCustomDimension(key: number, value: string): Promise { return } /** * Set a UserId From f5b52bf98fbb3de7bc869b6c5c9696f9ae3577a6 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 25 Apr 2016 05:43:35 -0400 Subject: [PATCH 24/24] docs(contacts): fix usage docs closes #121 --- src/plugins/contacts.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/contacts.ts b/src/plugins/contacts.ts index ea0d281d..ac5152bc 100644 --- a/src/plugins/contacts.ts +++ b/src/plugins/contacts.ts @@ -185,7 +185,7 @@ declare var ContactFindOptions: { declare var Contact: { new(): Contact -} +}; /** * @name Contacts @@ -202,12 +202,11 @@ declare var Contact: { * * * - * Contacts.save({ + * Contacts.create({ * displayName: "Mr. Ionitron" * }).then((contact) => {}, (err) => {}) * ``` * - * See the `save()` docs for a full list of fields. * */ @Plugin({