Skip to content

Commit

Permalink
feat(unvired-cordova-sdk): add methods to get and set log level and o…
Browse files Browse the repository at this point in the history
…ther functions. (#3207)

* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add support for metadata JSON

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): update doc

* feat(unvired-cordova-sdk): add methods to get and set log level

* fix(unvired-cordova-sdk): update the return type for getLog()

* feat(unvired-cordova-sdk): return platform name
  • Loading branch information
srinidhirao authored and danielsogl committed Oct 30, 2019
1 parent ec93301 commit 042e36d
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions src/@ionic-native/plugins/unvired-cordova-sdk/index.ts
Expand Up @@ -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
*/
Expand Down Expand Up @@ -229,6 +238,11 @@ export class UnviredResult {
errorDetail: string;
}

export class LogResult extends UnviredResult {
type: ResultType;
data: LogLevel;
}

export class NotifResult extends UnviredResult {
type: NotificationListenerType;
}
Expand Down Expand Up @@ -578,6 +592,23 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
return;
}

/**
* Returns the current log level.
*/
@Cordova()
getLogLevel(): Promise<LogResult> {
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()
Expand Down Expand Up @@ -1071,6 +1102,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
Expand Down Expand Up @@ -1205,7 +1251,35 @@ 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;
}
}

0 comments on commit 042e36d

Please sign in to comment.