mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-07-16 00:00:04 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0f665f6fc | ||
|
|
0254cf730e | ||
|
|
92a99145f8 | ||
|
|
a22ee6ed2b | ||
|
|
1aa89ae311 | ||
|
|
6f4d23d072 | ||
|
|
ecd451ceb3 | ||
|
|
bddc221b60 | ||
|
|
27e844cbc2 | ||
|
|
b8695220ea | ||
|
|
364b30af59 | ||
|
|
860d79828d | ||
|
|
9057dc2c93 | ||
|
|
5223dc7dd5 | ||
|
|
bb77620d0d | ||
|
|
b280ef4c55 | ||
|
|
8e79890251 | ||
|
|
f4a4bb9e55 | ||
|
|
d108776981 | ||
|
|
8a65cc943a | ||
|
|
d2e4d3e5ce | ||
|
|
3440dca70f | ||
|
|
499cc5c075 | ||
|
|
f2961fb4bb | ||
|
|
48082eeaef | ||
|
|
4c56d227a8 | ||
|
|
2fd4885fb1 | ||
|
|
7d756394dd | ||
|
|
f4b03bcce4 | ||
|
|
01bfa5cc5e | ||
|
|
996bf00e85 | ||
|
|
30360fe29d | ||
|
|
88bf517697 | ||
|
|
e6ac206b8d | ||
|
|
00ef998ee5 | ||
|
|
f81e181588 | ||
|
|
08332b7c02 | ||
|
|
86cca49236 | ||
|
|
2718bccccc | ||
|
|
042e36de08 | ||
|
|
ec933011e6 | ||
|
|
2312665792 | ||
|
|
eae8c1000c | ||
|
|
509bd72dde | ||
|
|
fe38903e4b | ||
|
|
1ebf447240 | ||
|
|
4788104931 | ||
|
|
fdd38b97b6 | ||
|
|
409a985142 | ||
|
|
8534061b2f | ||
|
|
275741faed | ||
|
|
4c5d70eacd | ||
|
|
0b43c69993 | ||
|
|
fb5d47bff2 | ||
|
|
7033a1822e | ||
|
|
a840a03e33 | ||
|
|
fb540f7774 |
@@ -0,0 +1,31 @@
|
||||
name: Node CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Test
|
||||
run: npm run test
|
||||
- name: Readmes
|
||||
run: npm run readmes
|
||||
env:
|
||||
CI: true
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Node.js Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Test
|
||||
run: npm run test
|
||||
- name: Readmes
|
||||
run: npm run readmes
|
||||
|
||||
publish-npm:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run shipit
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
+1126
-973
File diff suppressed because it is too large
Load Diff
Generated
+2043
-9017
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "5.15.0",
|
||||
"version": "5.18.0",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
||||
@@ -23,26 +23,26 @@
|
||||
"shipit": "npm run build && npm run readmes && npm run npmpub"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/common": "^8.2.9",
|
||||
"@angular/compiler": "^8.2.9",
|
||||
"@angular/compiler-cli": "^8.2.9",
|
||||
"@angular/core": "^8.2.9",
|
||||
"@angular/common": "^8.2.14",
|
||||
"@angular/compiler": "^8.2.14",
|
||||
"@angular/compiler-cli": "^8.2.14",
|
||||
"@angular/core": "^8.2.14",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/fs-extra": "^8.0.0",
|
||||
"@types/jest": "^24.0.18",
|
||||
"@types/lodash": "^4.14.141",
|
||||
"@types/node": "^12.7.11",
|
||||
"@types/rimraf": "^2.0.2",
|
||||
"@types/webpack": "^4.39.2",
|
||||
"@types/fs-extra": "^8.0.1",
|
||||
"@types/jest": "^24.0.23",
|
||||
"@types/lodash": "^4.14.149",
|
||||
"@types/node": "^12.12.14",
|
||||
"@types/rimraf": "^2.0.3",
|
||||
"@types/webpack": "^4.41.0",
|
||||
"ajv": "^6.10.2",
|
||||
"async-promise-queue": "^1.0.5",
|
||||
"conventional-changelog-cli": "^2.0.23",
|
||||
"conventional-changelog-cli": "^2.0.28",
|
||||
"cz-conventional-changelog": "^3.0.2",
|
||||
"dgeni": "^0.4.12",
|
||||
"dgeni-packages": "0.16.10",
|
||||
"fs-extra": "^8.1.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-tslint": "^8.1.4",
|
||||
"jest": "^24.9.0",
|
||||
@@ -51,15 +51,15 @@
|
||||
"natives": "^1.1.6",
|
||||
"rimraf": "^3.0.0",
|
||||
"rxjs": "^6.5.3",
|
||||
"ts-jest": "^24.1.0",
|
||||
"ts-node": "^8.4.1",
|
||||
"tslint": "^5.20.0",
|
||||
"ts-jest": "^24.2.0",
|
||||
"ts-node": "^8.5.2",
|
||||
"tslint": "^5.20.1",
|
||||
"tslint-ionic-rules": "0.0.21",
|
||||
"typedoc": "^0.15.0",
|
||||
"typedoc": "^0.15.3",
|
||||
"typescript": "~3.5.3",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"unminified-webpack-plugin": "^2.0.0",
|
||||
"webpack": "^4.41.0",
|
||||
"webpack": "^4.41.2",
|
||||
"winston": "^3.2.1",
|
||||
"zone.js": "^0.9.1"
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
* constructor(private alipay: Alipay) {
|
||||
*
|
||||
* //alipayOrder is a string that has been generated and signed by the server side.
|
||||
* this.alipay.pay(alipayOrder)
|
||||
* this.alipay.pay(alipayOrder, success, error)
|
||||
* .then(result => {
|
||||
* console.log(result); // Success
|
||||
* })
|
||||
@@ -44,7 +44,7 @@ export class Alipay extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
pay(order: string): Promise<any> {
|
||||
pay(order: string, success?: (res?: any) => void, error?: (err?: any) => void): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ export declare enum BackgroundGeolocationIOSActivity {
|
||||
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
|
||||
*
|
||||
* ```typescript
|
||||
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
|
||||
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation/ngx';
|
||||
*
|
||||
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
|
||||
*
|
||||
|
||||
@@ -267,4 +267,13 @@ export class BackgroundMode extends IonicNativePlugin {
|
||||
sync: true
|
||||
})
|
||||
unlock(): void {}
|
||||
|
||||
/**
|
||||
* Disables battery optimazation mode for the app (android only)
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
disableBatteryOptimizations(): void {}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,6 @@ export interface BarcodeScannerOptions {
|
||||
*/
|
||||
disableSuccessBeep?: boolean;
|
||||
|
||||
/**
|
||||
* Disable or enable Autorotate. Supported on IOS only.
|
||||
*/
|
||||
shouldAutorotate?: boolean;
|
||||
|
||||
/**
|
||||
* Prompt text. Supported on Android only.
|
||||
*/
|
||||
@@ -60,22 +55,22 @@ export interface BarcodeScannerOptions {
|
||||
|
||||
export interface BarcodeScanResult {
|
||||
format:
|
||||
| 'QR_CODE'
|
||||
| 'DATA_MATRIX'
|
||||
| 'UPC_E'
|
||||
| 'UPC_A'
|
||||
| 'EAN_8'
|
||||
| 'EAN_13'
|
||||
| 'CODE_128'
|
||||
| 'CODE_39'
|
||||
| 'CODE_93'
|
||||
| 'CODABAR'
|
||||
| 'ITF'
|
||||
| 'RSS14'
|
||||
| 'RSS_EXPANDED'
|
||||
| 'PDF_417'
|
||||
| 'AZTEC'
|
||||
| 'MSI';
|
||||
| 'QR_CODE'
|
||||
| 'DATA_MATRIX'
|
||||
| 'UPC_E'
|
||||
| 'UPC_A'
|
||||
| 'EAN_8'
|
||||
| 'EAN_13'
|
||||
| 'CODE_128'
|
||||
| 'CODE_39'
|
||||
| 'CODE_93'
|
||||
| 'CODABAR'
|
||||
| 'ITF'
|
||||
| 'RSS14'
|
||||
| 'RSS_EXPANDED'
|
||||
| 'PDF_417'
|
||||
| 'AZTEC'
|
||||
| 'MSI';
|
||||
cancelled: boolean;
|
||||
text: string;
|
||||
}
|
||||
@@ -121,11 +116,11 @@ export class BarcodeScanner extends IonicNativePlugin {
|
||||
PHONE_TYPE: string;
|
||||
SMS_TYPE: string;
|
||||
} = {
|
||||
TEXT_TYPE: 'TEXT_TYPE',
|
||||
EMAIL_TYPE: 'EMAIL_TYPE',
|
||||
PHONE_TYPE: 'PHONE_TYPE',
|
||||
SMS_TYPE: 'SMS_TYPE'
|
||||
};
|
||||
TEXT_TYPE: 'TEXT_TYPE',
|
||||
EMAIL_TYPE: 'EMAIL_TYPE',
|
||||
PHONE_TYPE: 'PHONE_TYPE',
|
||||
SMS_TYPE: 'SMS_TYPE'
|
||||
};
|
||||
|
||||
/**
|
||||
* Open the barcode scanner.
|
||||
|
||||
@@ -82,6 +82,8 @@ export interface ScanParams {
|
||||
matchNum?: BluetoothMatchNum;
|
||||
/** Defaults to All Matches. Available from API21 / API 23. (Android) */
|
||||
callbackType?: BluetoothCallbackType;
|
||||
/** True/false to show only connectable devices, rather than all devices ever seen, defaults to false (Windows) */
|
||||
isConnectable?: boolean;
|
||||
}
|
||||
|
||||
export interface NotifyParams {
|
||||
|
||||
@@ -70,9 +70,27 @@ export interface EmailComposerOptions {
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.emailComposer.isAvailable().then((available: boolean) =>{
|
||||
* this.emailComposer.getClients().then((apps: []) => {
|
||||
* // Returns an array of configured email clients for the device
|
||||
* });
|
||||
*
|
||||
* this.emailComposer.hasClient().then(app, (isValid: boolean) => {
|
||||
* if (isValid) {
|
||||
* // Now we know we have a valid email client configured
|
||||
* // Not specifying an app will return true if at least one email client is configured
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* this.emailComposer.hasAccount().then((isValid: boolean) => {
|
||||
* if (isValid) {
|
||||
* // Now we know we have a valid email account configured
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* this.emailComposer.isAvailable().then(app, (available: boolean) => {
|
||||
* if(available) {
|
||||
* //Now we know we can send
|
||||
* // Now we know we can send an email, calls hasClient and hasAccount
|
||||
* // Not specifying an app will return true if at least one email client is configured
|
||||
* }
|
||||
* });
|
||||
*
|
||||
@@ -142,6 +160,68 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if an email account is configured on the device.
|
||||
*
|
||||
* @returns {Promise<any>} Resolves if available, rejects if not available
|
||||
*/
|
||||
@CordovaCheck()
|
||||
hasAccount(): Promise<any> {
|
||||
return getPromise<boolean>((resolve) => {
|
||||
EmailComposer.getPlugin().hasAccount((result: boolean) => {
|
||||
if (result) {
|
||||
resolve(true);
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if a specific email client is installed on the device.
|
||||
*
|
||||
* @param {string} [app] App id or uri scheme.
|
||||
* @returns {Promise<any>} Resolves if available, rejects if not available
|
||||
*/
|
||||
|
||||
@CordovaCheck()
|
||||
hasClient(app?: string): Promise<any> {
|
||||
return getPromise<boolean>((resolve) => {
|
||||
if (app) {
|
||||
EmailComposer.getPlugin().hasClient(app, (result: boolean) => {
|
||||
if (result) {
|
||||
resolve(true);
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
EmailComposer.getPlugin().getClients((apps: string[]) => {
|
||||
resolve(apps.length && apps.length > 0);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of email clients installed on the device.
|
||||
*
|
||||
* @returns {Promise<string[]>} Resolves if available, rejects if not available
|
||||
*/
|
||||
@CordovaCheck()
|
||||
@Cordova({ platforms: ['Android'] })
|
||||
getClients(): Promise<string[]> {
|
||||
return getPromise<string[]>(resolve => {
|
||||
EmailComposer.getPlugin().getClients((apps: any) => {
|
||||
if (Object.prototype.toString.call(apps) === '[object String]') {
|
||||
apps = [apps];
|
||||
}
|
||||
resolve(apps);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if sending emails is supported on the device.
|
||||
*
|
||||
@@ -150,24 +230,11 @@ export class EmailComposer extends IonicNativePlugin {
|
||||
*/
|
||||
@CordovaCheck()
|
||||
isAvailable(app?: string): Promise<any> {
|
||||
return getPromise<boolean>((resolve, reject) => {
|
||||
if (app) {
|
||||
EmailComposer.getPlugin().isAvailable(app, (isAvailable: boolean) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
return getPromise<boolean>((resolve) => {
|
||||
Promise.all([this.hasAccount, this.hasClient(app)])
|
||||
.then((results) => {
|
||||
return resolve(results.length === 2 && results[0] && results[1]);
|
||||
});
|
||||
} else {
|
||||
EmailComposer.getPlugin().isAvailable((isAvailable: boolean) => {
|
||||
if (isAvailable) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -306,4 +306,13 @@ export class Facebook extends IonicNativePlugin {
|
||||
getDeferredApplink(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually log activation events
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
activateApp(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,12 @@ export interface NotificationData {
|
||||
* backend.registerToken(token);
|
||||
* });
|
||||
*
|
||||
* this.fcm.hasPermission().then(hasPermission => {
|
||||
* if (hasPermission) {
|
||||
* console.log("Has permission!");
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* this.fcm.unsubscribeFromTopic('marketing');
|
||||
*
|
||||
* ```
|
||||
@@ -62,6 +68,16 @@ export interface NotificationData {
|
||||
})
|
||||
@Injectable()
|
||||
export class FCM extends IonicNativePlugin {
|
||||
/**
|
||||
* Gets ios device's current APNS token
|
||||
*
|
||||
* @returns {Promise<string>} Returns a Promise that resolves with the APNS token
|
||||
*/
|
||||
@Cordova()
|
||||
getAPNSToken(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets device's current registration id
|
||||
*
|
||||
@@ -108,6 +124,19 @@ export class FCM extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking for permissions on iOS. On android, it always returns `true`.
|
||||
*
|
||||
* @returns {Promise<boolean | null>} Returns a Promise:
|
||||
* - true: push was allowed (or platform is android)
|
||||
* - false: push will not be available
|
||||
* - null: still not answered, recommended checking again later.
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<boolean | null> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch for incoming notifications
|
||||
*
|
||||
|
||||
@@ -66,13 +66,13 @@ export interface LocalFileSystem {
|
||||
/**
|
||||
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
|
||||
* @param url A URL referring to a local file in a filesystem accessable via this API.
|
||||
* @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
|
||||
* @param successCallback A callback that is called to report the FileEntry to which the supplied URL refers.
|
||||
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is
|
||||
* denied.
|
||||
*/
|
||||
resolveLocalFileSystemURL(
|
||||
url: string,
|
||||
successCallback: EntryCallback,
|
||||
successCallback: FileEntryCallback,
|
||||
errorCallback?: ErrorCallback
|
||||
): void;
|
||||
|
||||
|
||||
@@ -3,29 +3,41 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface FingerprintOptions {
|
||||
/**
|
||||
* Key for platform keychain
|
||||
* Title in biometric prompt (android only)
|
||||
* @default {APP_NAME} Biometric Sign On
|
||||
*/
|
||||
clientId: string;
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Secret password. Only for android
|
||||
* Subtitle in biometric Prompt (android only)
|
||||
* @default null
|
||||
*/
|
||||
clientSecret?: string;
|
||||
subtitle?: string;
|
||||
|
||||
/**
|
||||
* Disable 'use backup' option. Only for android (optional)
|
||||
* Description in biometric Prompt
|
||||
* @default null
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Title of fallback button.
|
||||
* @default "Use Pin"
|
||||
*/
|
||||
fallbackButtonTitle?: string;
|
||||
|
||||
/**
|
||||
* Title for cancel button on Android
|
||||
* @default "Cancel"
|
||||
*/
|
||||
cancelButtonTitle?: string;
|
||||
|
||||
/**
|
||||
* Disable 'use backup' option.
|
||||
* @default false
|
||||
*/
|
||||
disableBackup?: boolean;
|
||||
|
||||
/**
|
||||
* Title of fallback button. Only for iOS
|
||||
*/
|
||||
localizedFallbackTitle?: string;
|
||||
|
||||
/**
|
||||
* Description in authentication dialogue. Only for iOS
|
||||
*/
|
||||
localizedReason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,12 +54,17 @@ export interface FingerprintOptions {
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.faio.show().then((result: any) => console.log(result)).catch((error: any) => console.log(error));
|
||||
*
|
||||
* OR with options...
|
||||
*
|
||||
* this.faio.show({
|
||||
* clientId: 'Fingerprint-Demo', //Android: Used for encryption. iOS: used for dialogue if no `localizedReason` is given.
|
||||
* clientSecret: 'o7aoOMYUbyxaD23oFAnJ' //Necessary for Android encrpytion of keys. Use random secret key.
|
||||
* disableBackup:true, //Only for Android(optional)
|
||||
* localizedFallbackTitle: 'Use Pin', //Only for iOS
|
||||
* localizedReason: 'Please authenticate' //Only for iOS
|
||||
* title: 'Biometric Authentication', // (Android Only) | optional | Default: "<APP_NAME> Biometric Sign On"
|
||||
* subtitle: 'Coolest Plugin ever' // (Android Only) | optional | Default: null
|
||||
* description: 'Please authenticate' // optional | Default: null
|
||||
* fallbackButtonTitle: 'Use Backup', // optional | When disableBackup is false defaults to "Use Pin".
|
||||
* // When disableBackup is true defaults to "Cancel"
|
||||
* disableBackup:true, // optional | default: false
|
||||
* })
|
||||
* .then((result: any) => console.log(result))
|
||||
* .catch((error: any) => console.log(error));
|
||||
@@ -65,6 +82,73 @@ export interface FingerprintOptions {
|
||||
})
|
||||
@Injectable()
|
||||
export class FingerprintAIO extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_UNKNOWN_ERROR = -100;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_UNAVAILABLE = -101;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_AUTHENTICATION_FAILED = -102;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_SDK_NOT_SUPPORTED = -103;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_HARDWARE_NOT_SUPPORTED = -104;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_PERMISSION_NOT_GRANTED = -105;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_NOT_ENROLLED = -106;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_INTERNAL_PLUGIN_ERROR = -107;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_DISMISSED = -108;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_PIN_OR_PATTERN_DISMISSED = -109;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_SCREEN_GUARD_UNSECURED = -110;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_LOCKED_OUT = -111;
|
||||
/**
|
||||
* Convenience constant
|
||||
* @type {number}
|
||||
*/
|
||||
BIOMETRIC_LOCKED_OUT_PERMANENT = -112;
|
||||
|
||||
/**
|
||||
* Check if fingerprint authentication is available
|
||||
* @return {Promise<any>} Returns a promise with result
|
||||
|
||||
@@ -13,6 +13,11 @@ export interface IChannelOptions {
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Channel description. Default: empty string
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The sound to play once a push comes. Default value: 'default'
|
||||
* Values allowed:
|
||||
@@ -29,7 +34,7 @@ export interface IChannelOptions {
|
||||
* Boolean - vibrate or not
|
||||
* Array - vibration pattern - e.g. [500, 200, 500] - milliseconds vibrate, milliseconds pause, vibrate, pause, etc.
|
||||
*/
|
||||
vibration?: boolean;
|
||||
vibration?: boolean | number[];
|
||||
|
||||
/**
|
||||
* Whether to blink the LED
|
||||
@@ -106,7 +111,7 @@ export interface IChannelOptions {
|
||||
@Injectable()
|
||||
export class FirebaseX extends IonicNativePlugin {
|
||||
/**
|
||||
* Get the device token.
|
||||
* Get the current FCM token.
|
||||
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -125,6 +130,29 @@ export class FirebaseX extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS only.
|
||||
* Get the APNS token allocated for this app install.
|
||||
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
|
||||
*/
|
||||
@Cordova()
|
||||
getAPNSToken(): Promise<null | string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS only.
|
||||
* Registers a handler to call when the APNS token is allocated.
|
||||
* This will be called once when remote notifications permission has been granted by the user at runtime.
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
onApnsTokenReceived(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a callback function to invoke when:
|
||||
* - a notification or data message is received by the app
|
||||
@@ -367,64 +395,77 @@ export class FirebaseX extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a verification ID and send a SMS with a verification code. Use them to construct a credential to sign in the user (in your app).
|
||||
* Requests verification of a phone number in order to authenticate a user and sign then into Firebase in your app.
|
||||
*
|
||||
* More info:
|
||||
* https://github.com/dpa99c/cordova-plugin-firebasex#verifyphonenumber
|
||||
* https://firebase.google.com/docs/auth/android/phone-auth
|
||||
* https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithCredential
|
||||
* https://firebase.google.com/docs/reference/js/firebase.User#linkWithCredential
|
||||
* NOTE: This will only work on physical devices with a SIM card (not iOS Simulator or Android Emulator)
|
||||
*
|
||||
* NOTE: This will only work on physical devices.
|
||||
* In response to your request, you'll receive a verification ID which you can use in conjunction with the verification code
|
||||
* to sign the user in.
|
||||
*
|
||||
* iOS will return: credential (string)
|
||||
* On iOS and some Android devices, the user will receive and SMS containing the verification code which they must manually enter
|
||||
* into your app.
|
||||
*
|
||||
* Android will return:
|
||||
* credential.verificationId (object and with key verificationId)
|
||||
* credential.instantVerification (boolean) credential.code (string)
|
||||
* (note that this key only exists if instantVerification is true)
|
||||
* Some Android devices support "instant verfication", in which case an SMS will not be send and you will be returned
|
||||
* the verification code along with the verification ID. In this case, the user doesn't need to do anything in order for you
|
||||
* to sign them in.
|
||||
*
|
||||
* You need to use device plugin in order to access the right key.
|
||||
* IMPORTANT NOTE: Android supports auto-verify and instant device verification.
|
||||
* Therefore in that case it doesn't make sense to ask for an sms code as you won't receive one.
|
||||
* In this case you'll get a credential.verificationId and a credential.code where code is the auto received verification code
|
||||
* that would normally be sent via sms. To log in using this procedure you must pass this code to
|
||||
* PhoneAuthProvider.credential(verificationId, code). You'll find an implementation example further below.
|
||||
* @param {function} success - callback function to pass {object} credentials to as an argument
|
||||
* @param {function} error - callback function which will be passed a {string} error message as an argument
|
||||
* @param {string} phoneNumber - phone number to verify
|
||||
* @param {integer} timeOutDuration - (optional) time to wait in seconds before timing out
|
||||
* @param {string} fakeVerificationCode - (optional) to test instant verification on Android ,specify a fake verification code to return for whitelisted phone numbers.
|
||||
*
|
||||
* When using node.js Firebase Admin-SDK, follow this tutorial:
|
||||
* https://firebase.google.com/docs/auth/admin/create-custom-tokens
|
||||
*
|
||||
* Pass back your custom generated token and call
|
||||
* firebase.auth().signInWithCustomToken(customTokenFromYourServer);
|
||||
* instead of
|
||||
* firebase.auth().signInWithCredential(credential)
|
||||
*
|
||||
* YOU HAVE TO COVER THIS PROCESS, OR YOU WILL HAVE ABOUT 5% OF USERS STICKING ON YOUR SCREEN, NOT RECEIVING ANYTHING
|
||||
* If this process is too complex for you, use this awesome plugin
|
||||
* https://github.com/chemerisuk/cordova-plugin-firebase-authentication
|
||||
* It's not perfect but it fits for the most use cases and doesn't require calling your endpoint, as it has native phone auth support.
|
||||
*
|
||||
* Android
|
||||
* To use this auth you need to configure your app SHA hash in the android app configuration in the firebase console.
|
||||
* See https://developers.google.com/android/guides/client-auth to know how to get SHA app hash.
|
||||
*
|
||||
* iOS
|
||||
* Setup your push notifications first, and verify that they are arriving on your physical device before you test this method.
|
||||
* Use the APNs auth key to generate the .p8 file and upload it to firebase. When you call this method,
|
||||
* FCM sends a silent push to the device to verify it.
|
||||
*
|
||||
* @param {string} phoneNumber The phone number, including '+' and country code
|
||||
* @param {number} timeoutDuration (Android only) The timeout in sec - no more SMS will be sent to this number until this timeout expires
|
||||
* @returns {Promise<any>}
|
||||
* The success callback will be passed a credential object with the following properties:
|
||||
* instantVerification {boolean} - true if the Android device supports instant verification, in which case the verification code will be included in the credential object. If this is false, the device will be sent an SMS containing the verification code for the user to manually enter into your app. Always false on iOS.
|
||||
* verificationId {string} - the verification ID you'll need to pass along with the verification code to sign the user in. Always returned on both Android & iOS.
|
||||
* code {string} - verification code. Will only be present if instantVerification is true. Always undefined on iOS.
|
||||
*/
|
||||
@Cordova()
|
||||
verifyPhoneNumber(
|
||||
success: (value: string | object) => void,
|
||||
error: (err: string) => void,
|
||||
phoneNumber: string,
|
||||
timeoutDuration = 0
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signs the user into Firebase with credentials obtained using verifyPhoneNumber().
|
||||
* See the Android- and iOS-specific Firebase documentation for more info.
|
||||
* @param {string} verificationId - the verification ID returned in the credentials object to the verifyPhoneNumber() success callback.
|
||||
* @param {string} code - the activation code, either returned in the credentials object to the verifyPhoneNumber() success callback if using Instant Verification on Android, or the activation code as entered by the user from the received SMS message.
|
||||
* @param {function} success - callback function to call on successful sign-in using credentials
|
||||
* @param {function} error - callback function which will be passed a {string} error message as an argument
|
||||
*/
|
||||
@Cordova()
|
||||
signInWithCredential(
|
||||
verificationId: string,
|
||||
code: string,
|
||||
success: () => void,
|
||||
error: (err: string) => void
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Links the user account to an existing Firebase user account with credentials obtained using verifyPhoneNumber().
|
||||
* See the Android- and iOS-specific Firebase documentation for more info.
|
||||
* @param {string} verificationId - the verification ID returned in the credentials object to the verifyPhoneNumber() success callback.
|
||||
* @param {string} code - the activation code, either returned in the credentials object to the verifyPhoneNumber() success callback if using Instant Verification on Android, or the activation code as entered by the user from the received SMS message.
|
||||
* @param {function} success - callback function to call on successful sign-in using credentials
|
||||
* @param {function} error - callback function which will be passed a {string} error message as an argument
|
||||
*/
|
||||
@Cordova()
|
||||
linkUserWithCredential(
|
||||
verificationId: string,
|
||||
code: string,
|
||||
success: () => void,
|
||||
error: (err: string) => void
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch Remote Config parameter values for your app.
|
||||
* @param {number} cacheExpirationSeconds specify the cacheExpirationSeconds
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Ge Tui Sdk Plugin
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { GeTuiSdkPlugin } from '@ionic-native/ge-tui-sdk-plugin';
|
||||
*
|
||||
*
|
||||
* constructor(private geTuiSdkPlugin: GeTuiSdkPlugin) { }
|
||||
*
|
||||
* this.geTuiSdkPlugin.callback_init((res) => { console.log(res)});
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* this.geTuiSdkPlugin.initialize();
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* this.geTuiSdkPlugin.getClientId();
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* this.geTuiSdkPlugin.getVersion();
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'GeTuiSdkPlugin',
|
||||
plugin: 'cordova-plugin-getuisdk',
|
||||
pluginRef: 'GeTuiSdkPlugin',
|
||||
repo: 'git@github.com:GetuiLaboratory/cordova-plugin-getuisdk.git',
|
||||
install: 'cordova plugin add cordova-plugin-getuisdk --variable PUSH_APPID=your appid --variable PUSH_APPKEY=your appkey --variable PUSH_APPSECRET=your appsecret',
|
||||
installVariables: ['PUSH_APPID', 'PUSH_APPKEY', 'PUSH_APPSECRET'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class GeTuiSdkPlugin extends IonicNativePlugin {
|
||||
|
||||
@Cordova()
|
||||
callback_init(callback: Function): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
initialize() {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
getClientId(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova()
|
||||
getVersion(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface HTTPResponse {
|
||||
/**
|
||||
* The status number of the response
|
||||
* The HTTP status number of the response or a negative internal error code.
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The headers of the response
|
||||
* The headers of the response.
|
||||
*/
|
||||
headers: any;
|
||||
headers: {[ key: string ]: string };
|
||||
/**
|
||||
* The URL of the response. This property will be the final URL obtained after any redirects.
|
||||
*/
|
||||
@@ -30,8 +30,9 @@ export interface HTTPResponse {
|
||||
* Cordova / Phonegap plugin for communicating with HTTP servers. Supports iOS and Android.
|
||||
*
|
||||
* Advantages over Javascript requests:
|
||||
* - Background threading - all requests are done in a background thread
|
||||
* - SSL Pinning
|
||||
* - SSL / TLS Pinning
|
||||
* - CORS restrictions do not apply
|
||||
* - Handling of HTTP code 401 - read more at [Issue CB-2415](https://issues.apache.org/jira/browse/CB-2415)
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -70,6 +71,21 @@ export interface HTTPResponse {
|
||||
})
|
||||
@Injectable()
|
||||
export class HTTP extends IonicNativePlugin {
|
||||
/**
|
||||
* This enum represents the internal error codes which can be returned in a HTTPResponse object.
|
||||
* @readonly
|
||||
*/
|
||||
@CordovaProperty()
|
||||
readonly ErrorCode: {
|
||||
GENERIC: number;
|
||||
SSL_EXCEPTION: number;
|
||||
SERVER_NOT_FOUND: number;
|
||||
TIMEOUT: number;
|
||||
UNSUPPORTED_URL: number;
|
||||
NOT_CONNECTED: number;
|
||||
POST_PROCESSING_FAILED: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* This returns an object representing a basic HTTP Authorization header of the form.
|
||||
* @param username {string} Username
|
||||
@@ -118,11 +134,12 @@ export class HTTP extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data serializer which will be used for all future POST and PUT requests. Takes a string representing the name of the serializer.
|
||||
* @param serializer {string} The name of the serializer. Can be urlencoded, utf8 or json
|
||||
* Set the data serializer which will be used for all future POST, PUT and PATCH requests. Takes a string representing the name of the serializer.
|
||||
* @param serializer {string} The name of the serializer.
|
||||
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setdataserializer
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setDataSerializer(serializer: string): void {}
|
||||
setDataSerializer(serializer: 'urlencoded' | 'json' | 'utf8' | 'multipart'): void {}
|
||||
|
||||
/**
|
||||
* Add a custom cookie.
|
||||
@@ -172,26 +189,32 @@ export class HTTP extends IonicNativePlugin {
|
||||
setRequestTimeout(timeout: number): void {}
|
||||
|
||||
/**
|
||||
* Set SSL Cert handling mode, being one of the following values
|
||||
* default: default SSL cert handling using system's CA certs
|
||||
* legacy: use legacy default behavior (< 2.0.3), excluding user installed CA certs (only for Android)
|
||||
* nocheck: disable SSL cert checking, trusting all certs (meant to be used only for testing purposes)
|
||||
* pinned: trust only provided certs
|
||||
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setsslcertmode
|
||||
* @param {'default' | 'legacy' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
|
||||
* Resolve if it should follow redirects automatically.
|
||||
* @returns {boolean} returns true if it is configured to follow redirects automatically
|
||||
*/
|
||||
@Cordova()
|
||||
setSSLCertMode(mode: 'default' | 'legacy' | 'nocheck' | 'pinned'): Promise<void> {
|
||||
@Cordova({ sync: true })
|
||||
getFollowRedirect(): boolean {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable following redirects automatically.
|
||||
* @param disable {boolean} Set to true to disable following redirects automatically
|
||||
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
|
||||
* Configure if it should follow redirects automatically.
|
||||
* @param follow {boolean} Set to false to disable following redirects automatically
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setFollowRedirect(follow: boolean): void {}
|
||||
|
||||
/**
|
||||
* Set server trust mode, being one of the following values:
|
||||
* default: default SSL trustship and hostname verification handling using system's CA certs;
|
||||
* legacy: use legacy default behavior (< 2.0.3), excluding user installed CA certs (only for Android);
|
||||
* nocheck: disable SSL certificate checking and hostname verification, trusting all certs (meant to be used only for testing purposes);
|
||||
* pinned: trust only provided certificates;
|
||||
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setservertrustmode
|
||||
* @param {string} mode server trust mode
|
||||
*/
|
||||
@Cordova()
|
||||
disableRedirect(disable: boolean): Promise<void> {
|
||||
setServerTrustMode(mode: 'default' | 'legacy' | 'nocheck' | 'pinned'): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,7 +223,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
post(url: string, body: any, headers: any): Promise<HTTPResponse> {
|
||||
@@ -212,7 +235,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
get(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
|
||||
@@ -224,7 +247,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
put(url: string, body: any, headers: any): Promise<HTTPResponse> {
|
||||
@@ -236,7 +259,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string} The url to send the request to
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
patch(url: string, body: any, headers: any): Promise<HTTPResponse> {
|
||||
@@ -248,7 +271,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
delete(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
|
||||
@@ -260,7 +283,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param url {string} The url to send the request to
|
||||
* @param parameters {Object} Parameters to send with the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
head(url: string, parameters: any, headers: any): Promise<HTTPResponse> {
|
||||
@@ -274,7 +297,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @param filePath {string} The local path(s) of the file(s) to upload
|
||||
* @param name {string} The name(s) of the parameter to pass the file(s) along as
|
||||
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<any>} returns a FileEntry promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
uploadFile(url: string, body: any, headers: any, filePath: string | string[], name: string | string[]): Promise<any> {
|
||||
@@ -287,7 +310,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param body {Object} The body of the request
|
||||
* @param headers {Object} The headers to set for this request
|
||||
* @param filePath {string} The path to download the file to, including the file name.
|
||||
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<any>} returns a FileEntry promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
downloadFile(url: string, body: any, headers: any, filePath: string): Promise<any> {
|
||||
@@ -308,7 +331,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
* @param options.name {string} name(s) to be used during upload see uploadFile for detailed information
|
||||
* @param options.responseType {string} response type, defaults to text
|
||||
*
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
|
||||
* @returns {Promise<HTTPResponse>} returns a promise that will resolve on success, and reject on failure
|
||||
*/
|
||||
@Cordova()
|
||||
sendRequest(
|
||||
@@ -317,7 +340,7 @@ export class HTTP extends IonicNativePlugin {
|
||||
method: 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete' | 'upload' | 'download';
|
||||
data?: { [index: string]: any };
|
||||
params?: { [index: string]: string | number };
|
||||
serializer?: 'json' | 'urlencoded' | 'utf8';
|
||||
serializer?: 'json' | 'urlencoded' | 'utf8' | 'multipart';
|
||||
timeout?: number;
|
||||
headers?: { [index: string]: string };
|
||||
filePath?: string | string[];
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface ImagePickerOptions {
|
||||
* Max width to allow images to be
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Max height to allow images to be
|
||||
*/
|
||||
@@ -22,6 +23,21 @@ export interface ImagePickerOptions {
|
||||
*/
|
||||
quality?: number;
|
||||
|
||||
/**
|
||||
* Videos allowed?
|
||||
*/
|
||||
allow_video?: boolean;
|
||||
|
||||
/**
|
||||
* the default is the message of the old plugin impl
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* the old plugin impl didn't have it, so passing null by default
|
||||
*/
|
||||
message?: string;
|
||||
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in ImagePicker.OutputType. Default is FILE_URI.
|
||||
@@ -29,6 +45,11 @@ export interface ImagePickerOptions {
|
||||
* DATA_URL : 1, Return image as base64-encoded string
|
||||
*/
|
||||
outputType?: number;
|
||||
|
||||
/**
|
||||
* Disable the iOS popover as seen on iPad
|
||||
*/
|
||||
disable_popover?: boolean;
|
||||
}
|
||||
|
||||
export enum OutputType {
|
||||
|
||||
@@ -178,6 +178,13 @@ export class InAppBrowserObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to be called after the "beforeload" event to continue the script
|
||||
* @param strUrl {String} The URL the InAppBrowser should navigate to.
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
_loadAfterBeforeload(strUrl: string): void {}
|
||||
|
||||
/**
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, CordovaProperty, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export enum KeyboardStyle {
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name Kommunicate
|
||||
* @description
|
||||
* The plugin for the Kommunicate SDK.
|
||||
* With the help of this plugin, you can easily add human + bot chat support functionality to you app.
|
||||
* Refer to: TODO: insert site link
|
||||
* For documentation: TODO: insert link
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Kommunicate } from '@ionic-native/Kommunicate';
|
||||
*
|
||||
* constructor(private kommunicate: Kommunicate) { }
|
||||
* //also add [..., Kommunicate, ... ] inside the providers array, if required
|
||||
*
|
||||
* var kmUser = {
|
||||
* userId : 'randomstring',
|
||||
* authenticationTypeId : 1
|
||||
* };
|
||||
*
|
||||
* this.kommunicate.login(kmUser)
|
||||
* .then((res: any) => console.log("Sucessfully logged in." + res))
|
||||
* .catch((error: any) => console.error("Error logging in." + error));
|
||||
*
|
||||
* var conversationObject = {
|
||||
* isUnique : false
|
||||
* };
|
||||
*
|
||||
* this.kommunicate.conversationBuilder(converationObject)
|
||||
* .then((clientChannelKey: any) => console.log("Kommunicate create conversation successful the clientChannelKey is : " + clientChannelKey))
|
||||
* .catch((error: any) => console.error("Error creating conversation." + error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Kommunicate',
|
||||
plugin: 'kommunicate-cordova-plugin',
|
||||
pluginRef: 'kommunicate',
|
||||
repo: 'https://github.com/Kommunicate-io/Kommunicate-Cordova-Ionic-PhoneGap-Chat-Plugin',
|
||||
platforms: ['Android', 'Browser', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Kommunicate extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Login the user with the details passed in
|
||||
* Creates a new user with the details provided there is no existing user
|
||||
*
|
||||
* var kmUser = {
|
||||
* 'userId' : 'userId', //Replace it with the userId of the logged in user
|
||||
* 'password' : 'password', //replace with password
|
||||
* 'authenticationTypeId' : 1,
|
||||
* 'imageLink' : <image-link-for-user>
|
||||
* 'applicationId' : '<APP_ID>', //replace this with your APP_ID from Applozic Dashboard
|
||||
* 'deviceApnsType' : 0 //Set 0 for Development and 1 for Distribution (Release)
|
||||
* };
|
||||
*
|
||||
* @param kmUser {any} the user details
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
login(kmUser: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Register for push notification
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
registerPushNotification(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Check if any user is logged in or not
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
isLoggedIn(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Update the token for push notifications
|
||||
*
|
||||
* @param token {string} the user details
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
updatePushNotificationToken(token: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Launch the conversation screen (it contains all the existing conversations)
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
launchConversation(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Launch the conversation identified by the given channel(conversation) key
|
||||
*
|
||||
* let convObj = {
|
||||
* 'clientChannelKey' : clientChannelKey, //pass the clientChannelKey here
|
||||
* 'takeOrder' : true //skip chat list on back press, pass false if you want to show chat list on back press
|
||||
* };
|
||||
*
|
||||
* @param conversationObject {any} the channel key and other information
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
launchParticularConversation(conversationObject: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start a new conversation, details about the conversation to be passed as parameters
|
||||
*
|
||||
* @deprecated
|
||||
* @param converationParams {any} the user details
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
startNewConversation(conversationParams: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Process push notifications
|
||||
*
|
||||
* @param data {any} the user details
|
||||
* @return {boolean} Returns true/false
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
processPushNotification(data: any): boolean { return; }
|
||||
|
||||
/**
|
||||
* Logout the current user
|
||||
*
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
logout(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start a single chat (conversation)
|
||||
*
|
||||
* @deprecated
|
||||
* @param data {any} the user details
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
startSingleChat(data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Launches a conversation with the properties passed in the conversation param
|
||||
*
|
||||
* var conversationObject = {
|
||||
* 'isUnique' : false,
|
||||
* 'agentIds':['<AGENT_ID>'], //List of agentIds. AGENT_ID is the emailID used to signup on Kommunicate
|
||||
* 'botIds': ['<BOT_ID>'] //List of botIds. Go to Manage Bots(https://dashboard.kommunicate.io/bots/manage-bots) -> Copy botID
|
||||
* };
|
||||
*
|
||||
* @param conversationObject {any} the user details
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
conversationBuilder(converationObject: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
@@ -138,12 +138,13 @@ export class AuthenticationContext {
|
||||
* @param {String} extraQueryParameters
|
||||
* Extra query parameters (optional)
|
||||
* Parameters should be escaped before passing to this method (e.g. using 'encodeURI()')
|
||||
* @param {String} claims Claim parameter. Parameter should be used under conditional access scenarios (optional)
|
||||
* @returns {Promise} Promise either fulfilled with AuthenticationResult object or rejected with error
|
||||
*/
|
||||
@CordovaInstance({
|
||||
otherPromise: true
|
||||
})
|
||||
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any): Promise<AuthenticationResult> {
|
||||
acquireTokenAsync(resourceUrl: string, clientId: string, redirectUrl: string, userId?: string, extraQueryParameters?: any, claims?: string): Promise<AuthenticationResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -165,3 +166,20 @@ export class AuthenticationContext {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class AuthenticationSettings {
|
||||
/**
|
||||
* Sets flag to use or skip authentication broker.
|
||||
* By default, the flag value is false and ADAL will not talk to broker.
|
||||
*
|
||||
* @param useBroker Flag to use or skip authentication broker
|
||||
*
|
||||
* @returns {Promise} Promise either fulfilled or rejected with error
|
||||
*/
|
||||
@CordovaInstance({
|
||||
otherPromise: true
|
||||
})
|
||||
static setUseBroker(useBroker: boolean): Promise<void> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export class PhotoLibrary extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
getLibrary(options?: GetLibraryOptions): Observable<LibraryItem[]> {
|
||||
getLibrary(success?: (res?: any) => void, error?: (err?: any) => void, options?: GetLibraryOptions): Observable<LibraryItem[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { PreviewAnyFile } from '@ionic-native/preview-any-file';
|
||||
* import { PreviewAnyFile } from '@ionic-native/preview-any-file/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private previewAnyFile: PreviewAnyFile) { }
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
||||
|
||||
interface FontOptions {
|
||||
name: string; // The name of the font family. Only supported on iOS
|
||||
size: number; // The size of the font. Only supported on iOS, Android
|
||||
italic: boolean; // Set to true to enable these font traits. Only supported on iOS
|
||||
bold: boolean; // Set to true to enable these font traits. Only supported on iOS
|
||||
align: 'left' | 'right' | 'center' | 'justified'; // Possible alignments are left, right, center and justified. Only supported on iOS
|
||||
color: string; // The color of the font in hexa-decimal RGB format - "FF0000" means red. Only supported on iOS
|
||||
}
|
||||
|
||||
interface HeaderFooterLabelOptions {
|
||||
text: string; // The plain text to display. Use %ld to indicate where to insert the page index. For example "Page %ld" would result into "Page 1", "Page 2", .... Only supported on iOS
|
||||
top: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
|
||||
right: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
|
||||
left: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
|
||||
bottom: string; // The relative position where to place the label within the footer or header area. Only supported on iOS
|
||||
font: FontOptions; // The font attributes for the label. Only supported on iOS
|
||||
showPageIndex: boolean; // Set to true if you want to display the page index. Only supported on iOS
|
||||
}
|
||||
|
||||
export interface PrintOptions {
|
||||
/**
|
||||
* The name of the print job and the document
|
||||
@@ -8,16 +27,22 @@ export interface PrintOptions {
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* The network URL of the printer.
|
||||
* Only supported on iOS.
|
||||
* The number of copies for the print task.
|
||||
* Only supported on iOS, Windows
|
||||
*/
|
||||
printerId?: string;
|
||||
copies?: number;
|
||||
|
||||
/**
|
||||
* Limits the pages to print even the document contains more.
|
||||
* To skip the last n pages you can assign a negative value on iOS.
|
||||
* Only supported on iOS, Android
|
||||
*/
|
||||
pageCount?: number;
|
||||
|
||||
/**
|
||||
* Specifies the duplex mode to use for the print job.
|
||||
* Either double-sided (duplex:true) or single-sided (duplex:false).
|
||||
* Double-sided by default.
|
||||
* Only supported on iOS
|
||||
* Either double-sided on short site (duplex:'short'),
|
||||
* double-sided on long site (duplex:'long') or single-sided (duplex:'none').
|
||||
*/
|
||||
duplex?: boolean;
|
||||
|
||||
@@ -25,18 +50,85 @@ export interface PrintOptions {
|
||||
* The orientation of the printed content, portrait or landscape
|
||||
* Portrait by default.
|
||||
*/
|
||||
landscape?: boolean;
|
||||
orientation?: 'landscape' | 'portrait';
|
||||
|
||||
/**
|
||||
* If your application only prints black text, setting this property to true can result in better performance in many cases.
|
||||
* False by default.
|
||||
*/
|
||||
grayscale?: boolean;
|
||||
monochrome?: boolean;
|
||||
|
||||
/**
|
||||
* The Size and position of the print view
|
||||
* If your application only prints black text, setting this property to true can result in better performance in many cases.
|
||||
* False by default.
|
||||
* Only supported on iOS, Windows
|
||||
*/
|
||||
bounds?: number[] | any;
|
||||
photo?: boolean;
|
||||
|
||||
/**
|
||||
* Set to false to disable downscaling the image to fit into the content aread.
|
||||
* Only supported on Android
|
||||
*/
|
||||
autoFit?: boolean;
|
||||
|
||||
/**
|
||||
* The network URL to the printer.
|
||||
* Only supported on iOS
|
||||
*/
|
||||
printer?: string;
|
||||
|
||||
/**
|
||||
* Defines the maximum size of the content area.
|
||||
* Only supported on iOS
|
||||
*/
|
||||
maxHeight?: string;
|
||||
|
||||
/**
|
||||
* Defines the maximum size of the content area.
|
||||
* Only supported on iOS
|
||||
*/
|
||||
maxWidth?: string;
|
||||
|
||||
/**
|
||||
* Set to false to avoid margins.
|
||||
* The margins for each printed page. Each printer might have its own minimum margins depends on media type and paper format.
|
||||
*/
|
||||
margin?: boolean | {
|
||||
top?: string;
|
||||
left?: string;
|
||||
right?: string;
|
||||
bottom?: string;
|
||||
};
|
||||
|
||||
ui?: {
|
||||
hideNumberOfCopies?: string; // Set to true to hide the control for the number of copies. Only supported on iOS
|
||||
hidePaperFormat?: string; // Set to true to hide the control for the paper format. Only supported on iOS
|
||||
top?: number; // The position of the printer picker. Only supported on iPad
|
||||
left?: number; // The position of the printer picker. Only supported on iPad
|
||||
height?: number; // The size of the printer picker. Only supported on iPad
|
||||
width?: number; // The size of the printer picker. Only supported on iPad
|
||||
};
|
||||
|
||||
paper?: {
|
||||
width: string; // The dimensions of the paper – iOS will will try to choose a format which fits bests. Only supported on iOS
|
||||
height: string; // The dimensions of the paper – iOS will will try to choose a format which fits bests. Only supported on iOS
|
||||
name: string; // The name of the format like IsoA4 or Roll22Inch. https://docs.microsoft.com/en-us/uwp/api/windows.graphics.printing.printmediasize. Only supported on Windows
|
||||
length: string; // On roll-fed printers you can decide when the printer cuts the paper. https://docs.microsoft.com/en-us/uwp/api/windows.graphics.printing.printmediasize. Only supported on iOs
|
||||
};
|
||||
|
||||
font?: FontOptions;
|
||||
|
||||
header?: {
|
||||
height: string; // The height of the header or footer on each page. Only supported on iOS
|
||||
labels: string[]; // An array of labels to display. Only use if there are more then one. Only supported on iOS
|
||||
label: HeaderFooterLabelOptions;
|
||||
};
|
||||
|
||||
footer?: {
|
||||
height: string; // The height of the header or footer on each page. Only supported on iOS
|
||||
labels: string[]; // An array of labels to display. Only use if there are more then one. Only supported on iOS
|
||||
label: HeaderFooterLabelOptions;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,11 +146,10 @@ export interface PrintOptions {
|
||||
*
|
||||
* let options: PrintOptions = {
|
||||
* name: 'MyDocument',
|
||||
* printerId: 'printer007',
|
||||
* duplex: true,
|
||||
* landscape: true,
|
||||
* grayscale: true
|
||||
* }
|
||||
* orientation: 'landscape',
|
||||
* monochrome: true
|
||||
* }
|
||||
*
|
||||
* this.printer.print(content, options).then(onSuccess, onError);
|
||||
* ```
|
||||
@@ -85,14 +176,14 @@ export class Printer extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the printer service is available (iOS) or if printer services are installed and enabled (Android).
|
||||
* @return {Promise<any>} returns a promise that resolve with an object indicating whether printing is available, and providing the number of printers available
|
||||
* Checks To check if printing is supported in general
|
||||
* @return {Promise<any>} returns a promise that resolve with an object indicating whether printing is available
|
||||
*/
|
||||
@CordovaCheck()
|
||||
check(): Promise<any> {
|
||||
return getPromise<any>((resolve: Function) => {
|
||||
Printer.getPlugin()
|
||||
.check((avail: boolean, count: any) => {
|
||||
.canPrintItem((avail: boolean, count: any) => {
|
||||
resolve({ avail, count });
|
||||
});
|
||||
});
|
||||
@@ -117,7 +208,7 @@ export class Printer extends IonicNativePlugin {
|
||||
successIndex: 2,
|
||||
errorIndex: 4
|
||||
})
|
||||
print(content: string | HTMLElement, options?: PrintOptions): Promise<any> {
|
||||
print(content?: string | HTMLElement, options?: PrintOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,629 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, CordovaProperty, CordovaInstance, InstanceProperty, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name PSPDFKit-Cordova
|
||||
* @description
|
||||
* The official plugin to use PSPDFKit with Cordova and Ionic.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { PSPDFKit } from '@ionic-native/pspdfkit-cordova/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private pspdfkit: PSPDFKit) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // Set your license key here.
|
||||
* this.pspdfkit.setLicenseKey("YOUR KEY");
|
||||
*
|
||||
* // Show a PDF in single page mode, with a black background.
|
||||
* this.pspdfkit.present('document.pdf', {pageMode: 'single', backgroundColor: "black"})
|
||||
* .then(result => {
|
||||
* console.log(result); // Success
|
||||
* })
|
||||
* .catch(error => {
|
||||
* console.log(error); // Failed
|
||||
* });
|
||||
* }
|
||||
*
|
||||
* // Scroll to page at index 1.
|
||||
* this.pspdfkit.setPage(1, true);
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'PSPDFKit',
|
||||
plugin: 'pspdfkit-cordova',
|
||||
pluginRef: 'PSPDFKit',
|
||||
repo: 'https://github.com/PSPDFKit/PSPDFKit-Cordova',
|
||||
install: 'ionic cordova plugin add pspdfkit-cordova',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class PSPDFKit extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Activates PSPDFKit with your license key from https://customers.pspdfkit.com.
|
||||
*
|
||||
* @param key {string} The license key.
|
||||
* @return {Promise<any>} Success and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
setLicenseKey(licenseKey: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS: Displays a PDF in a full-screen modal.
|
||||
* Android: Opens the PSPDFActivity to show a document from the local device file system.
|
||||
*
|
||||
* @param path {string} The path should be a string containing the file path (not URL) for the PDF. Relative paths are assumed to be relative to the www directory (if the path has a different base URL set, this will be ignored). To specify a path inside the application documents or library directory, use a `~`, e.g. `"~/Documents/mypdf.pdf"` or `"~/Library/Application Support/mypdf.pdf"`. Path can be null, but must not be omitted
|
||||
* @param options {any} The `options` parameter is an optional object containing configuration properties for the PDF document and/or view controller. All currently supported values are listed below under Options.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
present(path: string, options?: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the PSPDFActivity to show a document from the app's assets folder. This method copies the
|
||||
* file to the internal app directory on the device before showing it.
|
||||
* @param assetFile {string} Relative path within the app's assets folder.
|
||||
* @param options {any} PSPDFKit configuration options.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
presentFromAssets(assetFile: string, options?: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a PDF in a full-screen modal and imports annotations from a given XFDF file.
|
||||
*
|
||||
* @param path {string} Should be a string containing the file path (not URL) for the PDF. Relative paths are assumed to be relative to the www directory (if the path has a different base URL set, this will be ignored). To specify a path inside the application documents or library directory, use a `~`, e.g. `"~/Documents/mypdf.pdf"` or `"~/Library/Application Support/mypdf.pdf"`. Path can be null, but must not be omitted
|
||||
* @param xfdfPath {string} should be a string containing the file path (not URL) for the XFDF file backing the PDF document. Relative paths are assumed to be relative to the www directory (if the xfdf path has a different base URL set, we will create an XFDF file in `'"~/Documents/" + xfdfPath'`). To specify a path inside the application documents or library directory, use a ~, e.g. `"~/Documents/myXFDF.xfdf"` or `"~/Library/Application Support/myXFDF.xfdf"`. The xfdfPath cannot be null and must not be omitted.
|
||||
* @param options {any} The `options` parameter is an optional object containing configuration properties for the PDF document and/or view controller. All currently supported values are listed below under Options.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
presentWithXFDF(path: string, xfdfPath: string, options?: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS: Dismisses the modally presented PDF view.
|
||||
* Android: Dismisses any previously launched PDF activity. Calls the optional callback function after all activities have been dismissed.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
dismiss(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the current PDF.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
reload(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Saves the document to original location if it has been changed. If there were no changes to the
|
||||
* document, the document file will not be modified.
|
||||
* Provides "wasModified" as a part of a successful response which will be equal to true if
|
||||
* the file was modified and changes were saved. false if there was nothing to save.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
saveDocument(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves any changed annotations in the current document.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
saveAnnotations(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true in the success (or result) callback if the document has unsaved annotation. Returns false otherwise.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
getHasDirtyAnnotations(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers a search for the specified query.
|
||||
*
|
||||
* @param query {string} Search Term to query
|
||||
* @param animated {boolean} Determines if the search should be animated (if omitted, the search will not be animated). The optional headless argument determines whether the search UI should be disaplyed (if omitted, the search UI *will* be displayed).
|
||||
* @param headless {boolean} Determines whether the search UI should be disaplyed (if omitted, the search UI *will* be displayed).
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
search(query: string, animated?: boolean, headless?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets multiple document and view controller settings at once.
|
||||
*
|
||||
* @param options {any} The options set will be applied to the current document (if there is one) as well as all subsequently displayed documents. All currently supported values are listed below under Options.
|
||||
* @param animated {boolean} determines if the property should be animated. Not all property changes can be animated, so if the property does not support animation the animated argument will be ignored.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
setOptions(options: any, animated: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets several document or view controller options in a single call.
|
||||
*
|
||||
* @param names {any} array of option names
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
getOptions(names: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a single document or view controller settings at once.
|
||||
*
|
||||
* @param name {string} the option name
|
||||
* @param value {any} the option value
|
||||
* @param animated {boolean} determines if the property should be animated. Not all property changes can be animated, so if the property does not support animation the animated argument will be ignored.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
setOption(name: string, value: any, animated: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single document or view controller settings at once.
|
||||
*
|
||||
* @param name {string} the option name
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
getOption(name: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current visible page.
|
||||
*
|
||||
* @param page {number} the page index
|
||||
* @param animated {boolean} Optional argument. Determines if the page change should be animated (if omitted, the search will not be animated).
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
setPage(page: number, animated?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the currently visible page.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
getPage(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the page count of the current document.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
getPageCount(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scrolls to the next page.
|
||||
*
|
||||
* @param animated {boolean} Optional argument. Determines if the page change should be animated (if omitted, the search will not be animated).
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
scrollToNextPage(animated?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scrolls to the previous page.
|
||||
*
|
||||
* @param animated {boolean} Optional argument. Determines if the page change should be animated (if omitted, the search will not be animated).
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
scrollToPreviousPage(animated?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the appearance mode.
|
||||
*
|
||||
* @param appearanceMode {string} the appearance mode. Can be 'default', 'sepia', or 'night'
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
setAppearanceMode(appearanceMode: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the entire render cache. This invalidates render caches for all previously rendered documents.
|
||||
* Consider using `removeCacheForPresentedDocument()` or `clearCacheForPage()` instead of this,
|
||||
* since invalidating single documents or specific page caches since excessive cache invalidation may decrease performance.
|
||||
*
|
||||
* @param clearDiskCache {boolean} optional parameter. Android: if set to true clears disk cache as well. iOS: has no effect.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
clearCache(clearDiskCache?: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the cache from the currently presented document.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
removeCacheForPresentedDocument(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the render cache for the specified page.
|
||||
*
|
||||
* @param pageIndex {number} 0-based index of the page whose render cache should be invalidated.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
clearCacheForPage(pageIndex: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the annotation toolbar
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
hideAnnotationToolbar(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the annotation toolbar
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
showAnnotationToolbar(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the annotation toolbar
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
toggleAnnotationToolbar(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the passed in document Instant JSON.
|
||||
*
|
||||
* @param jsonValue {string} The document Instant JSON to apply.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
applyInstantJSON(jsonValue: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new annotation to the current document using the Instant JSON Annotation
|
||||
* payload - https://pspdfkit.com/guides/ios/current/importing-exporting/instant-json/#instant-annotation-json-api
|
||||
*
|
||||
* @param jsonAnnotation {string} Instant JSON of the annotation to add.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
addAnnotation(jsonAnnotation: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a given annotation from the current document. The annotaion is expected to be in Instant
|
||||
* JSON format - https://pspdfkit.com/guides/ios/current/importing-exporting/instant-json/#instant-annotation-json-api
|
||||
*
|
||||
* @param jsonAnnotation {string} Instant JSON of the annotation to remove.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
removeAnnotation(jsonAnnotation: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all annotations of the given type from the page.
|
||||
*
|
||||
* @param pageIndex {number} The page to get the annotations for.
|
||||
* @param type {string} The type of annotations to get (See here for types https://pspdfkit.com/guides/server/current/api/json-format/) or `null` to get all annotations.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
getAnnotations(pageIndex: number, type?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all unsaved changes to annotations.
|
||||
*
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
getAllUnsavedAnnotations(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the form element of the fully qualified name.
|
||||
*
|
||||
* @param value {string} the value.
|
||||
* @param fullyQualifiedName {string} the fully qualified name of the form element.
|
||||
* @return {Promise<any>} callback Success (result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
setFormFieldValue(value: string, fullyQualifiedName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the form element of the fully qualified name.
|
||||
*
|
||||
* @param fullyQualifiedName {string} description.
|
||||
* @return {Promise<any>} callback Success (result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
getFormFieldValue(fullyQualifiedName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports all annotations from the specified XFDF file to the current document.
|
||||
*
|
||||
* @param xfdfPath {string} XFDF file path to import annotations
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
importXFDF(xfdfPath: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports all annotations from the current document to the specified XFDF file path.
|
||||
*
|
||||
* @param xfdfPath {string} XFDF file path to export annotations
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
exportXFDF(xfdfPath: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes annotations (embed, remove, flatten, or print) and saves the processed document to the given document path.
|
||||
*
|
||||
* @param annotationChange {string} the annotation change. Can be 'flatten', 'remove', 'embed' or 'print'
|
||||
* @param processedDocumentPath {string} description.
|
||||
* @param annotationType {string} The optional string annotationType argument. If omitted, we process 'All' annotations. The annotation type can have one of the following values: None, Undefined, Link, Highlight, StrikeOut, Underline, Squiggly, FreeText, Ink, Square, Circle, Line, Text, Stamp, Caret, RichMedia, Screen, Widget, Sound, FileAttachment, Polygon, PolyLine, Popup, Watermark, TrapNet, 3D, Redact, All.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
* -Android
|
||||
*/
|
||||
@Cordova()
|
||||
processAnnotations(annotationChange: string, processedDocumentPath: string, annotationType: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a PDF document from HTML string.
|
||||
*
|
||||
* @param html {string} HTML string.
|
||||
* @param fileName {string} File name of the generated PDF.
|
||||
* @param options {string} Options to be considered when converting the HTML string to PDF.
|
||||
* @return {Promise<any>} callback Success (or result) and error callback function.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* -iOS
|
||||
*/
|
||||
@Cordova()
|
||||
convertPDFFromHTMLString(html: string, fileName: string, options: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@ export class Purchases extends IonicNativePlugin {
|
||||
/**
|
||||
* Make a purchase
|
||||
* @param productIdentifier {string} The product identifier of the product you want to purchase.
|
||||
* @param oldSkus {string[]} Optional array of skus you wish to upgrade from.
|
||||
* @param oldSku {string} Optional sku you wish to upgrade from.
|
||||
* @param type {String} Optional type of product, can be inapp or subs. Subs by default
|
||||
*
|
||||
* @return {Observable<MakePurchaseResponse>} An [RCError] is thrown when user cancels. On error `usercancelled` will be true if user cancelled
|
||||
@@ -280,7 +280,7 @@ export class Purchases extends IonicNativePlugin {
|
||||
})
|
||||
makePurchase(
|
||||
productIdentifier: string,
|
||||
oldSkus: string[] = [],
|
||||
oldSku?: string = null,
|
||||
type: ProductType = ProductType.SUBS
|
||||
): Observable<RCMakePurchaseResponse> {
|
||||
return;
|
||||
|
||||
@@ -136,6 +136,7 @@ export interface CategoryActionData {
|
||||
title: string;
|
||||
foreground: boolean;
|
||||
destructive: boolean;
|
||||
inline?: boolean;
|
||||
}
|
||||
|
||||
export interface AndroidPushOptions {
|
||||
@@ -230,6 +231,7 @@ export interface Channel {
|
||||
sound?: string;
|
||||
vibration?: boolean | number[];
|
||||
visibility?: Visibility;
|
||||
badge?: boolean;
|
||||
}
|
||||
|
||||
export type PushEvent = string;
|
||||
@@ -269,7 +271,11 @@ export type PushEvent = string;
|
||||
* id: "testchannel1",
|
||||
* description: "My first test channel",
|
||||
* // The importance property goes from 1 = Lowest, 2 = Low, 3 = Normal, 4 = High and 5 = Highest.
|
||||
* importance: 3
|
||||
* importance: 3,
|
||||
* //badge is used to if badge appears on the app icon see https://developer.android.com/reference/android/app/NotificationChannel.html#setShowBadge(boolean).
|
||||
* //false = no badge on app icon.
|
||||
* //true = badge on app icon
|
||||
* badge: false
|
||||
* }).then(() => console.log('Channel created'));
|
||||
*
|
||||
* // Delete a channel (Android O and above)
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class SecureStorageEchoObject {
|
||||
constructor(private _objectInstance: any) {}
|
||||
|
||||
/**
|
||||
* Gets a stored item
|
||||
* @param key {string}
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
get(key: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores a value
|
||||
* @param key {string}
|
||||
* @param value {string}
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
set(key: string, value: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a single stored item
|
||||
* @param key {string}
|
||||
* @returns {Promise<string>} returns a promise that resolves with the key that was removed
|
||||
*/
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
remove(key: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all references from the storage.
|
||||
* @returns {Promise<string[]>} returns a promise that resolves with array of keys storage
|
||||
*/
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
keys(): Promise<string[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all references from the storage.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance({
|
||||
callbackOrder: 'reverse'
|
||||
})
|
||||
clear(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Brings up the screen-lock settings
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
secureDevice(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Secure Storage Echo
|
||||
* @description
|
||||
* This plugin gets, sets and removes key,value pairs from a device's secure storage.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-secure-storage-echo`. For more info, please see the [Cordova Secure Storage docs](https://github.com/mibrito707/cordova-plugin-secure-storage-echo).
|
||||
*
|
||||
* The browser platform is supported as a mock only. Key/values are stored unencrypted in localStorage.
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { SecureStorageEcho, SecureStorageEchoObject } from '@ionic-native/secure-storage-echo/ngx';
|
||||
*
|
||||
* constructor(private secureStorageEcho: SecureStorageEcho) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.secureStorageEcho.create('my_store_name')
|
||||
* .then((storage: SecureStorageEchoObject) => {
|
||||
*
|
||||
* storage.get('key')
|
||||
* .then(
|
||||
* data => console.log(data),
|
||||
* error => console.log(error)
|
||||
* );
|
||||
*
|
||||
* storage.set('key', 'value')
|
||||
* .then(
|
||||
* data => console.log(data),
|
||||
* error => console.log(error)
|
||||
* );
|
||||
*
|
||||
* storage.remove('key')
|
||||
* .then(
|
||||
* data => console.log(data),
|
||||
* error => console.log(error)
|
||||
* );
|
||||
*
|
||||
* });
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @classes
|
||||
* SecureStorageEchoObject
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SecureStorageEcho',
|
||||
plugin: 'cordova-plugin-secure-storage-echo',
|
||||
pluginRef: 'cordova.plugins.SecureStorage',
|
||||
repo: 'https://github.com/mibrito707/cordova-plugin-secure-storage-echo',
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
export class SecureStorageEcho extends IonicNativePlugin {
|
||||
/**
|
||||
* Creates a namespaced storage.
|
||||
* @param store {string}
|
||||
* @returns {Promise<SecureStorageEchoObject>}
|
||||
*/
|
||||
@CordovaCheck()
|
||||
create(store: string): Promise<SecureStorageEchoObject> {
|
||||
return getPromise<SecureStorageEchoObject>((res: Function, rej: Function) => {
|
||||
const instance = new (SecureStorageEcho.getPlugin())(
|
||||
() => res(new SecureStorageEchoObject(instance)),
|
||||
rej,
|
||||
store
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -124,9 +124,9 @@ export class SecureStorageObject {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SecureStorage',
|
||||
plugin: 'cordova-plugin-secure-storage',
|
||||
plugin: 'cordova-plugin-secure-storage-echo',
|
||||
pluginRef: 'cordova.plugins.SecureStorage',
|
||||
repo: 'https://github.com/Crypho/cordova-plugin-secure-storage',
|
||||
repo: 'https://github.com/mibrito707/cordova-plugin-secure-storage-echo',
|
||||
platforms: ['Android', 'Browser', 'iOS', 'Windows']
|
||||
})
|
||||
@Injectable()
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name ServiceDiscovery
|
||||
* @description
|
||||
* Simple plugin to get any SSDP / UPnP / DLNA service on a local network
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { ServiceDiscovery } from '@ionic-native/service-discovery';
|
||||
*
|
||||
*
|
||||
* constructor(private serviceDiscovery: ServiceDiscovery) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.serviceDiscovery.getNetworkServices('ssdp:all')
|
||||
* .then(devices => console.log(devices))
|
||||
* .catch(error => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ServiceDiscovery',
|
||||
plugin: 'cordova-plugin-discovery',
|
||||
pluginRef: 'serviceDiscovery',
|
||||
repo: 'https://github.com/scottdermott/cordova-plugin-discovery',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class ServiceDiscovery extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Finds and returns metadata about devices discovered on the network via SSDP / UPnP / DLNA
|
||||
* @param service {string} The service name to discover
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
getNetworkServices(service: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @see https://developer.apple.com/documentation/foundation/nspersonnamecomponents/1412193-phoneticrepresentation
|
||||
*/
|
||||
export interface NSPersonNameComponents {
|
||||
/**
|
||||
* The portion of a name’s full form of address that precedes the name itself (for example, "Dr.," "Mr.," "Ms.")
|
||||
*/
|
||||
namePrefix?: string;
|
||||
|
||||
/**
|
||||
* Name bestowed upon an individual to differentiate them from other members of a group that share a family name (for example, "Johnathan")
|
||||
*/
|
||||
givenName?: string;
|
||||
|
||||
/**
|
||||
* Secondary name bestowed upon an individual to differentiate them from others that have the same given name (for example, "Maple")
|
||||
*/
|
||||
middleName?: string;
|
||||
|
||||
/**
|
||||
* Name bestowed upon an individual to denote membership in a group or family. (for example, "Appleseed")
|
||||
*/
|
||||
familyName?: string;
|
||||
|
||||
/**
|
||||
* The portion of a name’s full form of address that follows the name itself (for example, "Esq.," "Jr.," "Ph.D.")
|
||||
*/
|
||||
nameSuffix?: string;
|
||||
|
||||
/**
|
||||
* Name substituted for the purposes of familiarity (for example, "Johnny")
|
||||
*/
|
||||
nickname?: string;
|
||||
|
||||
/**
|
||||
* The phonetic representation name components of the receiver
|
||||
*/
|
||||
phoneticRepresentation?: NSPersonNameComponents;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidcredential
|
||||
*/
|
||||
export interface AppleSignInResponse {
|
||||
/**
|
||||
* The user’s email address i.e. abc@privaterelay.appleid.com
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* An arbitrary string that your app provided to the request that generated the credential
|
||||
*/
|
||||
state?: string;
|
||||
|
||||
/**
|
||||
* A JSON Web Token (JWT) that securely communicates information about the user to your app
|
||||
*/
|
||||
identityToken: string;
|
||||
|
||||
/**
|
||||
* A short-lived token used by your app for proof of authorization when interacting with the app's server counterpart
|
||||
*/
|
||||
authorizationCode: string;
|
||||
|
||||
/**
|
||||
* The user's name
|
||||
* @see https://developer.apple.com/documentation/foundation/nspersonnamecomponents?language=objc
|
||||
*/
|
||||
fullName?: NSPersonNameComponents;
|
||||
|
||||
/**
|
||||
* An identifier associated with the authenticated user
|
||||
*/
|
||||
user?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://developer.apple.com/documentation/foundation/nserror
|
||||
*/
|
||||
export interface NSError {
|
||||
/**
|
||||
* The error code
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* A string containing the localized description of the error
|
||||
*/
|
||||
localizedDescription?: string;
|
||||
|
||||
/**
|
||||
* A string containing the localized explanation of the reason for the error
|
||||
*/
|
||||
localizedFailureReason?: string;
|
||||
}
|
||||
|
||||
export interface AppleSignInErrorResponse extends NSError {
|
||||
/**
|
||||
* The error i.e. "ASAUTHORIZATION_ERROR"
|
||||
*/
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Sign In With Apple
|
||||
* @description
|
||||
* Sign in with Apple makes it easy for users to sign in to your apps and websites using their Apple ID.
|
||||
* Instead of filling out forms, verifying email addresses, and choosing new passwords,
|
||||
* they can use Sign in with Apple to set up an account and start using your app right away.
|
||||
* All accounts are protected with two-factor authentication for superior security,
|
||||
* and Apple will not track users’ activity in your app or website.
|
||||
* *Source:* https://developer.apple.com/sign-in-with-apple/
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SignInWithApple, AppleSignInResponse, AppleSignInErrorResponse } from '@ionic-native/sign-in-with-apple/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private signInWithApple: SignInWithApple) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.signInWithApple.signin()
|
||||
* .then((res: AppleSignInResponse) => {
|
||||
* // https://developer.apple.com/documentation/signinwithapplerestapi/verifying_a_user
|
||||
* alert('Send token to apple for verification: ' + res.identityToken);
|
||||
* console.log(res);
|
||||
* })
|
||||
* .catch((error: AppleSignInErrorResponse) => {
|
||||
* alert(error.code + ' ' + error.localizedDescription);
|
||||
* console.error(error);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Sign in with Apple',
|
||||
plugin: 'cordova-plugin-sign-in-with-apple',
|
||||
pluginRef: 'cordova.plugins.SignInWithApple',
|
||||
repo: 'https://github.com/twogate/cordova-plugin-sign-in-with-apple',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class SignInWithApple extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Starts the authorization flows named during controller initialization
|
||||
* @see https://developer.apple.com/documentation/authenticationservices/asauthorizationcontroller/3153047-performrequests
|
||||
* @return {Promise<AppleSignInResponse>} Returns a promise when authorization succeeds
|
||||
* @param arg0
|
||||
* @throws AppleSignInErrorResponse
|
||||
*/
|
||||
@Cordova()
|
||||
signin(arg0: object = null): Promise<AppleSignInResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -92,7 +92,7 @@ export class SmartlookGlobalEventPropertyKey {
|
||||
plugin: 'https://github.com/smartlook/cordova-smartlook.git',
|
||||
pluginRef: 'cordova.plugins.SmartlookPlugin',
|
||||
repo: 'https://github.com/smartlook/cordova-smartlook.git',
|
||||
platforms: ['Android']
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Smartlook extends IonicNativePlugin {
|
||||
|
||||
@@ -52,6 +52,23 @@ export interface SumUpPayment {
|
||||
installments: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class SumUpKeys {
|
||||
|
||||
// The generated accessToken, to automate the login process
|
||||
accessToken: string;
|
||||
|
||||
// affiliateKey can also be set in the object, if it has to be changed on runtime
|
||||
affiliateKey: string;
|
||||
|
||||
constructor() {
|
||||
this.accessToken = '';
|
||||
this.affiliateKey = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @name SumUp
|
||||
* @description
|
||||
@@ -64,11 +81,15 @@ export interface SumUpPayment {
|
||||
*
|
||||
* constructor(private sumUp: SumUp) { }
|
||||
*
|
||||
* this.sumUp.login("ACCESS_TOKEN")
|
||||
* const sumUpKeys: SumUpKeys = new SumUpKeys();
|
||||
* sumUpKeys.affiliateKey = 'YOUR_API_KEY'; // if not provided in installation
|
||||
* sumUpKeys.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
*
|
||||
* this.sumUp.login(sumUpKeys)
|
||||
* .then((res: SumUpResponse) => console.log(res))
|
||||
* .catch((error: SumUpResponse) => console.error(error));
|
||||
*
|
||||
* this.sumUp.auth("ACCESS_TOKEN")
|
||||
* this.sumUp.auth('YOUR_ACCESS_TOKEN')
|
||||
* .then((res: SumUpResponse) => console.log(res))
|
||||
* .catch((error: SumUpResponse) => console.error(error));
|
||||
*
|
||||
@@ -92,7 +113,7 @@ export interface SumUpPayment {
|
||||
* .then((res: SumUpResponse) => console.log(res))
|
||||
* .catch((error: SumUpResponse) => console.error(error));
|
||||
*
|
||||
* this.sumUp.pay(10.0, "EUR")
|
||||
* this.sumUp.pay(10.0, 'EUR')
|
||||
* .then((res: SumUpPayment) => console.log(res))
|
||||
* .catch((error: SumUpPayment) => console.error(error));
|
||||
*
|
||||
@@ -114,11 +135,11 @@ export class SumUp extends IonicNativePlugin {
|
||||
* Login a user with an optional access token.
|
||||
* If the access token is provided and valid, the user is logged in autmatically.
|
||||
* Otherwise the user has to type in the credentials
|
||||
* @param accessToken {string}
|
||||
* @param sumUpKeys {SumUpKeys}
|
||||
* @return {Promise<SumUpResponse>} Return a SumUpResponse object
|
||||
*/
|
||||
@Cordova()
|
||||
login(accessToken?: string): Promise<SumUpResponse> {
|
||||
login(sumUpKeys: SumUpKeys): Promise<SumUpResponse> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,15 @@ import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* Log levels supported in the sdk.
|
||||
*/
|
||||
export enum LogLevel {
|
||||
important = 7,
|
||||
error = 8,
|
||||
debug = 9
|
||||
}
|
||||
|
||||
/**
|
||||
* AuthenticateAndActivateResultType Some Documentation
|
||||
*/
|
||||
@@ -229,6 +238,16 @@ export class UnviredResult {
|
||||
errorDetail: string;
|
||||
}
|
||||
|
||||
export class LogResult extends UnviredResult {
|
||||
type: ResultType;
|
||||
data: LogLevel;
|
||||
}
|
||||
|
||||
export class LogDataResult extends UnviredResult {
|
||||
type: ResultType;
|
||||
data: string;
|
||||
}
|
||||
|
||||
export class NotifResult extends UnviredResult {
|
||||
type: NotificationListenerType;
|
||||
}
|
||||
@@ -550,7 +569,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
* Returns the contents of the log file as a string.
|
||||
*/
|
||||
@Cordova()
|
||||
logRead(): Promise<any> {
|
||||
logRead(): Promise<LogDataResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -578,6 +597,31 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current log level.
|
||||
*/
|
||||
@Cordova()
|
||||
getLogLevel(): Promise<LogResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path of the log file.
|
||||
*/
|
||||
@Cordova()
|
||||
getLogFilePath(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the log level of the app.
|
||||
* @param logLevel The log level to set
|
||||
*/
|
||||
@Cordova()
|
||||
setLogLevel(logLevel: LogLevel): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This api initializes the Unvired Application.
|
||||
* @param loginParameters Set of parameters to be passed the login()
|
||||
@@ -759,10 +803,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
* Mobile: Or a Sqlite whereClause ( without the 'where' keyword )
|
||||
* Example:
|
||||
* ```
|
||||
* # Mobile: Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* # Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* this.unviredSDK.dbSelect('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'")
|
||||
* # Mobile & Browser: Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* this.unviredSDK.dbSelect('FORM_HEADER', {"FORM_ID": "5caed815892215034dacad56"})
|
||||
* ```
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -811,11 +853,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
* Mobile: Or a Sqlite whereClause ( without the 'where' keyword )
|
||||
* Example:
|
||||
* ```
|
||||
* Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* # Mobile
|
||||
* # Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* this.unviredSDK.dbDelete('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'")
|
||||
* # Browser & Mobile
|
||||
* this.unviredSDK.dbDelete('FORM_HEADER', {"FORM_ID": "5caed815892215034dacad56"})
|
||||
* ```
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -831,11 +870,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
* Mobile: Or a Sqlite where Clause ( without the 'where' keyword )
|
||||
* Example:
|
||||
* ```
|
||||
* Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* # Mobile
|
||||
* # Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
|
||||
* this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"UPDATED_USER","UPDATED_NO":"0039"}, "FORM_ID = '5caed815892215034dacad56'")
|
||||
* # Mobile & Browser
|
||||
* this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"UPDATED_USER","UPDATED_NO":"0039"}, {"FORM_ID": "5caed815892215034dacad56"})
|
||||
* ```
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -844,12 +880,11 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported in mobile only.
|
||||
* Execute SQL Statement
|
||||
* Execute a SQL statement
|
||||
* @param query {string} SQL Statement.
|
||||
* Example:
|
||||
* ```
|
||||
* this.unviredSDK.dbExecuteStatement('SELECT * FROM CUSTOMER_HEADER WHERE CUSTOMER_ID = 39')
|
||||
* this.unviredSDK.dbExecuteStatement("SELECT * FROM CUSTOMER_HEADER WHERE CUSTOMER_ID = '39'")
|
||||
* ```
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -858,7 +893,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported in mobile only.
|
||||
* Create Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
|
||||
* @param savePoint {string} Name of savepoint
|
||||
* Example:
|
||||
@@ -872,7 +906,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported in mobile only.
|
||||
* Release Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
|
||||
* @param savePoint {string} Name of savepoint
|
||||
* ```
|
||||
@@ -885,7 +918,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported in mobile only.
|
||||
* Rollback Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
|
||||
* @param savePoint {string} Name of the savepoint
|
||||
* Example:
|
||||
@@ -899,7 +931,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported in mobile only.
|
||||
* Begin database transaction.
|
||||
* For more info, consult SQLite documentation ( https://www.sqlite.org/lang_transaction.html )
|
||||
* Example:
|
||||
@@ -913,7 +944,6 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported in mobile only.
|
||||
* End database transaction.
|
||||
* For more info, consult SQLite documentation ( https://www.sqlite.org/lang_transaction.html )
|
||||
* Example:
|
||||
@@ -1071,6 +1101,21 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an observable containing the state of the synchronisation along with count (if applicable). Possible values are as follows:
|
||||
* 1. Sending (count) // Ex: sending(3), there are 3 items in outbox and device is online. i.e datasender thread running
|
||||
* 2. Receiving // There are items to be received from server & device is online
|
||||
* 3. Processing (count) // Ex: processing (5), there are 5 items in inbox and they are being processed.
|
||||
* 4. Waiting to connect // The device is offline & there are items in outbox
|
||||
* 5. Idle // there is no synchronisation activity going on.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
getSynchronizationState(): Observable<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Browser platform only.
|
||||
* Reinitialize web db. Use this api to initialize db from persisted local storage db
|
||||
@@ -1205,7 +1250,44 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
|
||||
* For Browser platform only
|
||||
* Helps in updating application database without reauthenticating with server which requires to drop both app and framework database.
|
||||
*/
|
||||
@Cordova()
|
||||
reCreateAppDB(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Mobile platform only
|
||||
* Starts Inbox handler if there are items in inbox.
|
||||
*/
|
||||
@Cordova()
|
||||
startInboxHandler(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Mobile platform only
|
||||
* Starts DataSender if there are items in outbox.
|
||||
*/
|
||||
@Cordova()
|
||||
startDataSender(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns platform name
|
||||
* Ex: ios, android, windows, browser
|
||||
*/
|
||||
@Cordova()
|
||||
platform(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mobile Platform only.
|
||||
* Test whether push notifications can be received on the device
|
||||
*/
|
||||
@Cordova()
|
||||
testPushNotification(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ export class Wechat extends IonicNativePlugin {
|
||||
* this.wechat.auth.then((res) => { alert(res.code); });
|
||||
* </code>
|
||||
*/
|
||||
@Cordova()
|
||||
auth(scope: any, state: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
@@ -116,6 +117,7 @@ export class Wechat extends IonicNativePlugin {
|
||||
* });
|
||||
* </code>
|
||||
*/
|
||||
@Cordova()
|
||||
sendPaymentRequest(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
@@ -143,6 +145,7 @@ export class Wechat extends IonicNativePlugin {
|
||||
* });
|
||||
* </code>
|
||||
*/
|
||||
@Cordova()
|
||||
jumpToWechat(url: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
@@ -160,6 +163,7 @@ export class Wechat extends IonicNativePlugin {
|
||||
* });
|
||||
* </code>
|
||||
*/
|
||||
@Cordova()
|
||||
chooseInvoiceFromWX(params: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user