Skip to content
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: 13 additions & 4 deletions notifications/preferences.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
| Categories | Events | Available preferences | Can user override? |
| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| Conversations | New messages | • Don't notify<br/>• **Notify for all messages (Default)** <br/>• Notify for messages with mentions | • **Yes (Default)**<br/>• No |
| | New replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions | • **Yes (Default)**<br/>• No |
| | New quoted replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions | • **Yes (Default)**<br/>• No |
| | New replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions<br/>• Notify for subscribed threads | • **Yes (Default)**<br/>• No |
| | New quoted replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions<br/>• Notify when my message is quoted | • **Yes (Default)**<br/>• No |
| Message actions | Message is edited | • Don't notify<br/>• **Notify (Default)** | • Yes<br/>• **No (Default)** |
| | Message is deleted | • Don't notify<br/>• **Notify (Default)** | • Yes<br/>• **No (Default)** |
| | Message receives a reaction | • Don't notify<br/>• Notify for reactions received on all messages<br/>• **Notify for reactions received on own messages (Default)** | • **Yes (Default)**<br/>• No |
Expand All @@ -60,6 +60,15 @@
| | A member is unbanned | • **Don't notify (Default)**<br/>• Notify | • **Yes (Default)**<br/>• No |
| | A member's scope changes | • **Don't notify (Default)**<br/>• Notify | • **Yes (Default)**<br/>• No |

<Info>
**Reply notification options**

- **Notify for subscribed threads** — the user is notified about new replies only in threads they are *subscribed* to. A user becomes subscribed to a thread by sending its parent message, replying in it, being @-mentioned in it, or explicitly following it — and can unfollow to stop. Useful in busy conversations where users only want updates on threads they are part of.

Check warning on line 66 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L66

Did you really mean 'unfollow'?
- **Notify when my message is quoted** *(quoted replies only)* — the sender of the original message is notified whenever someone quote-replies (swipe-to-reply) to their message, independent of threads or mentions.

Both options apply to **group** and **one-on-one** conversations, across **push, email, and SMS**.
</Info>

<Note>
Regarding Message edited & Message deleted events

Expand All @@ -78,11 +87,11 @@
<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 90 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L90

Did you really mean 'cordova'?

Check warning on line 90 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L90

Did you really mean 'Cordova'?
const preferences = await CometChatNotifications.fetchPreferences();

// Display Group preferences
const groupPreferences = preferences.getGroupPreferences();

Check warning on line 94 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L94

Did you really mean 'groupPreferences'?

const groupMessagesPreference = groupPreferences.getMessagesPreference();
const groupRepliesPreference = groupPreferences.getRepliesPreference();
Expand All @@ -104,7 +113,7 @@
```kotlin
CometChatNotifications.fetchPreferences(new CometChat.CallbackListener<NotificationPreferences>() {
@Override
public void onSuccess(NotificationPreferences notificationPreferences) {

Check warning on line 116 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L116

Did you really mean 'onSuccess'?

Check warning on line 116 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L116

Did you really mean 'notificationPreferences'?
// Display group preferences
GroupPreferences groupPreferences = notificationPreferences.getGroupPreferences();

Expand Down Expand Up @@ -147,7 +156,7 @@
let unbanned = groupPreferences?.memberUnbannedPreference;
let scope = groupPreferences?.memberScopeChangedPreference;

} onError: { error in

Check warning on line 159 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L159

Did you really mean 'onError'?
// Something went wrong while fetching notification preferences.
print("fetchPreferences: \(error.errorCode) \(error.errorDescription)");
}
Expand All @@ -174,7 +183,7 @@
MemberActionsOptions? memberUnbannedPreference = groupPreferences?.memberUnbanned;
MemberActionsOptions? memberScopeChangedPreference = groupPreferences?.memberScopeChanged;
},
onError: (e) {

Check warning on line 186 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L186

Did you really mean 'onError'?
debugPrint("fetchPreferences:error ${e.toString()}");
});
```
Expand All @@ -193,21 +202,21 @@

