mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-05-10 21:07:06 +08:00
Merge branch 'master' into v5
This commit is contained in:
commit
83680aad96
@ -1,8 +1,12 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
import {
|
||||||
|
Cordova,
|
||||||
|
CordovaCheck,
|
||||||
|
IonicNativePlugin,
|
||||||
|
Plugin
|
||||||
|
} from '@ionic-native/core';
|
||||||
|
|
||||||
export interface EmailComposerOptions {
|
export interface EmailComposerOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App to send the email with
|
* App to send the email with
|
||||||
*/
|
*/
|
||||||
@ -43,9 +47,12 @@ export interface EmailComposerOptions {
|
|||||||
*/
|
*/
|
||||||
isHtml?: boolean;
|
isHtml?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Content type of the email (Android only)
|
||||||
|
*/
|
||||||
|
type?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Email Composer
|
* @name Email Composer
|
||||||
* @description
|
* @description
|
||||||
@ -106,11 +113,10 @@ export interface EmailComposerOptions {
|
|||||||
plugin: 'cordova-plugin-email-composer',
|
plugin: 'cordova-plugin-email-composer',
|
||||||
pluginRef: 'cordova.plugins.email',
|
pluginRef: 'cordova.plugins.email',
|
||||||
repo: 'https://github.com/katzer/cordova-plugin-email-composer',
|
repo: 'https://github.com/katzer/cordova-plugin-email-composer',
|
||||||
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
|
platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows', 'macOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EmailComposer extends IonicNativePlugin {
|
export class EmailComposer extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies if sending emails is supported on the device.
|
* Verifies if sending emails is supported on the device.
|
||||||
*
|
*
|
||||||
@ -171,8 +177,7 @@ export class EmailComposer extends IonicNativePlugin {
|
|||||||
* @param packageName {string} The package name
|
* @param packageName {string} The package name
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
addAlias(alias: string, packageName: string): void {
|
addAlias(alias: string, packageName: string): void {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the email composer pre-filled with data.
|
* Displays the email composer pre-filled with data.
|
||||||
@ -188,5 +193,4 @@ export class EmailComposer extends IonicNativePlugin {
|
|||||||
open(options: EmailComposerOptions, scope?: any): Promise<any> {
|
open(options: EmailComposerOptions, scope?: any): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,24 @@ export interface ImageResizerOptions {
|
|||||||
*/
|
*/
|
||||||
uri: string;
|
uri: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the folder the image should be put
|
||||||
|
* (Android only)
|
||||||
|
*/
|
||||||
|
folderName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A custom name for the file. Default name is a timestamp. You have to set this value on iOS
|
||||||
|
*/
|
||||||
|
fileName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Quality given as Number for the quality of the new image
|
||||||
|
* (Android and iOS only)
|
||||||
|
*/
|
||||||
|
quality?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The width of the new image
|
* The width of the new image
|
||||||
*/
|
*/
|
||||||
@ -18,22 +36,10 @@ export interface ImageResizerOptions {
|
|||||||
height: number;
|
height: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the folder the image should be put
|
* Whether or not to return a base64 encoded image string instead of the path to the resized image.
|
||||||
* (Android only)
|
* iOS only
|
||||||
*/
|
*/
|
||||||
folderName?: string;
|
base64?: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Quality given as Number for the quality of the new image
|
|
||||||
* (Android and iOS only)
|
|
||||||
*/
|
|
||||||
quality?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A custom name for the file. Default name is a timestamp. You have to set this value on iOS
|
|
||||||
*/
|
|
||||||
fileName?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
export interface QRScannerStatus {
|
export interface QRScannerStatus {
|
||||||
@ -86,11 +87,6 @@ export interface QRScannerStatus {
|
|||||||
* scanSub.unsubscribe(); // stop scanning
|
* scanSub.unsubscribe(); // stop scanning
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* // show camera preview
|
|
||||||
* this.qrScanner.show();
|
|
||||||
*
|
|
||||||
* // wait for user to scan something, then the observable callback will be called
|
|
||||||
*
|
|
||||||
* } else if (status.denied) {
|
* } else if (status.denied) {
|
||||||
* // camera permission was permanently denied
|
* // camera permission was permanently denied
|
||||||
* // you must use QRScanner.openSettings() method to guide the user to the settings page
|
* // you must use QRScanner.openSettings() method to guide the user to the settings page
|
||||||
|
@ -1,28 +1,23 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options for sending an SMS
|
* Options for sending an SMS
|
||||||
*/
|
*/
|
||||||
export interface SmsOptions {
|
export interface SmsOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true to replace \n by a new line. Default: false
|
* Set to true to replace \n by a new line. Default: false
|
||||||
*/
|
*/
|
||||||
replaceLineBreaks?: boolean;
|
replaceLineBreaks?: boolean;
|
||||||
|
|
||||||
android?: SmsOptionsAndroid;
|
android?: SmsOptionsAndroid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SmsOptionsAndroid {
|
export interface SmsOptionsAndroid {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to "INTENT" to send SMS with the native android SMS messaging. Leaving it empty will send the SMS without opening any app.
|
* Set to "INTENT" to send SMS with the native android SMS messaging. Leaving it empty will send the SMS without opening any app.
|
||||||
*/
|
*/
|
||||||
intent?: string;
|
intent?: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,7 +52,6 @@ export interface SmsOptionsAndroid {
|
|||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SMS extends IonicNativePlugin {
|
export class SMS extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends sms to a number
|
* Sends sms to a number
|
||||||
* @param phoneNumber {string|Array<string>} Phone number
|
* @param phoneNumber {string|Array<string>} Phone number
|
||||||
@ -69,9 +63,11 @@ export class SMS extends IonicNativePlugin {
|
|||||||
successIndex: 3,
|
successIndex: 3,
|
||||||
errorIndex: 4
|
errorIndex: 4
|
||||||
})
|
})
|
||||||
send(phoneNumber: string | string[],
|
send(
|
||||||
message: string,
|
phoneNumber: string | string[],
|
||||||
options?: SmsOptions): Promise<any> {
|
message: string,
|
||||||
|
options?: SmsOptions
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,5 +81,4 @@ export class SMS extends IonicNativePlugin {
|
|||||||
hasPermission(): Promise<boolean> {
|
hasPermission(): Promise<boolean> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Social Sharing
|
* @name Social Sharing
|
||||||
* @description
|
* @description
|
||||||
@ -53,7 +52,12 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
successIndex: 4,
|
successIndex: 4,
|
||||||
errorIndex: 5
|
errorIndex: 5
|
||||||
})
|
})
|
||||||
share(message?: string, subject?: string, file?: string | string[], url?: string): Promise<any> {
|
share(
|
||||||
|
message?: string,
|
||||||
|
subject?: string,
|
||||||
|
file?: string | string[],
|
||||||
|
url?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +69,13 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
@Cordova({
|
@Cordova({
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
shareWithOptions(options: { message?: string, subject?: string, files?: string | string[], url?: string, chooserTitle?: string }): Promise<any> {
|
shareWithOptions(options: {
|
||||||
|
message?: string;
|
||||||
|
subject?: string;
|
||||||
|
files?: string | string[];
|
||||||
|
url?: string;
|
||||||
|
chooserTitle?: string;
|
||||||
|
}): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +93,13 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
errorIndex: 6,
|
errorIndex: 6,
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
canShareVia(appName: string, message?: string, subject?: string, image?: string, url?: string): Promise<any> {
|
canShareVia(
|
||||||
|
appName: string,
|
||||||
|
message?: string,
|
||||||
|
subject?: string,
|
||||||
|
image?: string,
|
||||||
|
url?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,11 +131,14 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
errorIndex: 4,
|
errorIndex: 4,
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
shareViaFacebook(message: string, image?: string, url?: string): Promise<any> {
|
shareViaFacebook(
|
||||||
|
message: string,
|
||||||
|
image?: string,
|
||||||
|
url?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shares directly to Facebook with a paste message hint
|
* Shares directly to Facebook with a paste message hint
|
||||||
* @param message {string}
|
* @param message {string}
|
||||||
@ -133,7 +152,12 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
errorIndex: 5,
|
errorIndex: 5,
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
shareViaFacebookWithPasteMessageHint(message: string, image?: string, url?: string, pasteMessageHint?: string): Promise<any> {
|
shareViaFacebookWithPasteMessageHint(
|
||||||
|
message: string,
|
||||||
|
image?: string,
|
||||||
|
url?: string,
|
||||||
|
pasteMessageHint?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +186,11 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
errorIndex: 4,
|
errorIndex: 4,
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
shareViaWhatsApp(message: string, image?: string, url?: string): Promise<any> {
|
shareViaWhatsApp(
|
||||||
|
message: string,
|
||||||
|
image?: string,
|
||||||
|
url?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +207,12 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
errorIndex: 5,
|
errorIndex: 5,
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
shareViaWhatsAppToReceiver(receiver: string, message: string, image?: string, url?: string): Promise<any> {
|
shareViaWhatsAppToReceiver(
|
||||||
|
receiver: string,
|
||||||
|
message: string,
|
||||||
|
image?: string,
|
||||||
|
url?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +255,14 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
successIndex: 6,
|
successIndex: 6,
|
||||||
errorIndex: 7
|
errorIndex: 7
|
||||||
})
|
})
|
||||||
shareViaEmail(message: string, subject: string, to: string[], cc?: string[], bcc?: string[], files?: string | string[]): Promise<any> {
|
shareViaEmail(
|
||||||
|
message: string,
|
||||||
|
subject: string,
|
||||||
|
to: string[],
|
||||||
|
cc?: string[],
|
||||||
|
bcc?: string[],
|
||||||
|
files?: string | string[]
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +280,13 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
errorIndex: 6,
|
errorIndex: 6,
|
||||||
platforms: ['iOS', 'Android']
|
platforms: ['iOS', 'Android']
|
||||||
})
|
})
|
||||||
shareVia(appName: string, message: string, subject?: string, image?: string, url?: string): Promise<any> {
|
shareVia(
|
||||||
|
appName: string,
|
||||||
|
message: string,
|
||||||
|
subject?: string,
|
||||||
|
image?: string,
|
||||||
|
url?: string
|
||||||
|
): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,6 +298,17 @@ export class SocialSharing extends IonicNativePlugin {
|
|||||||
sync: true,
|
sync: true,
|
||||||
platforms: ['iOS']
|
platforms: ['iOS']
|
||||||
})
|
})
|
||||||
setIPadPopupCoordinates(targetBounds: string): void {
|
setIPadPopupCoordinates(targetBounds: string): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save an array of images to the camera roll
|
||||||
|
* @param {string|string[]} fileOrFileArray Single or multiple files
|
||||||
|
* @returns {Promise<any> }
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
platforms: ['iOS']
|
||||||
|
})
|
||||||
|
saveToPhotoAlbum(fileOrFileArray: string | string[]): Promise<any> {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,11 @@ export interface SpeechRecognitionListeningOptionsAndroid {
|
|||||||
* display listener popup window with prompt (default `true`)
|
* display listener popup window with prompt (default `true`)
|
||||||
*/
|
*/
|
||||||
showPopup?: boolean;
|
showPopup?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow partial results to be returned (default `false`)
|
||||||
|
*/
|
||||||
|
showPartial?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,9 +134,7 @@ export class SpeechRecognition extends IonicNativePlugin {
|
|||||||
/**
|
/**
|
||||||
* Stop the recognition process
|
* Stop the recognition process
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova()
|
||||||
platforms: ['iOS']
|
|
||||||
})
|
|
||||||
stopListening(): Promise<void> {
|
stopListening(): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,11 @@ import { CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
|||||||
pluginName: 'Uid',
|
pluginName: 'Uid',
|
||||||
plugin: 'cordova-plugin-uid',
|
plugin: 'cordova-plugin-uid',
|
||||||
pluginRef: 'cordova.plugins.uid',
|
pluginRef: 'cordova.plugins.uid',
|
||||||
repo: 'https://github.com/hygieiasoft/cordova-plugin-uid',
|
repo: 'https://github.com/lionelhe/cordova-plugin-uid',
|
||||||
platforms: ['Android']
|
platforms: ['Android']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Uid extends IonicNativePlugin {
|
export class Uid extends IonicNativePlugin {
|
||||||
|
|
||||||
/** Get the device Universally Unique Identifier (UUID). */
|
/** Get the device Universally Unique Identifier (UUID). */
|
||||||
@CordovaProperty()
|
@CordovaProperty()
|
||||||
UUID: string;
|
UUID: string;
|
||||||
|
42
src/@ionic-native/plugins/uptime/index.ts
Normal file
42
src/@ionic-native/plugins/uptime/index.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Uptime
|
||||||
|
* @description
|
||||||
|
* This plugin return the device uptime, without sleep time.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { Uptime } from '@ionic-native/uptime';
|
||||||
|
*
|
||||||
|
* constructor(private uptime: Uptime) { }
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* this.uptime.getUptime()
|
||||||
|
* .then((uptime: any) => console.log(uptime))
|
||||||
|
* .catch((error: any) => console.log(error));
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'Uptime',
|
||||||
|
plugin: 'cordova-plugin-uptime',
|
||||||
|
pluginRef: 'Uptime',
|
||||||
|
repo: 'https://github.com/s1lviu/cordova-plugin-uptime',
|
||||||
|
install: '',
|
||||||
|
installVariables: [],
|
||||||
|
platforms: ['Android']
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class Uptime extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* This function return system uptime
|
||||||
|
* @return {Promise<string>} Returns a promise that return the uptime in milliseconds
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getUptime(): Promise<string> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user