Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}