<Note>

Since the user is performing this action, enums have values as `SUBSCRIBE` or `DONT_SUBSCRIBE`. It is equivalent to "Notify" and "Don't notify" respectively, from the dashboard preferences.

Check warning on line 205 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L205

Did you really mean 'enums'?

</Note>

<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 212 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L212

Did you really mean 'cordova'?

Check warning on line 212 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L212

Did you really mean 'Cordova'?
// The example demonstrates modifying all values; however, modifying only the changed values is sufficient.

// Instantiate the NotificationPreferences.
const updatedPreferences = new NotificationPreferences();

Check warning on line 216 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L216

Did you really mean 'updatedPreferences'?

// Instantiate the preferences that you want to update.
const groupPreferences = new GroupPreferences();

Check warning on line 219 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L219

Did you really mean 'groupPreferences'?

// Change group preferences
groupPreferences.setMessagesPreference(MessagesOptions.DONT_SUBSCRIBE);
Expand All @@ -229,7 +238,7 @@

// Update the preferences and receive the updated copy.
const preferences = await CometChatNotifications.updatePreferences(
updatedPreferences

Check warning on line 241 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L241

Did you really mean 'updatedPreferences'?
);
```

Expand Down Expand Up @@ -281,10 +290,10 @@
// The example demonstrates modifying all values; however, modifying only the changed values is sufficient.

// Instantiate the NotificationPreferences.
let updatedPreferences = CometChatNotifications.NotificationPreferences();

Check warning on line 293 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L293

Did you really mean 'updatedPreferences'?

// Instantiate the preferences that you want to update.
let groupPreferences = CometChatNotifications.GroupPreferences();

Check warning on line 296 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L296

Did you really mean 'groupPreferences'?

// Change group preferences
groupPreferences.set(messagesPreference: .DONT_SUBSCRIBE)
Expand All @@ -301,12 +310,12 @@
groupPreferences.set(memberScopeChangedPreference: .SUBSCRIBE)

// Load the updates in the NotificationPreferences instance.
updatedPreferences.set(groupPreferences: groupPreferences)

Check warning on line 313 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L313

Did you really mean 'groupPreferences'?

// Update the preferences.
CometChatNotifications.updatePreferences(updatedPreferences) { updatedPreferences in

Check warning on line 316 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L316

Did you really mean 'updatedPreferences'?
print("updatePreferences: \(updatedPreferences)")

Check warning on line 317 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L317

Did you really mean 'updatedPreferences'?
} onError: { error in

Check warning on line 318 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L318

Did you really mean 'onError'?
print("updatePreferences: \(error.errorCode) \(error.errorDescription)")
}
```
Expand Down Expand Up @@ -358,8 +367,8 @@
| Categories | Events | Available preferences | Can user override? |
| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| Conversations | New messages | • Don't notify<br/>• **Notify for all messages (Default)**<br/>• Notify for messages with mentions | • **Yes (Default)**<br/>• No |
| | New replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions | • **Yes (Default)**<br/>• No |
| | New quoted replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions | • **Yes (Default)**<br/>• No |
| | New replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions<br/>• Notify for subscribed threads | • **Yes (Default)**<br/>• No |
| | New quoted replies | • Don't notify<br/>• **Notify for all replies (Default)**<br/>• Notify for replies with mentions<br/>• Notify when my message is quoted | • **Yes (Default)**<br/>• No |
| Message actions | Message is edited | • Don't notify<br/>• **Notify (Default)** | • Yes<br/>• **No (Default)** |
| | Message is deleted | • Don't notify<br/>• **Notify (Default)** | • Yes<br/>• **No (Default)** |
| | Message receives a reaction | • Don't notify<br/>• Notify for reactions received on all messages<br/>• **Notify for reactions received on own messages (Default)** | • **Yes (Default)**<br/>• No |
Expand All @@ -380,7 +389,7 @@
<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 392 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L392

