feat(unvired-cordova-sdk): added demo mode login api (#3256)

* feat(unvired-cordova-sdk): added demo mode login api

* feat(unvired-cordova-sdk): added new properties for demo mode.
This commit is contained in:
Venkadesh P 2019-12-27 16:37:08 +05:30 committed by Daniel Sogl
parent d0f665f6fc
commit 8582fac076

View File

@ -56,6 +56,11 @@ export enum LoginListenerType {
* If there are multiple accounts active & no account is specified in the login(), then this value is returned indicating that a current account needs to be specified for the login(). * If there are multiple accounts active & no account is specified in the login(), then this value is returned indicating that a current account needs to be specified for the login().
*/ */
app_requires_current_account = 6 app_requires_current_account = 6
/**
* This value indicates app can proceed with demo mode.
*/
login_demo = 7
} }
export enum LoginType { export enum LoginType {
@ -347,6 +352,18 @@ export class LoginParameters {
*/ */
metadataJSON: string; metadataJSON: string;
/**
* Specify the demo data xml string for demo mode.
*/
demoData: string;
/**
* Set 'true' if the application supports demo mode otherwise set 'false'.
*/
demoModeRequired: boolean;
/* /*
* Set this value to true to persist web application database. By default, this value is false. * Set this value to true to persist web application database. By default, this value is false.
*/ */
@ -638,6 +655,23 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
return; return;
} }
/**
* This api initializes the Unvired Application.
* @param loginParameters Set of parameters to be passed the loginWithDemoData()
* For Example:
* ```
* let loginParameters = new LoginParameters()
* loginParameters.appName = 'UNVIRED_DIGITAL_FORMS'
* loginParameters.metadataPath = '../assets/metadata.json'
* loginParameters.loginType = LoginType.unvired
* loginParameters.demoData = "<tag></tag>"
* ```
*/
@Cordova()
loginWithDemoData(loginParameters: LoginParameters): Promise<LoginResult> {
return;
}
/** /**
* Logs out the last active user. * Logs out the last active user.
*/ */