Skip to content

Commit

Permalink
fix(unvired-cordova-sdk): Update the return type for startDiscoverySe…
Browse files Browse the repository at this point in the history
…rvice api (#3647)

* 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

* feat(unvired-cordova-sdk): add method to get log file path

* feat(unvired-cordova-sdk): test push notifications

* fix(unvired-cordova-sdk): define return for logRead

* doc(unvired-cordova-sdk): remove mobile only restriction for some apis

* feat(unvired-cordova-sdk): add new property containing HTTP status code.

* feat(unvired-cordova-sdk): add new functions to lock & unlock sending of data

* fix(unvired-cordova-sdk): update the return type for lock and unlock functions.

* fix(unvired-cordova-sdk): change the return type for lockDataSender api

* fix(unvired-cordova-sdk): fix the data type for ResultType and OutboxLockStatus

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

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

* feat(unvired-cordova-sdk): Added new notification type

* feat(unvired-cordova-sdk): delete outbox item based on lid

* fix(unvired-cordova-sdk): Update doc

* doc(unvired-cordova-sdk): Update doc for userSettings()

* feat(unvired-cordova-sdk): add new discovery api

* fix(unvired-cordova-sdk): rename the property

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

* fix(unvired-cordova-sdk): Update the return type for startDiscoveryService api

* doc(unvired-cordova-sdk): Rename the loginParameter languageCode to loginLanguage.

* changes after doing npm install

Co-authored-by: Srinidhi Anand Rao <srinidhi.rao@unvired.io>
  • Loading branch information
srinidhirao and Srinidhi Anand Rao committed May 11, 2021
1 parent da4ce96 commit b2da307
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 15 additions & 16 deletions src/@ionic-native/plugins/unvired-cordova-sdk/index.ts
Expand Up @@ -400,7 +400,7 @@ export class LoginParameters {
* Language code to be sent to UMP. Specify a two-letter language code.
* The default value of this is 'en'.
*/
languageCode: string;
loginLanguage: string;
}
export class LoginResult extends UnviredResult {
type: LoginListenerType;
Expand Down Expand Up @@ -1494,24 +1494,23 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}

/**
* Returns an observable to return the UMP URLs which are discoverable within the network.
* Clients can use this information to allow users to select UMP servers in login page.
* Returns a promise containing UMP servers which are discoverable within the network.
* Clients can use this information to allow users to select appropriate UMP server in the login page.
* ```
* this.unviredSDK.startDiscoveryService().subscribe( (result) => {
* if (result.type == ResultType.success) {
* console.log('Discovered URLs: ' + JSON.stringify(result.data))
* // {"name":"Chyme 98","url":"http://192.168.98.98:8080/UMP/","root":"UNVIRED","type":"DEVELOPMENT"}
* }
* else {
* console.log('Error in discovering URLs: ' + result.error)
* }
* })
* let discoveryServiceResult = await this.unviredSDK.startDiscoveryService()
* if (discoveryServiceResult.type == ResultType.success) {
* let UMPServers: any[] = discoveryServiceResult.data
* UMPServers.forEach(element => {
* console.log(JSON.stringify(element)) // {"name":"Chyme 98","url":"http://192.168.98.98:8080/UMP/","root":"UNVIRED","type":"DEVELOPMENT"}
* });
* }
* else {
* console.log('Error searching for UMP Servers: ' + discoveryServiceResult.error)
* }
* ```
*/
@Cordova({
observable: true,
})
startDiscoveryService(): Observable<UnviredResult> {
@Cordova()
startDiscoveryService(): Promise<UnviredResult> {
return;
}
}

0 comments on commit b2da307

Please sign in to comment.