Did you really mean 'cordova'?

Check warning on line 392 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L392

Did you really mean 'Cordova'?
const preferences = await CometChatNotifications.fetchPreferences();

// Display One-on-One preferences
Expand Down Expand Up @@ -427,7 +436,7 @@
let oneMessages = oneOnOnePreferences?.messagesPreference;
let oneReplies = oneOnOnePreferences?.repliesPreference;
let oneReactions = oneOnOnePreferences?.reactionsPreference;
} onError: { error in

Check warning on line 439 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L439

Did you really mean 'onError'?
// Something went wrong while fetching notification preferences.
print("fetchPreferences: \(error.errorCode) \(error.errorDescription)");
}
Expand All @@ -447,7 +456,7 @@
RepliesOptions? oneOnOneQuotedRepliesPreference = oneOnOnePreferences?.quotedReplies;
ReactionsOptions? oneOnOneReactionsPreference = oneOnOnePreferences?.reactions;
},
onError: (e) {

Check warning on line 459 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L459

Did you really mean 'onError'?
debugPrint("fetchPreferences:error ${e.toString()}");
});
```
Expand All @@ -467,7 +476,7 @@
<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 479 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L479

Did you really mean 'cordova'?

Check warning on line 479 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L479

Did you really mean 'Cordova'?
// The example demonstrates modifying all values; however, modifying only the changed values is sufficient.

// Instantiate the NotificationPreferences.
Expand All @@ -487,7 +496,7 @@

// Update the preferences and receive the updated copy.
const preferences = await CometChatNotifications.updatePreferences(
updatedPreferences

Check warning on line 499 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L499

Did you really mean 'updatedPreferences'?
);
```

Expand Down Expand Up @@ -549,7 +558,7 @@
// Update the preferences.
CometChatNotifications.updatePreferences(updatedPreferences) { updatedPreferences in
print("updatePreferences: \(updatedPreferences)")
} onError: { error in

Check warning on line 561 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L561

Did you really mean 'onError'?
print("updatePreferences: \(error.errorCode) \(error.errorDescription)")
}
```
Expand Down Expand Up @@ -610,16 +619,16 @@
<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 622 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L622

Did you really mean 'cordova'?

Check warning on line 622 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L622

Did you really mean 'Cordova'?
// Fetch mute preferences
const preferences = await CometChatNotifications.fetchPreferences();

// Display Mute preferences
const mutePreferences = preferences.getMutePreferences();

Check warning on line 627 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L627

Did you really mean 'mutePreferences'?
const DNDPreference = mutePreferences.getDNDPreference();

Check warning on line 628 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L628

Did you really mean 'DNDPreference'?

// Fetch muted conversations
const mutedConversations = await CometChatNotifications.getMutedConversations();

Check warning on line 631 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L631

Did you really mean 'mutedConversations'?
```

</Tab>
Expand All @@ -631,7 +640,7 @@
@Override
public void onSuccess(NotificationPreferences notificationPreferences) {
// Display mute preferences
MutePreferences mutePreferences = notificationPreferences.getMutePreferences();

Check warning on line 643 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L643

'mutePreferences' is repeated!

Check warning on line 643 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L643

Did you really mean 'mutePreferences'?
DNDOptions dndPreference = mutePreferences.getDNDPreference();
}

Expand Down Expand Up @@ -661,9 +670,9 @@
```swift
CometChatNotifications.fetchPreferences { notificationPreferences in
// Display mute preferences
let mutePreferences = notificationPreferences.mutePreferences;

Check warning on line 673 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L673

Did you really mean 'mutePreferences'?
let dndPreference = mutePreferences?.DNDPreference;
} onError: { error in

Check warning on line 675 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L675

Did you really mean 'onError'?
// Something went wrong while fetching notification preferences.
print("fetchPreferences: \(error.errorCode) \(error.errorDescription)");
}
Expand All @@ -671,7 +680,7 @@
// Fetch muted conversations
CometChatNotifications.getMutedConversations { mutedConversations in
print("getMutedConversations: \(mutedConversations)")
} onError: { error in

Check warning on line 683 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L683

Did you really mean 'onError'?
print("getMutedConversations: \(error.errorCode) \(error.errorDescription)")
}
```
Expand Down Expand Up @@ -721,7 +730,7 @@
| `type` | String | This can either be `oneOnOne` or `group`. |
| `until` | Number | This is a valid timestamp from the future. Eg: 1710696964705. |

