差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 | 后一修订版 两侧同时换到之后的修订记录 | ||
im:ios:basics:message [2020/04/11 06:36] huanxinfudh [发送消息] |
im:ios:basics:message [2020/05/26 02:39] zhaoliang |
||
---|---|---|---|
行 900: | 行 900: | ||
*/ | */ | ||
- (void)messagesDidRead:(NSArray *)aMessages; | - (void)messagesDidRead:(NSArray *)aMessages; | ||
+ | </code> | ||
+ | |||
+ | ==== 设置群消息是否需要已读回执(增值服务) ==== | ||
+ | 当消息为群消息时,消息发送方(目前为管理员和群主)可以设置此消息是否需要已读回执,如需要,则设置EMMessage属性isNeedGroupAck为YES,之后发送。 | ||
+ | <code> | ||
+ | @property (nonatomic) BOOL isNeedGroupAck; | ||
+ | </code> | ||
+ | |||
+ | ==== 发送群消息已读回执 ==== | ||
+ | <code objc> | ||
+ | /*! | ||
+ | * \~chinese | ||
+ | * 发送群消息已读回执 | ||
+ | * | ||
+ | * 异步方法 | ||
+ | * | ||
+ | * @param aMessageId 消息id | ||
+ | * @param aGroupId 群id | ||
+ | * @param aContent 附加消息 | ||
+ | * @param aCompletionBlock 完成的回调 | ||
+ | * | ||
+ | * \~english | ||
+ | * Send read acknowledgement for message | ||
+ | * | ||
+ | * @param aMessageId Message id | ||
+ | * @param aGroupId group receiver | ||
+ | * @param aContent Content | ||
+ | * @param aCompletionBlock The callback of completion block | ||
+ | * | ||
+ | */ | ||
+ | - (void)sendGroupMessageReadAck:(NSString *)aMessageId | ||
+ | toGroup:(NSString *)aGroupId | ||
+ | content:(NSString *)aContent | ||
+ | completion:(void (^)(EMError *aError))aCompletionBlock; | ||
+ | |||
+ | // 调用 | ||
+ | // 发送群消息已读回执。在这里写只是为了演示发送,在APP中具体在哪里发送需要开发者自己决定。 | ||
+ | [[EMClient sharedClient].chatManager sendGroupMessageReadAck:@"messageId" | ||
+ | toGroup:@"GroupId" | ||
+ | content:@"回执内容" | ||
+ | completion:^(EMError *aError) | ||
+ | { | ||
+ | if (!aError) { | ||
+ | NSLog(@"发送已读回执成功"); | ||
+ | } else { | ||
+ | NSLog(@"发送已读回执失败的原因 --- %@", aError.errorDescription); | ||
+ | } | ||
+ | }]; | ||
+ | </code> | ||
+ | |||
+ | 当发送群已读回执后,消息发送方对应EMMessage的groupAckCount属性会有相应变化; | ||
+ | <code objc> | ||
+ | @property (nonatomic, readonly) int groupAckCount; | ||
+ | </code> | ||
+ | |||
+ | ==== 群消息已读回调 ==== | ||
+ | |||
+ | <code objc> | ||
+ | /*! | ||
+ | * \~chinese | ||
+ | * 收到群消息已读回执 | ||
+ | * | ||
+ | * @param aMessages 已读消息列表<EMGroupMessageAck> | ||
+ | * | ||
+ | * \~english | ||
+ | * Invoked when receiving read acknowledgement in message list | ||
+ | * | ||
+ | * @param aMessages Acknowledged message list<EMGroupMessageAck> | ||
+ | */ | ||
+ | - (void)groupMessageDidRead:(EMMessage *)aMessage | ||
+ | groupAcks:(NSArray *)aGroupAcks; | ||
</code> | </code> | ||