超级群各个免打扰接口区别

1. 接口一:设置超级群默认免打扰。

一般由管理员设置的接口,针对超级群的所有群成员生效,针对超级群下所有频道生效,优先级较低。如果群成员自己调用接口三、四设置超级群的免打扰,那么以群成员自己设置的为准。

/*!
设置超级群的默认消息状态
@param targetId 会话 ID
@param level 等级
@param successBlock 设置成功的回调
@param errorBlock 设置失败的回调 [status:设置失败的错误码]
*/
- (void)setUltraGroupConversationDefaultNotificationLevel:(NSString *)targetId
                                                    level:(RCPushNotificationLevel)level
                                                  success:(void (^)(void))successBlock
                                                    error:(void (^)(RCErrorCode status))errorBlock;

2. 接口二:设置超级群频道默认免打扰。

一般由管理员设置的接口,针对超级群的所有群成员生效,仅针对设置的频道生效,优先级较低。如果群成员自己调用接口三、四设置超级群的免打扰,那么以群成员自己设置的为准。

/*!
设置超级群频道的默认消息状态
@param targetId                    会话 ID
@param channelId                   频道 ID
@param level                       消息通知级别
@param successBlock                设置成功的回调
@param errorBlock                  设置失败的回调 [status:设置失败的错误码]
@remarks 会话
*/
- (void)setUltraGroupConversationChannelDefaultNotificationLevel:(NSString *)targetId
                                                       channelId:(NSString *)channelId
                                                           level:(RCPushNotificationLevel)level
                                                         success:(void (^)(void))successBlock
                                                           error:(void (^)(RCErrorCode status))errorBlock;

3. 接口三:设置会话的免打扰。

用户级别接口,设置后仅针对自己生效,对其他群成员无影响,优先级较高。设置后如果和管理员调用接口一、二设置的有冲突,则以用户自己设置的为准。

如果是使用超级群但是并没有创建频道,也就是说您收发消息都没有传 channelId 的话,可以调用下面接口设置免打扰。

/*!
设置会话的消息提醒状态
@param conversationType            会话类型
@param targetId                    会话 ID
@param level                       消息通知级别
@param successBlock                设置成功的回调
@param errorBlock                  设置失败的回调 [status:设置失败的错误码]
@discussion 如要移除消息提醒状态,设置level为RCPushNotificationLevelDefault
@remarks 会话
*/- (void)setConversationNotificationLevel:(RCConversationType)conversationType
                                  targetId:(NSString *)targetId
                                     level:(RCPushNotificationLevel)level
                                   success:(void (^)(void))successBlock
                                     error:(void (^)(RCErrorCode status))errorBlock;

4. 接口四:设置频道的免打扰。

用户级别接口,设置后仅针对自己生效,对其他群成员无影响,优先级较高。设置后如果和管理员调用接口一、二设置的有冲突,则以用户自己设置的为准。

如果是使用超级群并且创建了频道,也就是说您收发消息都传了 channelId 的话,可以调用下面接口针对频道设置免打扰。如果想对超级群下所有频道都设置免打扰的话,需要您遍历频道列表分别设置。

/*!
设置频道的消息提醒状态
@param conversationType            会话类型
@param targetId                    会话 ID
@param channelId                   频道 ID
@param level                       消息通知级别
@param successBlock                设置成功的回调
@param errorBlock                  设置失败的回调 [status:设置失败的错误码]
@discussion如果您需要移除消息通知,level参数传入RCPushNotificationLevelDefault即可 
@remarks 会话
*/
- (void)setConversationChannelNotificationLevel:(RCConversationType)conversationType
                                       targetId:(NSString *)targetId
                                      channelId:(NSString *)channelId
                                          level:(RCPushNotificationLevel)level
                                        success:(void (^)(void))successBlock
                                          error:(void (^)(RCErrorCode status))errorBlock;