diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..32e648ff1 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,40 @@ +0 info it worked if it ends with ok +1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', +1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', +1 verbose cli 'run', +1 verbose cli 'build_bundle' ] +2 info using npm@2.14.12 +3 info using node@v4.2.4 +4 verbose run-script [ 'prebuild_bundle', 'build_bundle', 'postbuild_bundle' ] +5 info prebuild_bundle ionic-native@1.1.0 +6 info build_bundle ionic-native@1.1.0 +7 verbose unsafe-perm in lifecycle true +8 info ionic-native@1.1.0 Failed to exec build_bundle script +9 verbose stack Error: ionic-native@1.1.0 build_bundle: `npm run-script build && browserify dist/index.js > dist/ionic.native.js` +9 verbose stack Exit status 1 +9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16) +9 verbose stack at emitTwo (events.js:87:13) +9 verbose stack at EventEmitter.emit (events.js:172:7) +9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14) +9 verbose stack at emitTwo (events.js:87:13) +9 verbose stack at ChildProcess.emit (events.js:172:7) +9 verbose stack at maybeClose (internal/child_process.js:818:16) +9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) +10 verbose pkgid ionic-native@1.1.0 +11 verbose cwd C:\Users\Ibrahim\WebstormProjects\ionic-native +12 error Windows_NT 10.0.10586 +13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build_bundle" +14 error node v4.2.4 +15 error npm v2.14.12 +16 error code ELIFECYCLE +17 error ionic-native@1.1.0 build_bundle: `npm run-script build && browserify dist/index.js > dist/ionic.native.js` +17 error Exit status 1 +18 error Failed at the ionic-native@1.1.0 build_bundle script 'npm run-script build && browserify dist/index.js > dist/ionic.native.js'. +18 error This is most likely a problem with the ionic-native package, +18 error not with npm itself. +18 error Tell the author that this fails on your system: +18 error npm run-script build && browserify dist/index.js > dist/ionic.native.js +18 error You can get their info via: +18 error npm owner ls ionic-native +18 error There is likely additional logging output above. +19 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 9fc9812bd..97a8d7004 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": { diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index d01772eee..d22083a10 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 @>ionic plugin add <$ prop.plugin $><@ endif -@>

Repo: <$ prop.repo $> diff --git a/scripts/docs/update_docs.sh b/scripts/docs/update_docs.sh index 15d56d148..d765238b4 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!" diff --git a/src/index.ts b/src/index.ts index 3b2a564ba..442d7be5f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,13 +23,16 @@ 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 {EmailComposer} from './plugins/emailcomposer'; import {Facebook} from './plugins/facebook'; import {File} from './plugins/file'; import {Flashlight} from './plugins/flashlight'; import {Geolocation} from './plugins/geolocation'; import {Globalization} from './plugins/globalization'; import {GoogleMaps} from './plugins/googlemaps'; +import {GoogleAnalytics} from './plugins/googleanalytics'; import {Hotspot} from './plugins/hotspot'; import {ImagePicker} from './plugins/imagepicker'; import {InAppBrowser} from './plugins/inappbrowser'; @@ -48,6 +51,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, @@ -70,12 +74,15 @@ export { DeviceMotion, DeviceOrientation, Dialogs, + Diagnostic, + EmailComposer, Facebook, File, Flashlight, Geolocation, Globalization, GoogleMaps, + GoogleAnalytics, Hotspot, ImagePicker, InAppBrowser, @@ -93,7 +100,8 @@ export { StatusBar, Toast, TouchID, - Vibration + Vibration, + WebIntent } export * from './plugins/plugin'; @@ -120,12 +128,15 @@ window['IonicNative'] = { DeviceMotion: DeviceMotion, DeviceOrientation: DeviceOrientation, Dialogs: Dialogs, + Diagnostic: Diagnostic, + EmailComposer: EmailComposer, Facebook: Facebook, File: File, Flashlight: Flashlight, Geolocation: Geolocation, Globalization: Globalization, GoogleMaps : GoogleMaps, + GoogleAnalytics: GoogleAnalytics, Hotspot: Hotspot, ImagePicker: ImagePicker, InAppBrowser: InAppBrowser, @@ -143,7 +154,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 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 | * diff --git a/src/plugins/barcodescanner.ts b/src/plugins/barcodescanner.ts index cc76e1918..55caba6c7 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 { 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 +} diff --git a/src/plugins/contacts.ts b/src/plugins/contacts.ts index ea0d281da..ac5152bc0 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({ 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); * }); * diff --git a/src/plugins/diagnostic.ts b/src/plugins/diagnostic.ts new file mode 100644 index 000000000..d75991665 --- /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 diff --git a/src/plugins/emailcomposer.ts b/src/plugins/emailcomposer.ts new file mode 100644 index 000000000..d07e46d49 --- /dev/null +++ b/src/plugins/emailcomposer.ts @@ -0,0 +1,99 @@ +import {Plugin, Cordova} from './plugin'; + +declare var cordova; + +/** + * Email object for Opening Email Composer + */ +export interface email { + app?: string, + 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'; + * + * + * EmailComposer.isAvailable().then((available) =>{ + * if(available) { + * //Now we know we can send + * } + * }); + * + * 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: 'cordova.plugins.email', + repo: 'https://github.com/katzer/cordova-plugin-email-composer.git', + platforms: ['Android', 'iOS', 'Windows Phone 8'] +}) +export class EmailComposer { + + /** + * 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 {} + + /** + * 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} + +} diff --git a/src/plugins/facebook.ts b/src/plugins/facebook.ts index e3a86a5b0..e59918e52 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 { diff --git a/src/plugins/googleanalytics.ts b/src/plugins/googleanalytics.ts new file mode 100644 index 000000000..1436f4a8b --- /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: number, 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 } +} diff --git a/src/plugins/localnotifications.ts b/src/plugins/localnotifications.ts index a54ba2c59..6bbc7c885 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 * }); @@ -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. @@ -273,4 +273,4 @@ export interface Notification { * Default: FFFFFF */ led? : string -} \ No newline at end of file +} diff --git a/src/plugins/network.ts b/src/plugins/network.ts index b3c6578a2..31d47ff5f 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) { 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. */ diff --git a/src/plugins/vibration.ts b/src/plugins/vibration.ts index 77185154e..2711ae090 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 { 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