mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
chore(index): update index
This commit is contained in:
commit
584312ec7f
40
npm-debug.log
Normal file
40
npm-debug.log
Normal file
@ -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.<anonymous> (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.<anonymous> (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 ]
|
@ -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": {
|
||||
|
3
scripts/docs/templates/common.template.html
vendored
3
scripts/docs/templates/common.template.html
vendored
@ -116,8 +116,9 @@ docType: "<$ doc.docType $>"
|
||||
|
||||
<!-- decorators -->
|
||||
<@- if doc.decorators @>
|
||||
|
||||
<@ for prop in doc.decorators[0].argumentInfo @>
|
||||
<pre><code>$ cordova plugin add <$ prop.plugin $></code></pre>
|
||||
<pre><code>$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif -@></code></pre>
|
||||
<p>Repo:
|
||||
<a href="<$ prop.repo $>">
|
||||
<$ prop.repo $>
|
||||
|
@ -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!"
|
||||
|
16
src/index.ts
16
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
|
||||
|
@ -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 |
|
||||
*
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -37,7 +37,7 @@ export class BatteryStatus {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterylevel'
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange () : Observable<StatusObject> {return}
|
||||
|
||||
|
@ -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({
|
||||
|
@ -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);
|
||||
* });
|
||||
*
|
||||
|
188
src/plugins/diagnostic.ts
Normal file
188
src/plugins/diagnostic.ts
Normal file
@ -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<boolean>((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 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
*/
|
||||
@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<boolean>((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<boolean>((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 <uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
*/
|
||||
@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<boolean>((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<string>((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<boolean>((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<boolean>((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<boolean>((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<boolean>((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<boolean>((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<boolean>((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<boolean>((res, rej) => {});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
99
src/plugins/emailcomposer.ts
Normal file
99
src/plugins/emailcomposer.ts
Normal file
@ -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<string>,
|
||||
cc: string | Array<string>,
|
||||
bcc: string | Array<string>,
|
||||
attachments: Array<any>,
|
||||
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<boolean>} Resolves promise with boolean whether EmailComposer is available
|
||||
*/
|
||||
static isAvailable (app? : string, scope? : any) : Promise<boolean> {
|
||||
return new Promise<boolean>((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<any>} Resolves promise when the EmailComposer has been opened
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 3
|
||||
})
|
||||
static open(email : email, scope? : any) : Promise<any> {return}
|
||||
|
||||
}
|
@ -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 {
|
||||
|
||||
|
123
src/plugins/googleanalytics.ts
Normal file
123
src/plugins/googleanalytics.ts
Normal file
@ -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<any> { return }
|
||||
|
||||
/**
|
||||
* Track a screen
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
|
||||
*
|
||||
* @param {string} title Screen title
|
||||
*/
|
||||
@Cordova()
|
||||
static trackView(title: string): Promise<any> { 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<any> { return }
|
||||
|
||||
/**
|
||||
* Track an exception
|
||||
* @param {string} description
|
||||
* @param {boolean} fatal
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { 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<any> { 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<any> { 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<any> { 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<any> { return }
|
||||
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param {boolean} shouldEnable
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return }
|
||||
}
|
@ -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<Notification>) : void {}
|
||||
|
||||
/**
|
||||
* Updates a previously scheduled notification. Must include the id in the options parameter.
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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 {
|
||||
|
38
src/plugins/webintent.ts
Normal file
38
src/plugins/webintent.ts
Normal file
@ -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<any> {return}
|
||||
|
||||
@Cordova()
|
||||
static hasExtra (extra : any) : Promise<any> {return}
|
||||
|
||||
@Cordova()
|
||||
static getExtra (extra : any) : Promise<any> {return}
|
||||
|
||||
@Cordova()
|
||||
static getUri () : Promise<string> {return};
|
||||
|
||||
@Cordova()
|
||||
static onNewIntent() : Promise<string> {return};
|
||||
|
||||
@Cordova()
|
||||
static sendBroadcast(options : {action:string, extras?:{option:boolean}}) : Promise<any> {return}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user