mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-28 22:10:20 +08:00
feat(cordova-secure-storage-echo): add extra options interface (#3295)
This commit is contained in:
parent
799cf94674
commit
95a67a813d
@ -1,5 +1,28 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CordovaCheck, CordovaInstance, IonicNativePlugin, Plugin, getPromise } from '@ionic-native/core';
|
||||
import { CordovaCheck, CordovaInstance, getPromise, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface SecureStorageEchoOptions {
|
||||
android: {
|
||||
/**
|
||||
* See https://github.com/mibrito707/cordova-plugin-secure-storage-echo#sharing-data-android
|
||||
*/
|
||||
packageName?: string;
|
||||
/**
|
||||
* Sets the duration of time (seconds) for which the Private Encryption Key is authorized to be used after the user is successfully authenticated.
|
||||
* See https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder.html#setUserAuthenticationValidityDurationSeconds(int)
|
||||
*/
|
||||
userAuthenticationValidityDuration?: number;
|
||||
/**
|
||||
* Custom title for Confirm Credentials screen.
|
||||
* See https://developer.android.com/reference/android/app/KeyguardManager.html#createConfirmDeviceCredentialIntent(java.lang.CharSequence,%20java.lang.CharSequence)
|
||||
*/
|
||||
unlockCredentialsTitle?: string;
|
||||
/**
|
||||
* Custom description for Confirm Credentials screen.
|
||||
*/
|
||||
unlockCredentialsDescription?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
@ -137,12 +160,13 @@ export class SecureStorageEcho extends IonicNativePlugin {
|
||||
* @returns {Promise<SecureStorageEchoObject>}
|
||||
*/
|
||||
@CordovaCheck()
|
||||
create(store: string): Promise<SecureStorageEchoObject> {
|
||||
create(store: string, options?: SecureStorageEchoOptions): Promise<SecureStorageEchoObject> {
|
||||
return getPromise<SecureStorageEchoObject>((res: Function, rej: Function) => {
|
||||
const instance = new (SecureStorageEcho.getPlugin())(
|
||||
() => res(new SecureStorageEchoObject(instance)),
|
||||
rej,
|
||||
store
|
||||
store,
|
||||
options
|
||||
);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user