mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
Merge branch 'master' of https://github.com/driftyco/ionic-native
This commit is contained in:
commit
9c78837113
2
scripts/docs/templates/common.template.html
vendored
2
scripts/docs/templates/common.template.html
vendored
@ -118,7 +118,7 @@ docType: "<$ doc.docType $>"
|
||||
<@- if doc.decorators @>
|
||||
|
||||
<@ for prop in doc.decorators[0].argumentInfo @>
|
||||
<pre><code>$ <@ if prop.install @><$ prop.install $><@ else @>cordova plugin add <$ prop.plugin $><@ endif -@></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 $>
|
||||
|
13
src/index.ts
13
src/index.ts
@ -25,11 +25,13 @@ 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 {GoogleAnalytics} from './plugins/googleanalytics';
|
||||
import {Hotspot} from './plugins/hotspot';
|
||||
import {ImagePicker} from './plugins/imagepicker';
|
||||
import {InAppBrowser} from './plugins/inappbrowser';
|
||||
@ -46,6 +48,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,
|
||||
@ -69,11 +72,13 @@ export {
|
||||
DeviceOrientation,
|
||||
Dialogs,
|
||||
Diagnostic,
|
||||
EmailComposer,
|
||||
Facebook,
|
||||
File,
|
||||
Flashlight,
|
||||
Geolocation,
|
||||
Globalization,
|
||||
GoogleAnalytics,
|
||||
Hotspot,
|
||||
ImagePicker,
|
||||
InAppBrowser,
|
||||
@ -89,7 +94,8 @@ export {
|
||||
StatusBar,
|
||||
Toast,
|
||||
TouchID,
|
||||
Vibration
|
||||
Vibration,
|
||||
WebIntent
|
||||
}
|
||||
|
||||
export * from './plugins/plugin';
|
||||
@ -117,11 +123,13 @@ window['IonicNative'] = {
|
||||
DeviceOrientation: DeviceOrientation,
|
||||
Dialogs: Dialogs,
|
||||
Diagnostic: Diagnostic,
|
||||
EmailComposer: EmailComposer,
|
||||
Facebook: Facebook,
|
||||
File: File,
|
||||
Flashlight: Flashlight,
|
||||
Geolocation: Geolocation,
|
||||
Globalization: Globalization,
|
||||
GoogleAnalytics: GoogleAnalytics,
|
||||
Hotspot: Hotspot,
|
||||
ImagePicker: ImagePicker,
|
||||
InAppBrowser: InAppBrowser,
|
||||
@ -137,7 +145,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 |
|
||||
*
|
||||
|
@ -37,7 +37,7 @@ export class BatteryStatus {
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'batterylevel'
|
||||
event: 'batterystatus'
|
||||
})
|
||||
static onChange () : Observable<StatusObject> {return}
|
||||
|
||||
@ -73,4 +73,4 @@ export interface StatusObject {
|
||||
* A boolean that indicates whether the device is plugged in
|
||||
*/
|
||||
isPlugged : boolean
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
* });
|
||||
*
|
||||
|
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}
|
||||
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
|
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