**To unmute** one or more group or one-on-one conversations that were muted by the user, utilize the `CometChatNotifications.unmuteConversations()` method. This method requires an array of `UnmutedConversation` objects, each containing the following properties:

Check warning on line 733 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L733

Did you really mean 'unmute'?

| Property | Type | Description |
| -------- | ------ | ----------------------------------------- |
Expand All @@ -731,7 +740,7 @@
<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 743 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L743

Did you really mean 'cordova'?

Check warning on line 743 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L743

Did you really mean 'Cordova'?
// The example demonstrates modifying all values; however, modifying only the changed values is sufficient.

// Instantiate the NotificationPreferences.
Expand All @@ -753,24 +762,24 @@
// Mute conversations
const until = Date.now() + 86400000; // Mute for 1 day

const mutedUser = new MutedConversation();

Check warning on line 765 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L765

Did you really mean 'mutedUser'?
mutedUser.setId('cometchat-uid-1');
mutedUser.setType(CometChatNotifications.MutedConversationType.ONE_ON_ONE);
mutedUser.setUntil(until);

const mutedGroup = new MutedConversation();

Check warning on line 770 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L770

Did you really mean 'mutedGroup'?
mutedGroup.setId('cometchat-guid-1');
mutedGroup.setType(CometChatNotifications.MutedConversationType.GROUP);
mutedGroup.setUntil(until);

await CometChatNotifications.muteConversations([mutedUser, mutedGroup]);

Check warning on line 775 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L775

Did you really mean 'mutedGroup'?

// Unmute conversations

Check warning on line 777 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L777

Did you really mean 'Unmute'?
const unmutedUser = new UnmutedConversation();

Check warning on line 778 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L778

Did you really mean 'unmutedUser'?
unmutedUser.setId('cometchat-uid-1');
unmutedUser.setType(CometChatNotifications.MutedConversationType.ONE_ON_ONE);

const unmuteList = [unmutedUser];

Check warning on line 782 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L782

Did you really mean 'unmuteList'?

Check warning on line 782 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L782

Did you really mean 'unmutedUser'?

