mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-07-16 00:00:04 +08:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdd1755f8b | ||
|
|
3ed39c06ed | ||
|
|
89a5ca7ec5 | ||
|
|
0422521db6 | ||
|
|
8d57df3e64 | ||
|
|
fbf7463724 | ||
|
|
cbeb4139d9 | ||
|
|
457d47cc16 | ||
|
|
358474dcfd | ||
|
|
d6d9b54991 | ||
|
|
93ff513bd8 | ||
|
|
d3af51915e | ||
|
|
276c88dea1 | ||
|
|
653f5a2969 | ||
|
|
e661f2ece9 | ||
|
|
15cd285ec6 | ||
|
|
95b92623a6 |
@@ -1,3 +1,21 @@
|
||||
<a name="5.0.0-beta.21"></a>
|
||||
# [5.0.0-beta.21](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.20...v5.0.0-beta.21) (2018-09-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **admob-free:** fix duplicated class ([95b9262](https://github.com/ionic-team/ionic-native/commit/95b9262))
|
||||
* **bluetooth-le:** Removed a wrong cordova decorator param ([#2733](https://github.com/ionic-team/ionic-native/issues/2733)) ([cbeb413](https://github.com/ionic-team/ionic-native/commit/cbeb413))
|
||||
* **build:** fix macos mojave build errors ([358474d](https://github.com/ionic-team/ionic-native/commit/358474d))
|
||||
* **keyboard:** include the mode parameter in setResizeMode() ([8d57df3](https://github.com/ionic-team/ionic-native/commit/8d57df3))
|
||||
* **keyboard:** use cordova-plugin-ionic-keyboard ([#2743](https://github.com/ionic-team/ionic-native/issues/2743)) ([fbf7463](https://github.com/ionic-team/ionic-native/commit/fbf7463)), closes [#2306](https://github.com/ionic-team/ionic-native/issues/2306)
|
||||
* **printer:** import getPromise ([15cd285](https://github.com/ionic-team/ionic-native/commit/15cd285))
|
||||
* **screenshot:** import getPromise ([e661f2e](https://github.com/ionic-team/ionic-native/commit/e661f2e))
|
||||
* **secure-storage:** add missing "getPromise" import ([#2727](https://github.com/ionic-team/ionic-native/issues/2727)) ([457d47c](https://github.com/ionic-team/ionic-native/commit/457d47c))
|
||||
* **secure-storage:** import getPromise ([653f5a2](https://github.com/ionic-team/ionic-native/commit/653f5a2))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0-beta.20"></a>
|
||||
# [5.0.0-beta.20](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.19...v5.0.0-beta.20) (2018-09-18)
|
||||
|
||||
|
||||
Generated
+182
-1851
File diff suppressed because it is too large
Load Diff
+12
-15
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "5.0.0-beta.20",
|
||||
"version": "5.0.0-beta.21",
|
||||
"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)",
|
||||
@@ -22,21 +22,20 @@
|
||||
"shipit": "npm run build && npm run readmes && npm run npmpub"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/common": "^6.1.7",
|
||||
"@angular/compiler": "^6.1.7",
|
||||
"@angular/compiler-cli": "^6.1.7",
|
||||
"@angular/core": "^6.1.7",
|
||||
"@angular/common": "^6.1.8",
|
||||
"@angular/compiler": "^6.1.8",
|
||||
"@angular/compiler-cli": "^6.1.8",
|
||||
"@angular/core": "^6.1.8",
|
||||
"@types/cordova": "0.0.34",
|
||||
"@types/fs-extra": "^5.0.4",
|
||||
"@types/jest": "^23.3.2",
|
||||
"@types/lodash": "^4.14.116",
|
||||
"@types/node": "^9.6.31",
|
||||
"@types/node": "^9.6.32",
|
||||
"@types/rimraf": "^2.0.2",
|
||||
"@types/webpack": "^4.4.11",
|
||||
"@types/webpack": "^4.4.12",
|
||||
"ajv": "^6.5.4",
|
||||
"async-promise-queue": "^1.0.4",
|
||||
"canonical-path": "0.0.2",
|
||||
"conventional-changelog-cli": "^2.0.5",
|
||||
"cpr": "^3.0.1",
|
||||
"cz-conventional-changelog": "^2.1.0",
|
||||
"dgeni": "^0.4.10",
|
||||
"dgeni-packages": "0.16.10",
|
||||
@@ -48,21 +47,19 @@
|
||||
"jest": "^23.6.0",
|
||||
"lodash": "^4.17.11",
|
||||
"minimist": "1.2.0",
|
||||
"nodemon": "^1.18.4",
|
||||
"natives": "^1.1.5",
|
||||
"rimraf": "^2.6.2",
|
||||
"rxjs": "^6.3.2",
|
||||
"rxjs-tslint-rules": "^4.8.0",
|
||||
"string-replace-webpack-plugin": "^0.1.3",
|
||||
"ts-jest": "^23.1.4",
|
||||
"ts-jest": "23.1.4",
|
||||
"ts-node": "^7.0.1",
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-ionic-rules": "0.0.19",
|
||||
"typescript": "2.9.2",
|
||||
"uglifyjs-webpack-plugin": "^2.0.1",
|
||||
"unminified-webpack-plugin": "^2.0.0",
|
||||
"webpack": "^4.19.1",
|
||||
"webpack": "^4.20.1",
|
||||
"winston": "^3.1.0",
|
||||
"zone.js": "latest"
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
|
||||
@@ -319,104 +319,3 @@ export class AdMobFreeRewardVideo extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @name AdMob Free
|
||||
* @description
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
|
||||
*
|
||||
*
|
||||
* constructor(private admobFree: AdMobFree) { }
|
||||
*
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* const bannerConfig: AdMobFreeBannerConfig = {
|
||||
* // add your config here
|
||||
* // for the sake of this example we will just use the test config
|
||||
* isTesting: true,
|
||||
* autoShow: true
|
||||
* }
|
||||
* this.admobFree.banner.config(bannerConfig);
|
||||
*
|
||||
* this.admobFree.banner.prepare()
|
||||
* .then(() => {
|
||||
* // banner Ad is ready
|
||||
* // if we set autoShow to false, then we will need to call the show method here
|
||||
* })
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* AdMobFreeBannerConfig
|
||||
* AdMobFreeInterstitialConfig
|
||||
* AdMobFreeRewardVideoConfig
|
||||
* @classes
|
||||
* AdMobFreeBanner
|
||||
* AdMobFreeInterstitial
|
||||
* AdMobFreeRewardVideo
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AdMobFree',
|
||||
plugin: 'cordova-plugin-admob-free',
|
||||
pluginRef: 'admob',
|
||||
repo: 'https://github.com/ratson/cordova-plugin-admob-free',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class AdMobFree extends IonicNativePlugin {
|
||||
/**
|
||||
* Convenience object to get event names
|
||||
* @type {Object}
|
||||
*/
|
||||
events: any = {
|
||||
BANNER_LOAD: 'admob.banner.events.LOAD',
|
||||
BANNER_LOAD_FAIL: 'admob.banner.events.LOAD_FAIL',
|
||||
BANNER_OPEN: 'admob.banner.events.OPEN',
|
||||
BANNER_CLOSE: 'admob.banner.events.CLOSE',
|
||||
BANNER_EXIT_APP: 'admob.banner.events.EXIT_APP',
|
||||
|
||||
INTERSTITIAL_LOAD: 'admob.interstitial.events.LOAD',
|
||||
INTERSTITIAL_LOAD_FAIL: 'admob.interstitial.events.LOAD_FAIL',
|
||||
INTERSTITIAL_OPEN: 'admob.interstitial.events.OPEN',
|
||||
INTERSTITIAL_CLOSE: 'admob.interstitial.events.CLOSE',
|
||||
INTERSTITIAL_EXIT_APP: 'admob.interstitial.events.EXIT_APP',
|
||||
|
||||
REWARD_VIDEO_LOAD: 'admob.rewardvideo.events.LOAD',
|
||||
REWARD_VIDEO_LOAD_FAIL: 'admob.rewardvideo.events.LOAD_FAIL',
|
||||
REWARD_VIDEO_OPEN: 'admob.rewardvideo.events.OPEN',
|
||||
REWARD_VIDEO_CLOSE: 'admob.rewardvideo.events.CLOSE',
|
||||
REWARD_VIDEO_EXIT_APP: 'admob.rewardvideo.events.EXIT_APP',
|
||||
REWARD_VIDEO_START: 'admob.rewardvideo.events.START',
|
||||
REWARD_VIDEO_REWARD: 'admob.rewardvideo.events.REWARD'
|
||||
};
|
||||
/**
|
||||
* Returns the AdMobFreeBanner object
|
||||
* @type {AdMobFreeBanner}
|
||||
*/
|
||||
banner: AdMobFreeBanner = new AdMobFreeBanner();
|
||||
/**
|
||||
* Returns the AdMobFreeInterstitial object
|
||||
* @type {AdMobFreeInterstitial}
|
||||
*/
|
||||
interstitial: AdMobFreeInterstitial = new AdMobFreeInterstitial();
|
||||
/**
|
||||
* Returns the AdMobFreeRewardVideo object
|
||||
* @type {AdMobFreeRewardVideo}
|
||||
*/
|
||||
rewardVideo: AdMobFreeRewardVideo = new AdMobFreeRewardVideo();
|
||||
|
||||
/**
|
||||
* Watch an event
|
||||
* @param event {string} event name
|
||||
* @return {Observable<any>}
|
||||
*/
|
||||
on(event: string): Observable<any> {
|
||||
return fromEvent(document, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface EncryptedCardData {
|
||||
activationData: string;
|
||||
encryptedPassData: string;
|
||||
wrappedKey: string;
|
||||
}
|
||||
|
||||
export interface CardData {
|
||||
cardholderName: string;
|
||||
primaryAccountNumberSuffix: string;
|
||||
localizedDescription?: string;
|
||||
paymentNetwork: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Apple Wallet
|
||||
* @description
|
||||
* A Cordova plugin that enables users from Add Payment Cards to their Apple Wallet.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { AppleWallet } from '@ionic-native/apple-wallet';
|
||||
*
|
||||
*
|
||||
* constructor(private appleWallet: AppleWallet) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.appleWallet.available()
|
||||
* .then((res) => {
|
||||
* // res is a boolean value, either true or false
|
||||
* console.log("Is Apple Wallet available? ", res);
|
||||
* })
|
||||
* .catch((message) => {
|
||||
* console.error("ERROR AVAILBLE>> ", message);
|
||||
* });
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let data: cardData = {
|
||||
* cardholderName: 'Test User',
|
||||
* primaryAccountNumberSuffix: '1234',
|
||||
* localizedDescription: 'Description of payment card',
|
||||
* paymentNetwork: 'VISA'
|
||||
* }
|
||||
*
|
||||
* this.appleWallet.startAddPaymentPass(data: cardData)
|
||||
* .then((res) => {
|
||||
* console.log("startAddPaymentPass success response ", res);
|
||||
* })
|
||||
* .catch((err) => {
|
||||
* console.error("startAddPaymentPass ERROR response", err);
|
||||
* });
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let data: encryptedCardData = {
|
||||
* activationData: 'encoded Base64 activationData from your server',
|
||||
* encryptedPassData: 'encoded Base64 encryptedPassData from your server',
|
||||
* wrappedKey: 'encoded Base64 wrappedKey from your server',
|
||||
* }
|
||||
*
|
||||
* this.appleWallet.encryptedCardData(data: encryptedCardData)
|
||||
* .then((res) => {
|
||||
* console.log("completeAddCardToAppleWallet success response ", res);
|
||||
* })
|
||||
* .catch((err) => {
|
||||
* console.error("completeAddCardToAppleWallet ERROR response", err);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
* @Interfaces
|
||||
* EncryptedCardData
|
||||
* CardData
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'AppleWallet',
|
||||
plugin: 'cordova-apple-wallet',
|
||||
pluginRef: 'AppleWallet',
|
||||
repo: 'https://github.com/tomavic/cordova-apple-wallet',
|
||||
platforms: ['iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class AppleWallet extends IonicNativePlugin {
|
||||
/**
|
||||
* Detects if the current device supports Apple Wallet
|
||||
* @return {Promise<boolean>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
available(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
|
||||
* @param {cardData} data
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
startAddPaymentPass(data: CardData): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple call contains the card data needed to add a card to Apple Pay.
|
||||
* @param {encryptedCardData} data
|
||||
* @return {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
completeAddPaymentPass(data: EncryptedCardData): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -466,7 +466,7 @@ export class BluetoothLE extends IonicNativePlugin {
|
||||
* Currently the discoverable state does not have any relevance because there is no "setDiscoverable" functionality in place. That may change in the future.
|
||||
* @returns {Promise<AdapterInfo>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse', observable: true })
|
||||
@Cordova({ callbackOrder: 'reverse' })
|
||||
getAdapterInfo(): Promise<AdapterInfo> {
|
||||
return;
|
||||
}
|
||||
@@ -668,7 +668,7 @@ export class BluetoothLE extends IonicNativePlugin {
|
||||
* @returns {Promise<OperationResult>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse' })
|
||||
read(params: DescriptorParams): Promise<{ result: OperationResult }> {
|
||||
read(params: DescriptorParams): Promise<OperationResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -678,10 +678,10 @@ export class BluetoothLE extends IonicNativePlugin {
|
||||
* Once a subscription is no longer needed, execute unsubscribe in a similar fashion.
|
||||
* The Client Configuration descriptor will automatically be written to enable notification/indication based on the characteristic's properties.
|
||||
* @param {DescriptorParams} params
|
||||
* @returns {(Observable<{ result: OperationResult }>)}
|
||||
* @returns {Observable<OperationResult>}
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse', observable: true })
|
||||
subscribe(params: DescriptorParams): Observable<{ result: OperationResult }> {
|
||||
subscribe(params: DescriptorParams): Observable<OperationResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Observable } from 'rxjs';
|
||||
* @description
|
||||
* Keyboard plugin for Cordova.
|
||||
*
|
||||
* Requires Cordova plugin: `ionic-plugin-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/ionic-plugin-keyboard).
|
||||
* Requires Cordova plugin: `cordova-plugin-ionic-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/cordova-plugin-ionic-keyboard).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
@@ -19,16 +19,16 @@ import { Observable } from 'rxjs';
|
||||
*
|
||||
* this.keyboard.show();
|
||||
*
|
||||
* this.keyboard.close();
|
||||
* this.keyboard.hide();
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Keyboard',
|
||||
plugin: 'ionic-plugin-keyboard',
|
||||
pluginRef: 'cordova.plugins.Keyboard',
|
||||
repo: 'https://github.com/ionic-team/ionic-plugin-keyboard',
|
||||
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
|
||||
plugin: 'cordova-plugin-ionic-keyboard',
|
||||
pluginRef: 'window.Keyboard',
|
||||
repo: 'https://github.com/ionic-team/cordova-plugin-ionic-keyboard',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class Keyboard extends IonicNativePlugin {
|
||||
@@ -37,35 +37,35 @@ export class Keyboard extends IonicNativePlugin {
|
||||
* @param hide {boolean}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
hideKeyboardAccessoryBar(hide: boolean): void {}
|
||||
hideFormAccessoryBar(hide: boolean): void {}
|
||||
|
||||
/**
|
||||
* Hide the keyboard if shown.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
hide(): void {}
|
||||
|
||||
/**
|
||||
* Force keyboard to be shown.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['Android']
|
||||
})
|
||||
show(): void {}
|
||||
|
||||
/**
|
||||
* Close the keyboard if open.
|
||||
* Programatically set the resize mode
|
||||
* @param mode {string}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['iOS']
|
||||
})
|
||||
close(): void {}
|
||||
|
||||
/**
|
||||
* Prevents the native UIScrollView from moving when an input is focused.
|
||||
* @param disable {boolean}
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
platforms: ['iOS', 'Windows']
|
||||
})
|
||||
disableScroll(disable: boolean): void {}
|
||||
setResizeMode(mode: string): void {}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
|
||||
@@ -74,12 +74,25 @@ export class Keyboard extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'native.keyboardshow',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardShow(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard will show. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'keyboardWillShow',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardWillShow(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
@@ -87,9 +100,22 @@ export class Keyboard extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'native.keyboardhide',
|
||||
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardHide(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an observable that notifies you when the keyboard will hide. Unsubscribe to observable to cancel event watch.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
eventObservable: true,
|
||||
event: 'keyboardWillHide',
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
onKeyboardWillHide(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Cordova, CordovaCheck, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
||||
|
||||
export interface PrintOptions {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
||||
|
||||
declare const navigator: any;
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
export class SecureStorageObject {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) {}
|
||||
|
||||
/**
|
||||
* Gets a stored item
|
||||
@@ -76,7 +74,6 @@ export class SecureStorageObject {
|
||||
secureDevice(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +131,6 @@ export class SecureStorageObject {
|
||||
})
|
||||
@Injectable()
|
||||
export class SecureStorage extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Creates a namespaced storage.
|
||||
* @param store {string}
|
||||
@@ -143,8 +139,11 @@ export class SecureStorage extends IonicNativePlugin {
|
||||
@CordovaCheck()
|
||||
create(store: string): Promise<SecureStorageObject> {
|
||||
return getPromise<SecureStorageObject>((res: Function, rej: Function) => {
|
||||
const instance = new (SecureStorage.getPlugin())(() => res(new SecureStorageObject(instance)), rej, store);
|
||||
const instance = new (SecureStorage.getPlugin())(
|
||||
() => res(new SecureStorageObject(instance)),
|
||||
rej,
|
||||
store
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,15 @@ export interface SiriShortcutOptions extends SiriShortcut {
|
||||
isEligibleForPrediction?: boolean;
|
||||
}
|
||||
|
||||
export interface ActivatedShortcutOptions {
|
||||
clear?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Siri Shortcuts
|
||||
* @description
|
||||
* This plugin only works when your app is built with XCode 10 Beta. Shortcuts will only appear on iOS-versions >= 12.0
|
||||
* This plugin only works when your app is built with XCode 10. Shortcuts will only appear on iOS-versions >= 12.0
|
||||
*
|
||||
* This plugin enables the use of Siri shortcuts in Cordova. Siri Shortcuts enable the user to perform certain actions by adding them to Siri.
|
||||
* After you have donated a shortcut to Siri, it will appear in the settings menu, after which the user is able to add the action. You can check
|
||||
@@ -71,6 +75,7 @@ export interface SiriShortcutOptions extends SiriShortcut {
|
||||
* @interfaces
|
||||
* SiriShortcut
|
||||
* SiriShortcutOptions
|
||||
* ActivatedShortcutOptions
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SiriShortcuts',
|
||||
@@ -134,10 +139,12 @@ export class SiriShortcuts extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Get the current clicked user activity, and return `null` if none
|
||||
* @param {ActivatedShortcutOptions|null} options Options to specify for getting the shortcut
|
||||
* @param {boolean} options.clear Clear the currently activated shortcut, defaults to true
|
||||
* @return Promise<SiriShortcut|null>
|
||||
*/
|
||||
@Cordova()
|
||||
getActivatedShortcut(): Promise<SiriShortcut | null> {
|
||||
getActivatedShortcut(options?: ActivatedShortcutOptions): Promise<SiriShortcut | null> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Sqlite Db Copy
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SqliteDbCopy } from '@ionic-native/sqlite-db-copy';
|
||||
*
|
||||
*
|
||||
* constructor(private sqliteDbCopy: SqliteDbCopy) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.sqliteDbCopy.copy('sample.db', 0)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'cordova-plugin-dbcopy',
|
||||
plugin: 'cordova-plugin-dbcopy',
|
||||
pluginRef: 'window.plugins.sqlDB',
|
||||
repo: 'https://github.com/an-rahulpandey/cordova-plugin-dbcopy',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class SqliteDbCopy extends IonicNativePlugin {
|
||||
/**
|
||||
* Copy database from www directory to device SQLite DB location
|
||||
* (for ios only, use 0 for Android)
|
||||
* location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.
|
||||
* or
|
||||
* location = 1; // If set will copy the database to Library folder instead of Documents folder.
|
||||
* or
|
||||
* location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database
|
||||
* @param dbname {string} Database file name available in www diretory with extension.The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via SQLitePlugin
|
||||
* @param location {number} Location where to copy the database for app (only applicable for ios).For Android pass 0.
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
copy(dbname: string, location: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Check if database is available at external storage. Useful when trying to copying the database from device sdcard.
|
||||
* @param dbname {string} Name of the database file which is available on external or intenral storage
|
||||
* @param source {string} Full native path for the folder in which db file is present. The "/" must be added at the end of path. For.eg. /sdcard/mydb/. Should not include dbname.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
checkDbOnStorage(dbname: string, source: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Copy database which is available on the device external/internal storage to app default db location
|
||||
* (for ios only, use 0 for Android)
|
||||
* location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.
|
||||
* or
|
||||
* location = 1; // If set will copy the database to Library folder instead of Documents folder.
|
||||
* or
|
||||
* location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database
|
||||
* @param dbname {string} Is the name of the database you want to copy. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via SQLitePlugin
|
||||
* @param location {number} Location where to copy the database for app (only applicable for ios). For Android pass 0.
|
||||
* @param source {string} Source File location like /sdcard/mydb/db.db. Please provide a valid existing location and the dbname should be present in the path.
|
||||
* @param deleteolddb {boolean} A boolean value if set to true, will delete the existing db from the local app database folder before copying the new db. Please provide proper boolean value true or false;
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 4,
|
||||
errorIndex: 5
|
||||
})
|
||||
copyDbFromStorage(
|
||||
dbname: string,
|
||||
location: number,
|
||||
source: string,
|
||||
deleteolddb: boolean
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Copy the app database to external/internal storage on the device.
|
||||
* (for ios only, use 0 for Android)
|
||||
* location = 0; //It will copy the database from Library/LocalDatabase location.
|
||||
* or
|
||||
* location = 1; // It will copy the database from Library folder instead.
|
||||
* or
|
||||
* location = 2; // It will copy the database from the default SQLite Database directory. This is the default location for database
|
||||
* @param dbname {string} Is the name of the database you want to copy. The plugin will look for and copy the file according to the filename provided here. And the same file name should be used while opening the database via SQLitePlugin.
|
||||
* @param location {number} Location where to copy the database for app (only applicable for ios). For Android pass 0.
|
||||
* @param destination {string} Destination File location like /sdcard/mydb/ Please provide a valid existing location and "/" should be present at the end of the path. Do not append db name in the path.
|
||||
* @param overwrite {boolean} If set to true, then will replace the file at the destination. Otherwise will throw an error, if destination file already exists.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 4,
|
||||
errorIndex: 5
|
||||
})
|
||||
copyDbToStorage(
|
||||
dbname: string,
|
||||
location: number,
|
||||
destination: string,
|
||||
overwrite: boolean
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* This method allows you to remove the database from the apps default database storage location.
|
||||
* (for ios only, use 0 for Android)
|
||||
* location = 0; // (Disable iCloud Backup) If set will copy the database to Library/LocalDatabase. The database will not be synced by the iCloud Backup.
|
||||
* or
|
||||
* location = 1; // If set will copy the database to Library folder instead of Documents folder.
|
||||
* or
|
||||
* location = 2; // It will copy the database in the default SQLite Database directory. This is the default location for database
|
||||
* @param dbname {string} Is the name of the database you want to remove. If the database file is having any extension, please provide that also.
|
||||
* @param location {number} Location where to copy the database for app (only applicable for ios).For Android pass 0.
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 2,
|
||||
errorIndex: 3
|
||||
})
|
||||
remove(dbname: string, location: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,6 @@ import { Injectable } from '@angular/core';
|
||||
})
|
||||
@Injectable()
|
||||
export class TapticEngine extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Use selection feedback generators to indicate a change in selection.
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
@@ -46,7 +45,7 @@ export class TapticEngine extends IonicNativePlugin {
|
||||
/**
|
||||
* Use this to indicate success/failure/warning to the user.
|
||||
* @param options {Object} should be of the type { type: 'success' } (or 'warning'/'error')
|
||||
* @param options.type {string}
|
||||
* @param {'success' | 'warning' | 'error'} options.type
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -57,7 +56,7 @@ export class TapticEngine extends IonicNativePlugin {
|
||||
/**
|
||||
* Use this to indicate success/failure/warning to the user.
|
||||
* @param options {Object} should be of the type { style: 'light' } (or 'medium'/'heavy')
|
||||
* @param options.type {string}
|
||||
* @param {'light' | 'medium' | 'heavy'} options.type
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -65,4 +64,30 @@ export class TapticEngine extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the taptic engine that a gesture for a selection change is starting.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
gestureSelectionStart(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the taptic engine that a selection changed during a gesture.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
gestureSelectionChanged(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the taptic engine we are done with a gesture. This needs to be called lest resources are not properly recycled.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
gestureSelectionEnd(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export interface Response {
|
||||
status: number;
|
||||
body: string;
|
||||
headers: { [key: string]: string};
|
||||
}
|
||||
|
||||
export interface Request {
|
||||
requestId: string;
|
||||
body: string;
|
||||
headers: string;
|
||||
method: 'POST' | 'GET' | 'PUT' | 'PATCH' | 'DELETE';
|
||||
path: string;
|
||||
query: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Web Server
|
||||
* @description
|
||||
* This plugin allows you to start a local dynamic content web server for android and iOS devices.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { WebServer } from '@ionic-native/web-server';
|
||||
*
|
||||
*
|
||||
* constructor(private webServer: WebServer) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.webServer.onRequest().subscribe(data => {
|
||||
* console.log(data);
|
||||
* const res: Response = {
|
||||
* status: 200,
|
||||
* body: '',
|
||||
* headers: {
|
||||
* 'Content-Type': 'text/html'
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* this.webServer.sendResponse(data.requestId, res)
|
||||
* .catch((error: any) => console.error(error));
|
||||
* });
|
||||
*
|
||||
* this.webServer.start(80)
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* Response
|
||||
* Request
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'WebServer',
|
||||
plugin: 'cordova-plugin-webserver',
|
||||
pluginRef: 'window.webserver',
|
||||
repo: 'https://github.com/bykof/cordova-plugin-webserver.git',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class WebServer extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* This method will start your webserver.
|
||||
* @param port {number} Port number (default to 8080)
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
start(port?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will stop your webserver.
|
||||
*/
|
||||
@Cordova()
|
||||
stop(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns an observable that streams HTTP requests to an observer.
|
||||
* @return {Observable<Request>} Returns an observable to resolve as a Request object
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
clearFunction: 'stop'
|
||||
})
|
||||
onRequest(): Observable<Request> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sends a response to a request.
|
||||
* @param requestId {string} Request ID to respond to
|
||||
* @param responseObject {Response} Response object
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
sendResponse(requestId: string, responseObject: Response): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user