Skip to content
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

feat(mobile-messaging): Added fullFeaturedInApps method to config, fetching of the Inbox methods and registerForRemoteAndroidNotifications method #4810

Merged
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
69 changes: 68 additions & 1 deletion src/@awesome-cordova-plugins/plugins/mobile-messaging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export type Event =
| 'depersonalized'
| 'inAppChat.availabilityUpdated'
| 'inAppChat.unreadMessageCounterUpdated'
| 'deeplink';
| 'deeplink'
| 'inAppChat.viewStateChanged';

export interface CustomEvent {
definitionId: string;
Expand All @@ -31,6 +32,7 @@ export interface Configuration {
applicationCode: string;
geofencingEnabled?: boolean;
inAppChatEnabled?: boolean;
fullFeaturedInAppsEnabled?: boolean | undefined;
/**
* Message storage save callback
*/
Expand Down Expand Up @@ -167,6 +169,20 @@ export interface Message {
webViewUrl?: string;
inAppOpenTitle?: string | undefined;
inAppDismissTitle?: string;
topic?: string | undefined;
}

export interface MMInbox {
countTotal: number;
countUnread: number;
messages?: Message[] | undefined;
}

export interface MMInboxFilterOptions {
fromDateTime?: string | undefined;
toDateTime?: string | undefined;
topic?: string | undefined;
limit?: number | undefined;
}

export interface MobileMessagingError {
Expand Down Expand Up @@ -592,4 +608,55 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin {
resetMessageCounter() {
return;
}

/**
* Registers for Android POST_NOTIFICATIONS permission
* @name registerForAndroidRemoteNotifications
*/
@Cordova()
registerForAndroidRemoteNotifications() {
return;
}

/**
* Fetch mobile inbox data from the server.
*
* @name fetchInboxMessages
* @param token access token (JWT in a strictly predefined format) required for current user to have access to the Inbox messages
* @param externalUserId External User ID is meant to be an ID of a user in an external (non-Infobip) service
* @param filterOptions filtering options applied to messages list in response. Nullable, will return default number of messages
* @param callback will be called on success
* @param {Function} errorCallback will be called on error
*/
@Cordova()
fetchInboxMessages(token: string, externalUserId: string, filterOptions: MMInboxFilterOptions): Promise<MMInbox> {
return;
}

/**
* Fetch mobile inbox without token from the server.
*
* @name fetchInboxMessagesWithoutToken
* @param externalUserId External User ID is meant to be an ID of a user in an external (non-Infobip) service
* @param filterOptions filtering options applied to messages list in response. Nullable, will return default number of messages
* @param callback will be called on success
* @param {Function} errorCallback will be called on error
*/
@Cordova()
fetchInboxMessagesWithoutToken(externalUserId: string, filterOptions: MMInboxFilterOptions): Promise<MMInbox> {
return;
}

/**
* Asynchronously marks inbox messages as seen
*
* @param externalUserId External User ID is meant to be an ID of a user in an external (non-Infobip) service
* @param messageIds array of inbox messages identifiers that need to be marked as seen
* @param callback will be called on success
* @param {Function} errorCallback will be called on error
*/
@Cordova()
setInboxMessagesSeen(externalUserId: string, messageIds: string[]): Promise<string[]> {
return;
}
}