await CometChatNotifications.unmuteConversations(unmuteList);
```
Expand Down Expand Up @@ -865,53 +874,53 @@
let updatedPreferences = CometChatNotifications.NotificationPreferences();

// Instantiate the preferences that you want to update.
let mutePreferences = CometChatNotifications.MutePreferences();

Check warning on line 877 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L877

Did you really mean 'mutePreferences'?

// Change mute preferences
mutePreferences.set(DNDPreference:.ENABLED)

// Load the updates in the NotificationPreferences instance.
updatedPreferences.set(mutePreferences: mutePreferences);

Check warning on line 883 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L883

Did you really mean 'mutePreferences'?

// Update the preferences.
CometChatNotifications.updatePreferences(updatedPreferences) { updatedPreferences in
print("updatePreferences: \(updatedPreferences)")
} onError: { error in

Check warning on line 888 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L888

Did you really mean 'onError'?
print("updatePreferences: \(error.errorCode) \(error.errorDescription)")
}

// Mute conversations
let untilInterval = Date().addingTimeInterval(86400) // Mute for 1 day

Check warning on line 893 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L893

Did you really mean 'untilInterval'?
let until = Int(untilInterval.timeIntervalSince1970 * 1000) // Convert to milliseconds

var mutedUser = CometChatNotifications.MutedConversation()

Check warning on line 896 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L896

Did you really mean 'mutedUser'?
mutedUser.id = "cometchat-uid-1"
mutedUser.type = .ONE_ON_ONE
mutedUser.until = until

var mutedGroup = CometChatNotifications.MutedConversation()

Check warning on line 901 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L901

Did you really mean 'mutedGroup'?
mutedGroup.id = "cometchat-guid-1"
mutedGroup.type = .GROUP
mutedGroup.until = until

let allMuted = [mutedUser, mutedGroup]

Check warning on line 906 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L906

Did you really mean 'allMuted'?

Check warning on line 906 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L906

Did you really mean 'mutedUser'?

Check warning on line 906 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L906

Did you really mean 'mutedGroup'?

CometChatNotifications.muteConversations(allMuted) { success in
print("muteConversations: \(success)")
} onError: { error in

Check warning on line 910 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L910

Did you really mean 'onError'?
print("muteConversations: \(error.errorCode) \(error.errorDescription)")
}

// Unmute conversations

Check warning on line 914 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L914

Did you really mean 'Unmute'?

var unmutedUser = CometChatNotifications.UnmutedConversation()

Check warning on line 916 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L916

Did you really mean 'unmutedUser'?
unmutedUser.id = "cometchat-uid-1"
unmutedUser.type = .ONE_ON_ONE

let unmuteList = [unmutedUser]

Check warning on line 920 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L920

Did you really mean 'unmuteList'?

Check warning on line 920 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L920

Did you really mean 'unmutedUser'?
CometChatNotifications.unmuteConversations(unmuteList) { success in
print("unmuteConversations: \(success)")
} onError: { error in

Check warning on line 923 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L923

Did you really mean 'onError'?
print("unmuteConversations: \(error.errorCode) \(error.errorDescription)")
}
```
Expand Down Expand Up @@ -1004,25 +1013,25 @@
<Tabs>
<Tab title="JavaScript">
```js
// This is applicable for web, React native, Ionic cordova (Ionic Cordova is deprecated - use JavaScript SDK)

Check warning on line 1016 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1016

Did you really mean 'cordova'?

Check warning on line 1016 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1016

Did you really mean 'Cordova'?
const preferences = await CometChatNotifications.fetchPreferences();

// Display schedule preferences
const mutePreferences = preferences.getMutePreferences();
const schedulePreference = mutePreferences.getSchedulePreference();

Check warning on line 1021 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1021

Did you really mean 'schedulePreference'?

const mondaySchedule = schedulePreference.get(DayOfWeek.MONDAY);

Check warning on line 1023 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1023

Did you really mean 'mondaySchedule'?
const tuesdaySchedule = schedulePreference.get(DayOfWeek.TUESDAY);

Check warning on line 1024 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1024

Did you really mean 'tuesdaySchedule'?
const wednesdaySchedule = schedulePreference.get(DayOfWeek.WEDNESDAY);

Check warning on line 1025 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1025

Did you really mean 'wednesdaySchedule'?
const thursdaySchedule = schedulePreference.get(DayOfWeek.THURSDAY);

Check warning on line 1026 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1026

Did you really mean 'thursdaySchedule'?
const fridaySchedule = schedulePreference.get(DayOfWeek.FRIDAY);

Check warning on line 1027 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1027

Did you really mean 'fridaySchedule'?
const saturdaySchedule = schedulePreference.get(DayOfWeek.SATURDAY);

Check warning on line 1028 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1028

Did you really mean 'saturdaySchedule'?
const sundaySchedule = schedulePreference.get(DayOfWeek.SUNDAY);

Check warning on line 1029 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1029

Did you really mean 'sundaySchedule'?

// This action can be performed on other days of the week.
const mondayFrom = mondaySchedule?.getFrom();

Check warning on line 1032 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1032

Did you really mean 'mondayFrom'?
const mondayTo = mondaySchedule?.getTo();

Check warning on line 1033 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1033

Did you really mean 'mondayTo'?
const mondayDnd = mondaySchedule?.getDND();

Check warning on line 1034 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1034

Did you really mean 'mondayDnd'?
```

