Skip to main content

Set Do Not Disturb by Conversation Type

Set Do Not Disturb Status for Conversations

IM service users can set the Do Not Disturb level for specified conversations or ultra groups.

Method

Future<int> changeConversationTypeNotificationLevel(RCIMIWConversationType type, RCIMIWPushNotificationLevel level, {IRCIMIWChangeConversationTypeNotificationLevelCallback? callback});

Parameter Description

ParameterTypeDescription
typeRCIMIWConversationTypeConversation type
levelRCIMIWPushNotificationLevelPush notification level
callbackIRCIMIWChangeConversationTypeNotificationLevelCallbackEvent callback. The SDK supports callback mode starting from version 5.3.1. Other callback methods for this interface are deprecated from version 5.4.0. If the callback parameter is provided, only the callback will be triggered.

Return Value

Return ValueDescription
Future<int>Status code of the current operation. 0 indicates success. Specific results need to be implemented via the interface callback. Non-zero indicates that the current operation failed, and the interface callback will not be triggered. Refer to the error code for details.

Code Example

IRCIMIWChangeConversationTypeNotificationLevelCallback? callback = IRCIMIWChangeConversationTypeNotificationLevelCallback(onConversationTypeNotificationLevelChanged: (int? code) {
//...
});

int? ret = await engine?.changeConversationTypeNotificationLevel(type, level, callback:callback);

Callback Method

  • onConversationTypeNotificationLevelChanged
Function(int? code, RCIMIWConversationType? type, RCIMIWPushNotificationLevel? level)? onConversationTypeNotificationLevelChanged;

Parameter Description

ParameterTypeDescription
codeintStatus code of the interface callback. 0 indicates success, non-zero indicates an exception.
typeRCIMIWConversationTypeConversation type
levelRCIMIWPushNotificationLevelPush notification level

Code Example

engine?.onConversationTypeNotificationLevelChanged = (int? code, RCIMIWConversationType? type, RCIMIWPushNotificationLevel? level) {
//...
};