mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
Merge branch 'master' into v5
This commit is contained in:
@@ -159,25 +159,47 @@ export interface AFADeleteOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class AndroidFingerprintAuth extends IonicNativePlugin {
|
||||
/**
|
||||
* Convenience property containing all possible errors
|
||||
*/
|
||||
ERRORS: {
|
||||
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION';
|
||||
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION';
|
||||
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED';
|
||||
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED';
|
||||
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR';
|
||||
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE';
|
||||
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED';
|
||||
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST';
|
||||
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION';
|
||||
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED';
|
||||
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION';
|
||||
IO_EXCEPTION: 'IO_EXCEPTION';
|
||||
JSON_EXCEPTION: 'JSON_EXCEPTION';
|
||||
MINIMUM_SDK: 'MINIMUM_SDK';
|
||||
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS';
|
||||
MISSING_PARAMETERS: 'MISSING_PARAMETERS';
|
||||
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION';
|
||||
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION';
|
||||
BAD_PADDING_EXCEPTION: string;
|
||||
CERTIFICATE_EXCEPTION: string;
|
||||
FINGERPRINT_CANCELLED: string;
|
||||
FINGERPRINT_DATA_NOT_DELETED: string;
|
||||
FINGERPRINT_ERROR: string;
|
||||
FINGERPRINT_NOT_AVAILABLE: string;
|
||||
FINGERPRINT_PERMISSION_DENIED: string;
|
||||
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: string;
|
||||
ILLEGAL_BLOCK_SIZE_EXCEPTION: string;
|
||||
INIT_CIPHER_FAILED: string;
|
||||
INVALID_ALGORITHM_PARAMETER_EXCEPTION: string;
|
||||
IO_EXCEPTION: string;
|
||||
JSON_EXCEPTION: string;
|
||||
MINIMUM_SDK: string;
|
||||
MISSING_ACTION_PARAMETERS: string;
|
||||
MISSING_PARAMETERS: string;
|
||||
NO_SUCH_ALGORITHM_EXCEPTION: string;
|
||||
SECURITY_EXCEPTION: string;
|
||||
} = {
|
||||
BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION',
|
||||
CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION',
|
||||
FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED',
|
||||
FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED',
|
||||
FINGERPRINT_ERROR: 'FINGERPRINT_ERROR',
|
||||
FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE',
|
||||
FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED',
|
||||
FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST',
|
||||
ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION',
|
||||
INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED',
|
||||
INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION',
|
||||
IO_EXCEPTION: 'IO_EXCEPTION',
|
||||
JSON_EXCEPTION: 'JSON_EXCEPTION',
|
||||
MINIMUM_SDK: 'MINIMUM_SDK',
|
||||
MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS',
|
||||
MISSING_PARAMETERS: 'MISSING_PARAMETERS',
|
||||
NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION',
|
||||
SECURITY_EXCEPTION: 'SECURITY_EXCEPTION'
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Appodeal
|
||||
|
||||
@@ -476,14 +476,13 @@ export class BackgroundGeolocation extends IonicNativePlugin {
|
||||
* Method can be used to detect user changes in location services settings.
|
||||
* If user enable or disable location services then success callback will be executed.
|
||||
* In case or error (SettingNotFoundException) fail callback will be executed.
|
||||
* @returns {Promise<boolean>}
|
||||
* @returns {Observable<number>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android']
|
||||
platforms: ['Android'],
|
||||
observable: true
|
||||
})
|
||||
watchLocationMode(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
watchLocationMode(): Observable<number> { return; }
|
||||
|
||||
/**
|
||||
* Stop watching for location mode changes.
|
||||
|
||||
@@ -289,6 +289,71 @@ export class BLE extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Establish an automatic connection to a peripheral.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.autoConnect('12:34:56:78:9A:BC').subscribe(peripheralData => {
|
||||
* console.log(peripheralData);
|
||||
* },
|
||||
* peripheralData => {
|
||||
* console.log('disconnected');
|
||||
* });
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @return {Observable<any>} Returns an Observable that notifies of connect/disconnect.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'disconnect',
|
||||
clearWithArgs: true
|
||||
})
|
||||
autoConnect(deviceId: string): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request MTU size.
|
||||
* May be used to fix the Error 14 "Unlikely" on write requests with more than 20 bytes.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.requestMtu('12:34:56:78:9A:BC', 512).then(() => {
|
||||
* console.log('MTU Size Accepted');
|
||||
* }, error => {
|
||||
* console.log('MTU Size Failed');
|
||||
* });
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {number} mtuSize The new MTU size. (23 - 517, default is usually 23. Max recommended: 512)
|
||||
* @return {Promise<any>} Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
requestMtu(deviceId: string, mtuSize: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh Device Cache
|
||||
* This method may fix a issue of old cached services and characteristics.
|
||||
* NOTE Since this uses an undocumented API it's not guaranteed to work.
|
||||
* If you choose a too low delay time (timeoutMillis) the method could fail.
|
||||
* @usage
|
||||
* ```
|
||||
* BLE.refreshDeviceCache('12:34:56:78:9A:BC', 10000).then(discoveredServices => {
|
||||
* console.log('The new discovered services after the clean: ', discoveredServices);
|
||||
* }, error => {
|
||||
* console.log('Refresh device cache failed.');
|
||||
* });
|
||||
* ```
|
||||
* @param {string} deviceId UUID or MAC address of the peripheral
|
||||
* @param {number} timeoutMillis Delay in milliseconds after refresh before discovering services.
|
||||
* @return {Promise<any>} Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
refreshDeviceCache(deviceId: string, timeoutMillis: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from a peripheral.
|
||||
* @usage
|
||||
|
||||
@@ -129,6 +129,12 @@ export interface CardIOResponse {
|
||||
* @name Card IO
|
||||
* @description
|
||||
* @usage
|
||||
* This plug-in exposes card.io credit card scanning.
|
||||
*
|
||||
* **NOTE**: If you would like to actually process a credit card charge, you might be interested in the [PayPal Cordova Plug-in](https://github.com/paypal/PayPal-Cordova-Plugin).
|
||||
*
|
||||
* Requires Cordova plugin: `card.io.cordova.mobilesdk`. For more info, please see the [Card IO plugin docs](https://github.com/card-io/card.io-Cordova-Plugin).
|
||||
*
|
||||
* Note: For use with iOS 10 + When building your app with the iOS 10 SDK +, you have to add some info to the info.plist file. This is due to increased security in iOS 10. Go to your app directory and search for the <your app name>Info.plist file. Add the following lines in the main <dict> element.
|
||||
* ```xml
|
||||
* <key>NSCameraUsageDescription</key>
|
||||
@@ -150,8 +156,8 @@ export interface CardIOResponse {
|
||||
* requireExpiry: true,
|
||||
* requireCVV: false,
|
||||
* requirePostalCode: false
|
||||
* }
|
||||
* CardIO.scan(options);
|
||||
* };
|
||||
* this.cardIO.scan(options);
|
||||
* }
|
||||
* }
|
||||
* );
|
||||
|
||||
@@ -63,7 +63,6 @@ export class Clipboard extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a promise after the text has been cleaned
|
||||
*/
|
||||
@Cordova()
|
||||
clear(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
clear(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Cloud Settings
|
||||
* @description
|
||||
* Stores app settings in cloud storage so if the user re-installs the app or installs it on a different device, the settings will be restored and available in the new installation.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { CloudSettings } from '@ionic-native/cloud-settings';
|
||||
*
|
||||
*
|
||||
* constructor(private cloudSettings: CloudSettings) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.cloudSettings.exists()
|
||||
* .then((exists: boolean) => console.log("Saved settings exist: " + exists) )
|
||||
*
|
||||
* this.cloudSettings.load()
|
||||
* .then((settings: any) => this.settings = settings)
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.cloudSettings.save(this.settings)
|
||||
* .then((savedSettings: any) => console.log("Saved settings: " + JSON.stringify(savedSettings)))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'CloudSettings',
|
||||
plugin: 'cordova-plugin-cloud-settings',
|
||||
pluginRef: 'cordova.plugin.cloudsettings',
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-cloud-settings',
|
||||
install:
|
||||
'ionic cordova plugin add cordova-plugin-cloud-settings --variable ANDROID_BACKUP_SERVICE_KEY=myapikey',
|
||||
installVariables: ['ANDROID_BACKUP_SERVICE_KEY'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class CloudSettings extends IonicNativePlugin {
|
||||
/**
|
||||
* Indicates if any stored cloud settings currently exist for the current user.
|
||||
* @return {Promise<boolean>} Will be passed a boolean flag which indicates whether an store settings exist for the user.
|
||||
*/
|
||||
@Cordova()
|
||||
exists(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the settings to cloud backup.
|
||||
* @param {object} settings - a JSON structure representing the user settings to save to cloud backup.
|
||||
* @param {boolean} [overwrite] - (optional) if true, existing settings will be replaced rather than updated. Defaults to false.
|
||||
* If false, existing settings will be merged with the new settings passed to this function.
|
||||
* @return {Promise<any>} Will be passed a single object argument which contains the saved settings as a JSON object.
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
save(settings: any, overwrite?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the current settings.
|
||||
* @return {Promise<any>} Will be passed a single object argument which contains the saved settings as a JSON object.
|
||||
*/
|
||||
@Cordova()
|
||||
load(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a function which will be called if/when settings on the device have been updated from the cloud.
|
||||
* @param {Function} handler - callback function to invoke when device settings have been updated from the cloud.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
onRestore(handler: Function): void {}
|
||||
|
||||
/**
|
||||
* Outputs verbose log messages from the native plugin components to the JS console.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
enableDebug(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Config
|
||||
* @description
|
||||
* Cordova plugin for Firebase Config
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FirebaseConfig } from '@ionic-native/firebase-config';
|
||||
*
|
||||
*
|
||||
* constructor(private firebaseConfig: FirebaseConfig) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.firebaseConfig.getBoolean('my_key')
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseConfig',
|
||||
plugin: 'cordova-plugin-firebase-config',
|
||||
pluginRef: 'cordova.plugins.firebase.config',
|
||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-config',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseConfig extends IonicNativePlugin {
|
||||
/**
|
||||
* Fetches remote config values with appropriate TTL and then activates them.
|
||||
*
|
||||
* @param {number} ttlSeconds
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
update(ttlSeconds: number): Promise<null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a boolean configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBoolean(key: string, namespace?: string): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a string configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getString(key: string, namespace?: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a numeric configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getNumber(key: string, namespace?: string): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches an array of bytes configuration value from RemoteConfig
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} [namespace]
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBytes(key: string, namespace?: string): Promise<any[]> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,10 @@ export interface IDynamicLink {
|
||||
*
|
||||
* config.xml:
|
||||
* ```xml
|
||||
* <platform name="android">
|
||||
* <platform name="ios">
|
||||
* <preference name="GoogleIOSClientId" value="..." />
|
||||
* </platform>
|
||||
* <platform name="ios">
|
||||
* <platform name="android">
|
||||
* <preference name="GoogleAndroidClientId" value="..." />
|
||||
* </platform>
|
||||
* ```
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export interface IFirebaseMessage {
|
||||
aps: any;
|
||||
gcm: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Messaging
|
||||
* @description
|
||||
* Cordova plugin for Firebase Messaging
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FirebaseMessaging } from '@ionic-native/firebase-messaging';
|
||||
*
|
||||
*
|
||||
* constructor(private firebaseMessaging: FirebaseMessaging) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.firebaseMessaging.logEvent('page_view', {page: "dashboard"})
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* IFirebaseMessage
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseMessaging',
|
||||
plugin: 'cordova-plugin-firebase-messaging',
|
||||
pluginRef: 'cordova.plugins.firebase.messaging',
|
||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-messaging',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseMessaging extends IonicNativePlugin {
|
||||
/**
|
||||
* Called when a push message received while app is in foreground.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onMessage(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a push message received while app is in background.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onBackgroundMessage(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grant permission to recieve push notifications (will trigger prompt on iOS).
|
||||
*
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
requestPermission(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that fulfills with the current FCM token
|
||||
*
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getToken(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers every time when FCM token updated.
|
||||
* You should usually call getToken to get an updated token and send it to server.
|
||||
*
|
||||
* @returns {Observable<void>}
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onTokenRefresh(): Observable<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to topic in background.
|
||||
*
|
||||
* @param {string} topic
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
subscribe(topic: string): Promise<null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsubscribe from topic in background.
|
||||
*
|
||||
* @param {string} topic
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
unsubscribe(topic: string): Promise<null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads current badge number (if supported).
|
||||
*
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getBadge(): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets current badge number (if supported).
|
||||
*
|
||||
* @param {number} value
|
||||
* @returns {Promise<null>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setBadge(value: number): Promise<null> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name FTP
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name hce
|
||||
* @description
|
||||
* HCE Cordova Wrapper
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { hce } from '@ionic-native/hce';
|
||||
*
|
||||
*
|
||||
* constructor(private hce: hce) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* function onCommand(command){
|
||||
* var commandAsBytes = new Uint8Array(command);
|
||||
* var commandAsString = hce.util.byteArrayToHexString(commandAsBytes);
|
||||
*
|
||||
* // do something with the command
|
||||
*
|
||||
* // send the response
|
||||
* hce.sendReponse(commandResponse);
|
||||
* }
|
||||
* this.hce.registerCommandCallback().then(onCommand);
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'hce',
|
||||
plugin: 'cordova-plugin-hce',
|
||||
pluginRef: 'hce',
|
||||
repo: 'https://github.com/don/cordova-plugin-hce',
|
||||
install: '',
|
||||
installVariables: ['AID_FILTER'],
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class HCE extends IonicNativePlugin {
|
||||
/**
|
||||
* Registers command receiver.
|
||||
* @param onCommand {HCECommandEvent} The event handler.
|
||||
* @param fail {Function} Error event handler.
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
registerCommandCallback(onCommand: HCECommandEvent, fail?: Function): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
/**
|
||||
* Registers Deactivated receiver.
|
||||
* @param ok {HCEDeactivatedEvent} Success event handler.
|
||||
* @param fail {Function} Error event handler.
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
registerDeactivatedCallback(ok: HCEDeactivatedEvent, fail?: Function): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends response APDU.
|
||||
* @param response {Uint8Array} Response
|
||||
* @param success {string} Success Callback.
|
||||
* @param success {string} Failure Callback.
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
sendResponse(
|
||||
response: Uint8Array,
|
||||
success?: Function,
|
||||
failure?: Function
|
||||
): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
}
|
||||
|
||||
export interface HCECommandEvent {
|
||||
(command: Uint8Array): void;
|
||||
}
|
||||
export interface HCEDeactivatedEvent {
|
||||
(command: number): void;
|
||||
}
|
||||
@@ -76,6 +76,12 @@ export interface HealthQueryOptionsAggregated {
|
||||
* supported values are: 'hour', 'day', 'week', 'month', 'year'.
|
||||
*/
|
||||
bucket: string;
|
||||
|
||||
/**
|
||||
* In Android, it is possible to query for "raw" steps or to select those as filtered by the Google Fit app.
|
||||
* In the latter case the query object must contain the field filtered: true.
|
||||
*/
|
||||
filtered?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -106,6 +106,10 @@ export interface HotspotDevice {
|
||||
* @beta
|
||||
* @name Hotspot
|
||||
* @description
|
||||
* A Cordova plugin for managing Hotspot networks on Android.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-hotspot`. For more info, please see the [Hotspot plugin docs](https://github.com/hypery2k/cordova-hotspot-plugin).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Hotspot, HotspotNetwork } from '@ionic-native/hotspot';
|
||||
|
||||
@@ -46,7 +46,7 @@ import { Injectable } from '@angular/core';
|
||||
* alert('Store Error ' + JSON.stringify(err));
|
||||
* });
|
||||
*
|
||||
* this.store.ready().then((status) => {
|
||||
* this.store.ready(() => {
|
||||
* console.log(JSON.stringify(this.store.get(productId)));
|
||||
* console.log('Store is Ready: ' + JSON.stringify(status));
|
||||
* console.log('Products: ' + JSON.stringify(this.store.products));
|
||||
@@ -427,14 +427,8 @@ export class InAppPurchase2 extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return {Promise<any>} returns a promise that resolves when the store is ready
|
||||
*/
|
||||
@Cordova()
|
||||
ready(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
ready(callback: Function): void { return; }
|
||||
|
||||
@Cordova({ sync: true })
|
||||
refresh(): void {
|
||||
|
||||
@@ -5,6 +5,10 @@ import { Observable } from 'rxjs';
|
||||
/**
|
||||
* @name Keyboard
|
||||
* @description
|
||||
* Keyboard plugin for Cordova.
|
||||
*
|
||||
* Requires Cordova plugin: `ionic-plugin-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/ionic-plugin-keyboard).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Keyboard } from '@ionic-native/keyboard';
|
||||
|
||||
@@ -124,7 +124,7 @@ export interface ILocalNotificationAction {
|
||||
/**
|
||||
* Specifies whether the action causes the app to launch in the foreground
|
||||
*/
|
||||
launch?: boolean;
|
||||
foreground?: boolean;
|
||||
|
||||
/**
|
||||
* If the value is 'decline' the action is displayed with special highlighting to indicate that it performs a destructive task
|
||||
|
||||
@@ -123,6 +123,10 @@ export interface ConfigurationData {
|
||||
/**
|
||||
* @name Media Capture
|
||||
* @description
|
||||
* This plugin provides access to the device's audio, image, and video capture capabilities.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-media-capture`. For more info, please see the [Media Capture plugin docs](https://github.com/apache/cordova-plugin-media-capture).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from '@ionic-native/media-capture';
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
* @beta
|
||||
* @name Navigation Bar
|
||||
* @description
|
||||
* The NavigationBar plugin can you to hide and auto hide the android navigation bar.
|
||||
* The NavigationBar plugin allows you to hide and auto hide the android navigation bar.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -6,11 +6,11 @@ export interface OSNotification {
|
||||
/**
|
||||
* Was app in focus.
|
||||
*/
|
||||
isAppInFocus: boolean;
|
||||
isAppInFocus?: boolean;
|
||||
/**
|
||||
* Was notification shown to the user. Will be false for silent notifications.
|
||||
*/
|
||||
shown: boolean;
|
||||
shown?: boolean;
|
||||
/**
|
||||
* **ANDROID** - Android Notification assigned to the notification. Can be used to cancel or replace the notification.
|
||||
*/
|
||||
@@ -18,17 +18,17 @@ export interface OSNotification {
|
||||
/**
|
||||
* Payload received from OneSignal.
|
||||
*/
|
||||
payload: OSNotificationPayload;
|
||||
payload?: OSNotificationPayload;
|
||||
/**
|
||||
* How the notification was displayed to the user. Can be set to `Notification`, `InAppAlert`, or `None` if it was not displayed.
|
||||
*/
|
||||
displayType: OSDisplayType;
|
||||
displayType?: OSDisplayType;
|
||||
/**
|
||||
* **ANDROID** - Notification is a summary notification for a group this will contain all notification payloads it was created from.
|
||||
*/
|
||||
groupedNotifications?: OSNotificationPayload[];
|
||||
app_id?: string;
|
||||
contents: any;
|
||||
contents?: any;
|
||||
headings?: any;
|
||||
isIos?: boolean;
|
||||
isAndroid?: boolean;
|
||||
@@ -60,6 +60,7 @@ export interface OSNotification {
|
||||
wp_wns_sound?: string;
|
||||
data?: any;
|
||||
buttons?: any;
|
||||
collapse_id?: string;
|
||||
small_icon?: string;
|
||||
large_icon?: string;
|
||||
big_picture?: string;
|
||||
@@ -229,9 +230,13 @@ export interface OSPermissionState {
|
||||
*/
|
||||
hasPrompted: boolean;
|
||||
/**
|
||||
* Permissions Status
|
||||
* Permissions Status (iOS Only)
|
||||
*/
|
||||
status: any;
|
||||
/**
|
||||
* Permissions State (Android Only)
|
||||
*/
|
||||
state: any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -263,6 +263,7 @@ export interface GetLibraryOptions {
|
||||
chunkTimeSec?: number;
|
||||
useOriginalFileNames?: boolean;
|
||||
includeAlbumData?: boolean;
|
||||
maxItems?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
/**
|
||||
* @name Pin Dialog
|
||||
* @description
|
||||
* PhoneGap numeric password dialog plugin for Android and iOS.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-pin-dialog`. For more info, please see the [Pin Dialog plugin docs](https://github.com/Paldom/PinDialog).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -61,6 +61,9 @@ export interface QRScannerStatus {
|
||||
/**
|
||||
* @name QR Scanner
|
||||
* @description
|
||||
* A fast, energy efficient, highly-configurable QR code scanner for Cordova apps.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-qrscanner`. For more info, please see the [QR Scanner plugin docs](https://github.com/bitpay/cordova-plugin-qrscanner).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -18,6 +18,10 @@ export interface SafariViewControllerOptions {
|
||||
/**
|
||||
* @name Safari View Controller
|
||||
* @description
|
||||
* For displaying read-only web content.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-safariviewcontroller`. For more info, please see the [Safari View Controller plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SafariViewController } from '@ionic-native/safari-view-controller';
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface SiriShortcut {
|
||||
persistentIdentifier: string;
|
||||
title: string;
|
||||
userInfo: { [key: string]: string; };
|
||||
suggestedInvocationPhrase: string;
|
||||
}
|
||||
|
||||
export interface SiriShortcutOptions extends SiriShortcut {
|
||||
isEligibleForSearch?: boolean;
|
||||
isEligibleForPrediction?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Siri Shortcuts
|
||||
* @description
|
||||
* This plugin only works when your app is built with XCode 10 Beta. Shortcuts will only appear on iOS-versions >= 12.0
|
||||
*
|
||||
* This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri.
|
||||
* After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check
|
||||
* whether the user launched your app through a shortcut by calling `getActivatedShortcut()` when the app is resumed. It will return `null`
|
||||
* if it has not been launched by Siri, and if it did, it will return an object with `SiriShortcut` properties.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SiriShortcuts } from '@ionic-native/siri-shortcuts';
|
||||
*
|
||||
*
|
||||
* constructor(private siriShortcuts: SiriShortcuts) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.siriShortcuts.donate({
|
||||
* persistentIdentifier: 'open-my-app',
|
||||
* title: 'Open my app',
|
||||
* suggestedInvocationPhrase: 'Open my app',
|
||||
* userInfo: { username: 'username' },
|
||||
* isEligibleForSearch: true,
|
||||
* isEligibleForPrediction: true,
|
||||
* })
|
||||
* .then(() => console.log('Shortcut donated.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.present({
|
||||
* persistentIdentifier: 'open-my-app',
|
||||
* title: 'Open my app',
|
||||
* suggestedInvocationPhrase: 'Open my app',
|
||||
* userInfo: { username: 'username' },
|
||||
* })
|
||||
* .then(() => console.log('Shortcut added.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.remove('open-my-app')
|
||||
* .then(() => console.log('Shortcut removed.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.removeAll()
|
||||
* .then(() => console.log('All shortcuts removed removed.'))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.siriShortcuts.getActivatedShortcut()
|
||||
* .then((data: SiriShortcut|null) => console.log(data))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* SiriShortcut
|
||||
* SiriShortcutOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SiriShortcuts',
|
||||
plugin: 'cordova-plugin-siri-shortcuts',
|
||||
pluginRef: 'cordova.plugins.SiriShortcuts',
|
||||
repo: 'https://github.com/bartwesselink/cordova-plugin-siri-shortcuts',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class SiriShortcuts extends IonicNativePlugin {
|
||||
/**
|
||||
* Donate shortcut to Siri
|
||||
* @param {SiriShortcutOptions} options Options to specify for the donation
|
||||
* @param {string} options.persistentIdentifier Specify an identifier to uniquely identify the shortcut, in order to be able to remove it
|
||||
* @param {string} options.title Specify a title for the shortcut, which is visible to the user as the name of the shortcut
|
||||
* @param {string} options.suggestedInvocationPhrase Specify the phrase to give the user some inspiration on what the shortcut to call
|
||||
* @param {object} options.userInfo Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally
|
||||
* @param {boolean} options.isEligibleForSearch This value defaults to true, set this value to make it searchable in Siri
|
||||
* @param {boolean} options.isEligibleForPrediction This value defaults to true, set this value to set whether the shortcut eligible for prediction
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
donate(options: SiriShortcutOptions): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present shortcut to the user, will popup a view controller asking the user to add it to Siri
|
||||
* @param {SiriShortcutOptions} options Options to specify for the donation
|
||||
* @param {string} options.persistentIdentifier Specify an identifier to uniquely identify the shortcut, in order to be able to remove it
|
||||
* @param {string} options.title Specify a title for the shortcut, which is visible to the user as the name of the shortcut
|
||||
* @param {string} options.suggestedInvocationPhrase Specify the phrase to give the user some inspiration on what the shortcut to call
|
||||
* @param {object} options.userInfo Provide a key-value object that contains information about the shortcut, this will be returned in the getActivatedShortcut method. It is not possible to use the persistentIdentifier key, it is used internally
|
||||
* @param {boolean} options.isEligibleForSearch This value defaults to true, set this value to make it searchable in Siri
|
||||
* @param {boolean} options.isEligibleForPrediction This value defaults to true, set this value to set whether the shortcut eligible for prediction
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
present(options: SiriShortcutOptions): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove shortcuts based on identifiers
|
||||
* @param {string|string[]} persistentIdentifiers Specify which shortcut(s) to delete by their persistent identifiers
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
remove(persistentIdentifiers: string|string[]): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all shortcuts from the application
|
||||
* @return Promise<void>
|
||||
*/
|
||||
@Cordova()
|
||||
removeAll(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current clicked user activity, and return `null` if none
|
||||
* @return Promise<SiriShortcut|null>
|
||||
*/
|
||||
@Cordova()
|
||||
getActivatedShortcut(): Promise<SiriShortcut|null> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,10 @@ export interface SpinnerDialogIOSOptions {
|
||||
/**
|
||||
* @name Spinner Dialog
|
||||
* @description
|
||||
* Cordova plugin for showing a native spinner based on Paldom/SpinnerDialog.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-native-spinner`. For more info, please see the [Spinner Dialog plugin docs](https://github.com/greybax/cordova-plugin-native-spinner).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SpinnerDialog } from '@ionic-native/spinner-dialog';
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface StripeCardTokenParams {
|
||||
/**
|
||||
* Postal code / ZIP Code
|
||||
*/
|
||||
postal_code?: string;
|
||||
postalCode?: string;
|
||||
/**
|
||||
* 3-letter ISO code for currency
|
||||
*/
|
||||
|
||||
@@ -53,9 +53,9 @@ export interface ThemeableBrowserOptions {
|
||||
|
||||
// inAppBrowser options
|
||||
location?: string;
|
||||
hidden?: string;
|
||||
clearcache?: string;
|
||||
clearsessioncache?: string;
|
||||
hidden?: boolean;
|
||||
clearcache?: boolean;
|
||||
clearsessioncache?: boolean;
|
||||
zoom?: string;
|
||||
hardwareback?: string;
|
||||
mediaPlaybackRequiresUserAction?: string;
|
||||
|
||||
@@ -59,6 +59,10 @@ export interface ThreeDeeTouchForceTouch {
|
||||
/**
|
||||
* @name 3D Touch
|
||||
* @description
|
||||
* The 3D Touch plugin adds 3D Touch capabilities to your Cordova app.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-3dtouch`. For more info, please see the [3D Touch plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-3dtouch).
|
||||
*
|
||||
* @usage
|
||||
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
|
||||
* ```typescript
|
||||
|
||||
@@ -228,4 +228,14 @@ export class WebIntent extends IonicNativePlugin {
|
||||
getIntent(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a result back to the Intent that started this Activity.
|
||||
* The data can be passed using 'extras'.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
sendResult({ extras: {}}): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user