From 345d5ed2e7c9bbd07c75e03bf8b42bef4c9df2b9 Mon Sep 17 00:00:00 2001 From: Venkadesh P Date: Fri, 5 Sep 2025 18:17:50 +0530 Subject: [PATCH] feat(cordova-plugin-unvired-sdk): added a new functions. --- .../plugins/unvired-cordova-sdk/index.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts index 431f46011..1e2882df0 100644 --- a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts +++ b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts @@ -213,6 +213,10 @@ export enum NotificationListenerType { * Notify that the JWT token is received */ JWTTokenReceived = 12, + /** + * Notify that the JWT token is expired + */ + jwtTokenExpired = 13 } export enum AttachmentItemStatus { @@ -1422,6 +1426,19 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { return; } + /** For Mobile platform only + * getPushNotificationListener - Register for callback on Push Notification received from server + * + * Mobile Only api + */ + @Cordova({ + observable: true, + }) + getPushNotificationListener(): Observable { + return; + }; + + /** * For Browser platform only. * Reinitialize web db. Use this api to initialize db from persisted local storage db @@ -1734,6 +1751,31 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { return; } + /** + * Sets the authentication token (JWT) to be used for communicating with UMP server. + * This api is useful in scenarios where the app has its own authentication mechanism and receives a JWT token from UMP server. + * The app can set this token using this api and all subsequent communication with UMP server would be authenticated using this token. + * + * @param token JWT token received from UMP server. + * @returns A promise containing true if the operation was successful. + */ + @Cordova() + setAuthToken(token: string): Promise { + return; + } + + /** + * Get the validity of the authentication token in seconds. + * If the return value is less than or equal to 0, then the token is either not set or expired. + * If the return value is greater than 0, then it contains the number of seconds for which the token is valid from now. + * + * @returns A promise containing number of seconds for which the token is valid. + */ + @Cordova() + getAuthTokenValidity(): Promise { + return; + } + /** * Get UMP request configuration with authentication headers * @param {string} endpoint - The API endpoint