Skip to content

Commit 9605bb0

Browse files
ivanbilobrkIvan Bilobrk
andauthored
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 <[email protected]>
1 parent ffdb71d commit 9605bb0

File tree

1 file changed

+16
-1
lines changed
  • src/@awesome-cordova-plugins/plugins/mobile-messaging

1 file changed

+16
-1
lines changed

src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface Configuration {
3030
* The application code of your Application from Push Portal website
3131
*/
3232
applicationCode: string;
33+
userDataJwt?: string;
3334
geofencingEnabled?: boolean;
3435
inAppChatEnabled?: boolean;
3536
fullFeaturedInAppsEnabled?: boolean | undefined;
@@ -295,6 +296,7 @@ export interface ChatSettingsIOS {
295296
*
296297
* this.mobileMessaging.init({
297298
* applicationCode: '<your_application_code>',
299+
* userDataJwt: '<user_data_jwt>',
298300
* geofencingEnabled: '<true/false>',
299301
* defaultMessageStorage: '<true/false>',
300302
* ios: {
@@ -329,11 +331,12 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin {
329331
* @name init
330332
* @param config. Configuration for Mobile Messaging
331333
* @param config
334+
* @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.
332335
* @param onInitError
333336
* @param {Function} onInitError. Error callback
334337
*/
335338
@Cordova({ sync: true })
336-
init(config: Configuration, onInitError?: (error: MobileMessagingError) => void) {
339+
init(config: Configuration, callback?: () => void, onInitError?: (error: MobileMessagingError) => void) {
337340
return;
338341
}
339342

@@ -659,4 +662,16 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin {
659662
setInboxMessagesSeen(externalUserId: string, messageIds: string[]): Promise<string[]> {
660663
return;
661664
}
665+
666+
/**
667+
* Updates JWT used for user data fetching and personalization.
668+
*
669+
* @name setUserDataJwt
670+
* @param jwt - JWT in a predefined format
671+
* @param {Function} errorCallback will be called on error
672+
*/
673+
@Cordova()
674+
setUserDataJwt(jwt: string, errorCallback?: (error: MobileMessagingError) => void) {
675+
return;
676+
}
662677
}

0 commit comments

Comments
 (0)