From db07768133a26df00e0025fb68f327689a7c0cc9 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Wed, 27 Apr 2016 13:00:57 -0500 Subject: [PATCH 01/13] fix(plugin): handle rejection when Cordova is undefined Zone.js now (helpfully) throws an error on unhandled rejections in promises. This is great because they no longer silently fail, but we were relying on that behavior for the case where the plugin isn't installed or Cordova isn't available. With this change, those cases won't throw an unhandled rejection error, but all regular plugin errors still should. --- src/plugins/plugin.ts | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/plugins/plugin.ts b/src/plugins/plugin.ts index a06bb16d6..faa4a9728 100644 --- a/src/plugins/plugin.ts +++ b/src/plugins/plugin.ts @@ -81,17 +81,15 @@ function callCordovaPlugin(pluginObj:any, methodName:string, args:any[], opts:an // Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation). if(!window.cordova) { cordovaWarn(pluginObj.name, methodName); - reject && reject({ + return { error: 'cordova_not_available' - }); - return; + } } pluginWarn(pluginObj, methodName); - reject && reject({ + return { error: 'plugin_not_installed' - }); - return; + }; } // console.log('Cordova calling', pluginObj.name, methodName, args); @@ -118,14 +116,27 @@ function getPromise(cb) { } function wrapPromise(pluginObj:any, methodName:string, args:any[], opts:any={}) { - return getPromise((resolve, reject) => { - callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject); - }) + let pluginResult, rej; + const p = getPromise((resolve, reject) => { + pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, resolve, reject); + rej = reject; + }); + // Angular throws an error on unhandled rejection, but in this case we have already printed + // a warning that Cordova is undefined or the plugin is uninstalled, so there is no reason + // to error + if (pluginResult && pluginResult.error) { + p.catch(() => {}); + rej(pluginResult.error); + } + return p; } function wrapObservable(pluginObj:any, methodName:string, args:any[], opts:any = {}) { return new Observable(observer => { let pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer)); + if (pluginResult && pluginResult.error) { + observer.error(pluginResult.error); + } return () => { try { From ec4f3c69ecff712c3eb412c0275d385c9cfd8375 Mon Sep 17 00:00:00 2001 From: Rajkiran Panuganti Date: Thu, 28 Apr 2016 22:06:21 -0700 Subject: [PATCH 02/13] Screenshot Plugin --- src/index.ts | 3 +++ src/plugins/screenshot.ts | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/plugins/screenshot.ts diff --git a/src/index.ts b/src/index.ts index 6044e5dea..9754a7730 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,6 +38,7 @@ import {LaunchNavigator} from './plugins/launchnavigator'; import {LocalNotifications} from './plugins/localnotifications'; import {Network, Connection} from './plugins/network'; import {Push} from './plugins/push'; +import {Screenshot} from './plugins/screenshot'; import {SMS} from './plugins/sms'; import {SocialSharing} from './plugins/socialsharing'; import {SpinnerDialog} from './plugins/spinnerdialog'; @@ -82,6 +83,7 @@ export { LocalNotifications, Network, Push, + Screenshot, SMS, SocialSharing, SpinnerDialog, @@ -130,6 +132,7 @@ window['IonicNative'] = { LocalNotifications: LocalNotifications, Network: Network, Push: Push, + Screenshot: Screenshot, SMS: SMS, SocialSharing: SocialSharing, SpinnerDialog: SpinnerDialog, diff --git a/src/plugins/screenshot.ts b/src/plugins/screenshot.ts new file mode 100644 index 000000000..5ed761e1b --- /dev/null +++ b/src/plugins/screenshot.ts @@ -0,0 +1,36 @@ +import {Cordova, Plugin} from './plugin'; +@Plugin({ + plugin: 'https://github.com/gitawego/cordova-screenshot.git', + pluginRef: 'navigator.screenshot', + repo: 'https://github.com/gitawego/cordova-screenshot.git' +}) +export class Screenshot { + +/** + * Takes screenshot and saves the image + * + * @param {string} format. Format can take the value of either 'jpg' or 'png' + * On ios, only 'jpg' format is supported + * @param {number} quality. Determines the quality of the screenshot. + * Default quality is set to 100. + * @param {string} filename. Name of the file as stored on the storage + */ + @Cordova({ + successIndex: 1, + errorIndex: 0 + }) + static save (format: string, quality: number, filename: string) : Promise {return} + +/** + * Takes screenshot and returns the image as an URI + * + * @param {number} quality. Determines the quality of the screenshot. + * Default quality is set to 100. + */ + + @Cordova({ + successIndex: 1, + errorIndex: 0 + }) + static URI (quality: number) : Promise {return} +} \ No newline at end of file From e73c99b28a1e8a5edddcef1ce49db5ef7e6a37c1 Mon Sep 17 00:00:00 2001 From: Rajkiran Panuganti Date: Thu, 28 Apr 2016 22:38:59 -0700 Subject: [PATCH 03/13] make params optional --- src/plugins/screenshot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/screenshot.ts b/src/plugins/screenshot.ts index 5ed761e1b..6c34543d4 100644 --- a/src/plugins/screenshot.ts +++ b/src/plugins/screenshot.ts @@ -19,7 +19,7 @@ export class Screenshot { successIndex: 1, errorIndex: 0 }) - static save (format: string, quality: number, filename: string) : Promise {return} + static save (format?: string, quality?: number, filename?: string) : Promise {return} /** * Takes screenshot and returns the image as an URI @@ -32,5 +32,5 @@ export class Screenshot { successIndex: 1, errorIndex: 0 }) - static URI (quality: number) : Promise {return} + static URI (quality?: number) : Promise {return} } \ No newline at end of file From c8f8d6ac521f82f31b8de5bb107bc8915ac393e4 Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Fri, 29 Apr 2016 13:12:39 -0500 Subject: [PATCH 04/13] Let build_bundle tests run on CI --- circle.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/circle.yml b/circle.yml index 861353cb3..0a86d221d 100644 --- a/circle.yml +++ b/circle.yml @@ -4,11 +4,6 @@ machine: ruby: version: 2.1.2 -general: - branches: - only: - - master # ignore PRs and branches - dependencies: pre: - ./scripts/docs/prepare.sh From 837fb95a8af911567b89c68c93ce302043479681 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 15:13:07 -0400 Subject: [PATCH 05/13] feat(plugin): add Bluetooth Serial plugin closes #136 --- src/index.ts | 3 + src/plugins/bluetoothserial.ts | 226 +++++++++++++++++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 src/plugins/bluetoothserial.ts diff --git a/src/index.ts b/src/index.ts index 2a982c14b..49ebfa910 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,6 +14,7 @@ import {BarcodeScanner} from './plugins/barcodescanner'; import {Base64ToGallery} from './plugins/base64togallery'; import {BatteryStatus} from './plugins/batterystatus'; import {BLE} from './plugins/ble'; +import {BluetoothSerial} from './plugins/bluetoothserial'; import {Calendar} from './plugins/calendar'; import {Camera} from './plugins/camera'; import {Clipboard} from './plugins/clipboard'; @@ -61,6 +62,7 @@ export { Base64ToGallery, BatteryStatus, BLE, + BluetoothSerial, Calendar, Camera, Clipboard, @@ -113,6 +115,7 @@ window['IonicNative'] = { Base64ToGallery: Base64ToGallery, BatteryStatus: BatteryStatus, BLE: BLE, + BluetoothSerial: BluetoothSerial, Calendar: Calendar, Camera: Camera, Clipboard: Clipboard, diff --git a/src/plugins/bluetoothserial.ts b/src/plugins/bluetoothserial.ts new file mode 100644 index 000000000..c2bfe9553 --- /dev/null +++ b/src/plugins/bluetoothserial.ts @@ -0,0 +1,226 @@ +import {Plugin, Cordova} from './plugin'; +import {Observable} from "rxjs/Observable"; + +/** + * @name Bluetooth Serial + * @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino. + * @usage + */ +@Plugin({ + repo: 'https://github.com/don/BluetoothSerial', + plugin: 'cordova-plugin-bluetooth-serial', + pluginRef: '', + platforms: ['Android','iOS','Windows Phone','Browser'] +}) +export class BluetoothSerial { + + /** + * Connect to a Bluetooth device + * @param macAddress_or_uuid Identifier of the remote device + */ + @Cordova({ + platforms: ['Android','iOS','Windows Phone'] + }) + static connect (macAddress_or_uuid : string) : Promise {return} + + /** + * Connect insecurely to a Bluetooth device + * @param macAddress Identifier of the remote device + */ + @Cordova({ + platforms: ['Android'] + }) + static connectInsecure (macAddress : string) : Promise {return} + + /** + * Disconnect + */ + @Cordova({ + platforms: ['Android','iOS','Windows Phone'] + }) + static disconnect () : Promise {return} + + /** + * Writes data to the serial port + * @param data ArrayBuffer of data + * @usage + * ```ts + * // Write a string + * Bluetooth.write("hello world").then(success, failure); + * + * // Array of int or bytes + * Bluetooth.write([186, 220, 222]).then(success, failure); + * + * // Typed Array + * var data = new Uint8Array(4); + * data[0] = 0x41; + * data[1] = 0x42; + * data[2] = 0x43; + * data[3] = 0x44; + * Bluetooth.write(data).then(success, failure); + * + * // Array Buffer + * Bluetooth.write(data.buffer).then(success, failure); + * ``` + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static write (data : any) : Promise {return} + + /** + * Gets the number of bytes of data available + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) static available () : Promise {return} + + /** + * Reads data from the buffer + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static read () : Promise {return} + + /** + * Reads data from the buffer until it reaches a delimiter + * @param delimiter + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static readUntil (delimiter : string) : Promise {return} + + /** + * Subscribe to be notified when data is received + * @param delimiter + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'], + observable: true, + clearFunction: 'unsubscribe' + }) + static subscribe (delimiter : string) : Observable {return} + + /** + * Subscribe to be notified when data is received + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'], + observable: true, + clearFunction: 'unsubscribeRawData' + }) + static subscribeRawData () : Observable {return} + + /** + * Clears data in buffer + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static clear () : Promise {return} + + /** + * Lists bonded devices + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static list () : Promise {return} + + /** + * Reports if bluetooth is enabled + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static isEnabled () : Promise {return} + + /** + * Reports the connection status + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static isConnected () : Promise {return} + + /** + * Reads the RSSI from the connected peripheral + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static readRSSI () : Promise {return} + + /** + * Show the Bluetooth settings on the device + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static showBluetoothSettings () : Promise {return} + + /** + * Enable Bluetooth on the device + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static enable () : Promise {return} + + /** + * Discover unpaired devices + * @usage + * ```ts + * [{ + * "class": 276, + * "id": "10:BF:48:CB:00:00", + * "address": "10:BF:48:CB:00:00", + * "name": "Nexus 7" + * }, { + * "class": 7936, + * "id": "00:06:66:4D:00:00", + * "address": "00:06:66:4D:00:00", + * "name": "RN42" + * }] + * ``` + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'] + }) + static discoverUnpaired () : Promise {return} + + /** + * Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function. + */ + @Cordova({ + platforms: ['Android', 'iOS','Windows Phone'], + observable: true, + clearFunction: 'clearDeviceDiscoveredListener' + }) + static setDeviceDiscoveredListener () : Observable {return} + + /** + * Sets the human readable device name that is broadcasted to other devices + * @param newName Desired name of device + */ + @Cordova({ + platforms: ['Android'], + sync: true + }) + static setName (newName : string) : void {} + + /** + * Makes the device discoverable by other devices + * @param discoverableDuration Desired number of seconds device should be discoverable for + */ + @Cordova({ + platforms: ['Android'], + sync: true + }) + static setDiscoverable (discoverableDuration : number) : void {} + + + +} \ No newline at end of file From 31c298b55662952ed746b7772651b5e5952b02fb Mon Sep 17 00:00:00 2001 From: Rajkiran Panuganti Date: Fri, 29 Apr 2016 13:09:13 -0700 Subject: [PATCH 06/13] Add DeviceAccounts plugin --- src/index.ts | 3 +++ src/plugins/deviceaccounts.ts | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/plugins/deviceaccounts.ts diff --git a/src/index.ts b/src/index.ts index 9754a7730..d5075d104 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,6 +21,7 @@ import {Contacts} from './plugins/contacts'; import {DatePicker} from './plugins/datepicker'; import {DBMeter} from './plugins/dbmeter'; import {Device} from './plugins/device'; +import {DeviceAccounts} from './plugins/deviceaccounts'; import {DeviceMotion} from './plugins/devicemotion'; import {DeviceOrientation} from './plugins/deviceorientation'; import {Diagnostic} from './plugins/diagnostic'; @@ -66,6 +67,7 @@ export { DatePicker, DBMeter, Device, + DeviceAccounts, DeviceMotion, DeviceOrientation, Dialogs, @@ -115,6 +117,7 @@ window['IonicNative'] = { DatePicker: DatePicker, DBMeter: DBMeter, Device: Device, + DeviceAccounts: DeviceAccounts, DeviceMotion: DeviceMotion, DeviceOrientation: DeviceOrientation, Dialogs: Dialogs, diff --git a/src/plugins/deviceaccounts.ts b/src/plugins/deviceaccounts.ts new file mode 100644 index 000000000..20159690d --- /dev/null +++ b/src/plugins/deviceaccounts.ts @@ -0,0 +1,33 @@ +import {Cordova, Plugin} from './plugin'; +declare var window; +@Plugin({ + plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git', + pluginRef: 'plugins.DeviceAccounts', + repo: 'https://github.com/loicknuchel/cordova-device-accounts.git' +}) +export class DeviceAccounts { + +/** + * Gets all accounts registered on the Android Device + */ + @Cordova() + static get() : Promise {return} + +/** + * Get all accounts registred on Android device for requested type + */ + @Cordova() + static getByType(type: string) : Promise {return} + +/** + * Get all emails registred on Android device (accounts with 'com.google' type) + */ + @Cordova() + static getEmails() : Promise {return} + +/** + * Get the first email registred on Android device + */ + @Cordova() + static getEmail() : Promise {return} +} \ No newline at end of file From 926ef7015d901dbd791d31c54780201824b1137c Mon Sep 17 00:00:00 2001 From: perry Date: Fri, 29 Apr 2016 16:09:01 -0500 Subject: [PATCH 07/13] locking down CI to master for now --- circle.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/circle.yml b/circle.yml index 0a86d221d..861353cb3 100644 --- a/circle.yml +++ b/circle.yml @@ -4,6 +4,11 @@ machine: ruby: version: 2.1.2 +general: + branches: + only: + - master # ignore PRs and branches + dependencies: pre: - ./scripts/docs/prepare.sh From d9b847b3cb6a7d400f37a3f3d7c69355b42d59a7 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 17:17:30 -0400 Subject: [PATCH 08/13] feat(plugin): add admob pro plugin closes #146 --- src/index.ts | 3 + src/plugins/admob.ts | 177 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 src/plugins/admob.ts diff --git a/src/index.ts b/src/index.ts index 49ebfa910..059b053ab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ const DEVICE_READY_TIMEOUT = 2000; declare var window; import {ActionSheet} from './plugins/actionsheet'; +import {AdMob} from './plugins/admob'; import {AppAvailability} from './plugins/appavailability'; import {AppRate} from './plugins/apprate'; import {AppVersion} from './plugins/appversion'; @@ -54,6 +55,7 @@ import {WebIntent} from './plugins/webintent'; export { ActionSheet, + AdMob, AppAvailability, AppRate, AppVersion, @@ -107,6 +109,7 @@ export * from './plugins/plugin'; // Window export to use outside of a module loading system window['IonicNative'] = { ActionSheet: ActionSheet, + AdMob: AdMob, AppAvailability: AppAvailability, AppRate: AppRate, AppVersion: AppVersion, diff --git a/src/plugins/admob.ts b/src/plugins/admob.ts new file mode 100644 index 000000000..da7f28042 --- /dev/null +++ b/src/plugins/admob.ts @@ -0,0 +1,177 @@ +import {Plugin, Cordova} from './plugin'; +import {Observable} from "rxjs/Observable"; + +/** + * @name AdMob + * @description + * @usage + */ +@Plugin({ + plugin: 'cordova-plugin-admobpro', + pluginRef: 'AdMob', + repo: 'https://github.com/floatinghotspot/cordova-admob-pro' +}) +export class AdMob { + + // Static Methods + + /** + * + * @param adIdOrOptions + */ + @Cordova() + static createBanner(adIdOrOptions : any) : Promise {return} + + /** + * + */ + @Cordova({ + sync: true + }) + static removeBanner() : void {} + + /** + * + * @param position + */ + @Cordova({ + sync: true + }) + static showBanner(position : any) : void {} + + /** + * + * @param x + * @param y + */ + @Cordova({ + sync: true + }) + static showBannerAtXY(x : number, y : number) : void {} + + /** + * + */ + @Cordova({ + sync: true + }) + static hideBanner() : void {} + + /** + * + * @param adIdOrOptions + */ + @Cordova() + static prepareInterstitial(adIdOrOptions : any) : Promise {return} + + /** + * Show interstitial + */ + @Cordova({ + sync: true + }) + static showInterstitial() : void {} + + /** + * + */ + @Cordova() + static isInterstitialReady () : Promise {return} + + /** + * Prepare a reward video ad + * @param adIdOrOptions + */ + @Cordova() + static prepareRewardVideoAd(adIdOrOptions : any) : Promise {return} + + /** + * Show a reward video ad + */ + @Cordova({ + sync : true + }) + static showRewardVideoAd() : void {} + + /** + * Sets the values for configuration and targeting + * @param options Returns a promise that resolves if the options are set successfully + */ + @Cordova() + static setOptions(options:any) : Promise {return} + + /** + * Get user ad settings + * @returns {Promise} Returns a promise that resolves with the ad settings + */ + @Cordova() + static getAdSettings() : Promise {return} + + // Events + + @Cordova({ + eventObservable: true, + event: 'onBannerFailedToReceive' + }) + static onBannerFailedToReceive () : Observable {return} + + @Cordova({ + eventObservable: true, + event: 'onBannerReceive' + }) + static onBannerReceive () : Observable {return} + + @Cordova({ + eventObservable: true, + event: 'onBannerPresent' + }) + static onBannerPresent () : Observable {return} + + @Cordova({ + eventObservable: true, + event: 'onBannerLeaveApp' + }) + static onBannerLeaveApp () : Observable {return} + + @Cordova({ + eventObservable: true, + event: 'onBannerDismiss' + }) + static onBannerDismiss () : Observable {return} + + + @Cordova({ + eventObservable: true, + event: 'onInterstitialFailedToReceive' + }) + static onInterstitialFailedToReceive () : Observable {return} + + + @Cordova({ + eventObservable: true, + event: 'onInterstitialReceive' + }) + static onInterstitialReceive () : Observable {return} + + + @Cordova({ + eventObservable: true, + event: 'onInterstitialPresent' + }) + static onInterstitialPresent () : Observable {return} + + + @Cordova({ + eventObservable: true, + event: 'onInterstitialLeaveApp' + }) + static onInterstitialLeaveApp () : Observable {return} + + + @Cordova({ + eventObservable: true, + event: 'onInterstitialDismiss' + }) + static onInterstitialDismiss () : Observable {return} + +} \ No newline at end of file From 317437b32e156423535893b7181db235e50345ac Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 17:18:40 -0400 Subject: [PATCH 09/13] fix(BluetoohSerial): add missing plugin reference --- src/plugins/bluetoothserial.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bluetoothserial.ts b/src/plugins/bluetoothserial.ts index c2bfe9553..ad0f20143 100644 --- a/src/plugins/bluetoothserial.ts +++ b/src/plugins/bluetoothserial.ts @@ -9,7 +9,7 @@ import {Observable} from "rxjs/Observable"; @Plugin({ repo: 'https://github.com/don/BluetoothSerial', plugin: 'cordova-plugin-bluetooth-serial', - pluginRef: '', + pluginRef: 'bluetoothSerial', platforms: ['Android','iOS','Windows Phone','Browser'] }) export class BluetoothSerial { From 0a7577cec0b4e3d5b2c717ebb721ea3031809575 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 17:28:02 -0400 Subject: [PATCH 10/13] refactor(DeviceAccounts): formatting --- src/plugins/deviceaccounts.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/deviceaccounts.ts b/src/plugins/deviceaccounts.ts index 20159690d..cc2e86ff5 100644 --- a/src/plugins/deviceaccounts.ts +++ b/src/plugins/deviceaccounts.ts @@ -1,33 +1,32 @@ import {Cordova, Plugin} from './plugin'; -declare var window; @Plugin({ plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git', pluginRef: 'plugins.DeviceAccounts', - repo: 'https://github.com/loicknuchel/cordova-device-accounts.git' + repo: 'https://github.com/loicknuchel/cordova-device-accounts' }) export class DeviceAccounts { -/** - * Gets all accounts registered on the Android Device - */ + /** + * Gets all accounts registered on the Android Device + */ @Cordova() static get() : Promise {return} -/** - * Get all accounts registred on Android device for requested type - */ + /** + * Get all accounts registered on Android device for requested type + */ @Cordova() static getByType(type: string) : Promise {return} -/** - * Get all emails registred on Android device (accounts with 'com.google' type) - */ + /** + * Get all emails registered on Android device (accounts with 'com.google' type) + */ @Cordova() static getEmails() : Promise {return} -/** - * Get the first email registred on Android device - */ + /** + * Get the first email registered on Android device + */ @Cordova() static getEmail() : Promise {return} } \ No newline at end of file From 30bdb1a8f14cc040499300aaea5b86ee3ad46c51 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 17:28:26 -0400 Subject: [PATCH 11/13] refactor(DeviceAccounts): add supported platforms --- src/plugins/deviceaccounts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/deviceaccounts.ts b/src/plugins/deviceaccounts.ts index cc2e86ff5..c3bc0c65b 100644 --- a/src/plugins/deviceaccounts.ts +++ b/src/plugins/deviceaccounts.ts @@ -2,7 +2,8 @@ import {Cordova, Plugin} from './plugin'; @Plugin({ plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git', pluginRef: 'plugins.DeviceAccounts', - repo: 'https://github.com/loicknuchel/cordova-device-accounts' + repo: 'https://github.com/loicknuchel/cordova-device-accounts', + platforms: ['Android'] }) export class DeviceAccounts { From 16ade3abcf4decb293f8a4aa2d878c10be404bcc Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 17:40:08 -0400 Subject: [PATCH 12/13] diable update docs for now --- circle.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/circle.yml b/circle.yml index 861353cb3..d007caa6a 100644 --- a/circle.yml +++ b/circle.yml @@ -9,19 +9,19 @@ general: only: - master # ignore PRs and branches -dependencies: - pre: - - ./scripts/docs/prepare.sh - cache_directories: - - "~/ionic-site" # cache ionic-site +#dependencies: +# pre: +# - ./scripts/docs/prepare.sh +# cache_directories: +# - "~/ionic-site" # cache ionic-site test: override: - echo "No tests are written at the moment. But we will attempt to build the library with the latest changes." - npm run build_bundle -deployment: - staging: - branch: master - commands: - - ./scripts/docs/update_docs.sh +#deployment: +# staging: +# branch: master +# commands: +# - ./scripts/docs/update_docs.sh From 8abdc11cc97c4c3a1c929a4721b2c3ee7486a61e Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Fri, 29 Apr 2016 18:08:16 -0400 Subject: [PATCH 13/13] chore(build): add gulp minify task --- gulpfile.js | 12 ++++++++++++ package.json | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 55d9f4af3..c81505f58 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,7 @@ var gulp = require('gulp'); var minimist = require('minimist'); +var uglify = require('gulp-uglify'); +var rename = require("gulp-rename"); var flagConfig = { string: ['port', 'version', 'ngVersion', 'animations'], @@ -11,3 +13,13 @@ var flags = minimist(process.argv.slice(2), flagConfig); /* Docs tasks */ require('./scripts/docs/gulp-tasks')(gulp, flags); + + +gulp.task("minify:dist", function(){ + gulp.src('./dist/ionic.native.js') + .pipe(uglify()) + .pipe(rename({ + suffix: '.min' + })) + .pipe(gulp.dest('./dist')); +}); diff --git a/package.json b/package.json index 97a8d7004..207322064 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "dgeni-packages": "^0.10.18", "glob": "^6.0.4", "gulp": "~3.9.0", + "gulp-rename": "^1.2.2", + "gulp-uglify": "^1.5.3", "lodash": "3.10.1", "minimist": "^1.1.3", "mkdirp": "^0.5.1", @@ -33,7 +35,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc --module commonjs --sourcemap --outDir dist/ --experimentalDecorators -d typings/es6-shim/es6-shim.d.ts src/index.ts --target ES5", - "build_bundle": "npm run-script build && browserify dist/index.js > dist/ionic.native.js" + "build_bundle": "npm run-script build && browserify dist/index.js > dist/ionic.native.js && gulp minify:dist" }, "repository": { "type": "git",