</Tab>
Expand All @@ -1034,7 +1043,7 @@
public void onSuccess(NotificationPreferences notificationPreferences) {
// Display schedule preferences
MutePreferences mutePreferences = notificationPreferences.getMutePreferences();
Map<DayOfWeek, DaySchedule> scheduleMap = mutePreferences.getSchedulePreference();

Check warning on line 1046 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1046

Did you really mean 'scheduleMap'?

DaySchedule monday = scheduleMap.get(DayOfWeek.MONDAY);
DaySchedule tuesday = scheduleMap.get(DayOfWeek.TUESDAY);
Expand Down Expand Up @@ -1080,7 +1089,7 @@
let mondayFrom = mondaySchedule?.from;
let mondayTo = mondaySchedule?.to;
let mondayDND = mondaySchedule?.dnd;
} onError: { error in

Check warning on line 1092 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1092

Did you really mean 'onError'?
// Something went wrong while fetching notification preferences.
print("fetchPreferences: \(error.errorCode) \(error.errorDescription)");
}
Expand Down Expand Up @@ -1166,13 +1175,13 @@
MutePreferences mutePreferences = new MutePreferences();

// Change schedule preferences
Map scheduleMap = new ArrayMap<DayOfWeek, DaySchedule>();

Check warning on line 1178 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1178

Did you really mean 'scheduleMap'?
DaySchedule mondaySchedule = new DaySchedule();

Check warning on line 1179 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1179

Did you really mean 'mondaySchedule'?
mondaySchedule.setFrom(2015);
mondaySchedule.setTo(2345);
mondaySchedule.setDnd(false);

scheduleMap.put(DayOfWeek.MONDAY, mondaySchedule);

Check warning on line 1184 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1184

Did you really mean 'mondaySchedule'?

mutePreferences.setSchedulePreference(scheduleMap);

Expand Down Expand Up @@ -1227,17 +1236,17 @@
```dart
// The example demonstrates modifying all values; however, modifying only the changed values is sufficient.

// Instantiate the NotificationPreferences

Check warning on line 1239 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1239

'NotificationPreferences' is repeated!
NotificationPreferences updatedPreferences = NotificationPreferences();

// Instantiate the preferences that you want to update.
MutePreferences mutePreferences = MutePreferences(dnd: DNDOptions.DISABLED);
Map<DayOfWeek, DaySchedule> scheduleMap = {};

DaySchedule mondaySchedule = DaySchedule(from: 2015, to: 2345, dnd: false);

Check warning on line 1246 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1246

Did you really mean 'mondaySchedule'?

Check warning on line 1246 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1246

Did you really mean 'dnd'?
scheduleMap[DayOfWeek.MONDAY] = mondaySchedule;

mutePreferences.schedule = scheduleMap;

Check warning on line 1249 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1249

Did you really mean 'mutePreferences'?

Check warning on line 1249 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1249

Did you really mean 'scheduleMap'?
updatedPreferences.mutePreferences = mutePreferences;

// Update the preferences.
Expand All @@ -1245,7 +1254,7 @@
onSuccess: (preferencesAfterUpdate) {
debugPrint("updatePreferences:success");
// Use the preferencesAfterUpdate
}, onError: (e) {

Check warning on line 1257 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1257

Did you really mean 'onError'?
debugPrint("updatePreferences:error: ${e.toString()}");
});
```
Expand Down Expand Up @@ -1293,7 +1302,7 @@
```kotlin
CometChatNotifications.resetPreferences(new CometChat.CallbackListener<NotificationPreferences>() {
@Override
public void onSuccess(NotificationPreferences defaultPreferences) {

Check warning on line 1305 in notifications/preferences.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

notifications/preferences.mdx#L1305

Did you really mean 'defaultPreferences'?
// Display the defaultPreferences.
}

Expand Down