feat(mobile-messaging): add callback parameter for Mobile Messaging S… (#4930)

* 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 <Ivan.Bilobrk@infobip.com>
This commit is contained in:
Ivan Bilobrk
2025-08-08 12:28:09 +02:00
committed by GitHub
parent ffdb71dbb2
commit 9605bb0f78

View File

@@ -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: '<your_application_code>',
* userDataJwt: '<user_data_jwt>',
* geofencingEnabled: '<true/false>',
* defaultMessageStorage: '<true/false>',
* 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<string[]> {
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;
}
}