From 9605bb0f781c41554a9cc4dfebc50fb9b2e47be3 Mon Sep 17 00:00:00 2001 From: Ivan Bilobrk Date: Fri, 8 Aug 2025 12:28:09 +0200 Subject: [PATCH] =?UTF-8?q?feat(mobile-messaging):=20add=20callback=20para?= =?UTF-8?q?meter=20for=20Mobile=20Messaging=20S=E2=80=A6=20(#4930)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(mobile-messaging): add callback parameter for Mobile Messaging SDK init function * fix(mobile-messaging): order of init parameters in JSDoc * feat(mobile-messaging): support for JWT authorization for user operations --------- Co-authored-by: Ivan Bilobrk --- .../plugins/mobile-messaging/index.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts b/src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts index 29572daab..6b869e6a1 100644 --- a/src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts +++ b/src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts @@ -30,6 +30,7 @@ export interface Configuration { * The application code of your Application from Push Portal website */ applicationCode: string; + userDataJwt?: string; geofencingEnabled?: boolean; inAppChatEnabled?: boolean; fullFeaturedInAppsEnabled?: boolean | undefined; @@ -295,6 +296,7 @@ export interface ChatSettingsIOS { * * this.mobileMessaging.init({ * applicationCode: '', + * userDataJwt: '', * geofencingEnabled: '', * defaultMessageStorage: '', * ios: { @@ -329,11 +331,12 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin { * @name init * @param config. Configuration for Mobile Messaging * @param config + * @param {Function} callback. Called after successful start of Mobile Messaging SDK initialization. Register for registrationUpdated event to know when it's ready to be used. * @param onInitError * @param {Function} onInitError. Error callback */ @Cordova({ sync: true }) - init(config: Configuration, onInitError?: (error: MobileMessagingError) => void) { + init(config: Configuration, callback?: () => void, onInitError?: (error: MobileMessagingError) => void) { return; } @@ -659,4 +662,16 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin { setInboxMessagesSeen(externalUserId: string, messageIds: string[]): Promise { return; } + + /** + * Updates JWT used for user data fetching and personalization. + * + * @name setUserDataJwt + * @param jwt - JWT in a predefined format + * @param {Function} errorCallback will be called on error + */ + @Cordova() + setUserDataJwt(jwt: string, errorCallback?: (error: MobileMessagingError) => void) { + return; + } }