ashen_23

sdk upgrade

Too many changes to show.

To preserve performance only 15 of 15+ files are displayed.

No preview for this file type
No preview for this file type
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 #ifndef IMGroupExt_h 9 #ifndef IMGroupExt_h
10 #define IMGroupExt_h 10 #define IMGroupExt_h
11 11
12 -#import "ImSDK.h"  
13 #import "TIMComm+Group.h" 12 #import "TIMComm+Group.h"
14 #import "TIMGroupManager+Ext.h" 13 #import "TIMGroupManager+Ext.h"
15 14
@@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
9 #ifndef ImSDK_h 9 #ifndef ImSDK_h
10 #define ImSDK_h 10 #define ImSDK_h
11 11
12 -#import "ImSDK.h"  
13 #import "TIMConversation+MsgExt.h" 12 #import "TIMConversation+MsgExt.h"
14 #import "TIMMessage+MsgExt.h" 13 #import "TIMMessage+MsgExt.h"
15 #import "TIMComm+MsgExt.h" 14 #import "TIMComm+MsgExt.h"
1 -//  
2 -// IMSdkComm.h  
3 -// ImSDK  
4 -//  
5 -// Created by bodeng on 10/12/14.  
6 -// Copyright (c) 2014 tencent. All rights reserved.  
7 -//  
8 -  
9 -#ifndef ImSDK_IMSdkComm_h  
10 -#define ImSDK_IMSdkComm_h  
11 -  
12 -@interface OMErrResp : NSObject  
13 -{  
14 - NSString* cmd; // 返回的命令字  
15 - int seq; // 请求包的seq  
16 - NSString* uin; // uin  
17 - int errCode; // 错误码  
18 - NSString* errTips; // error tips  
19 -}  
20 -  
21 -@property(nonatomic,strong) NSString* cmd;  
22 -@property(nonatomic,strong) NSString* uin;  
23 -@property(nonatomic,assign) int seq;  
24 -@property(nonatomic,assign) int errCode;  
25 -@property(nonatomic,strong) NSString* errTips;  
26 -  
27 -@end  
28 -  
29 -  
30 -/// 业务相关回调  
31 -  
32 -/**  
33 - * userid和tinyid 转换回包  
34 - * userList 存储IMUserId结构  
35 - */  
36 -@interface OMUserIdResp : NSObject{  
37 - NSArray* userList; // 用户的登录的open id  
38 -}  
39 -  
40 -  
41 -@property(nonatomic,strong) NSArray* userList;  
42 -  
43 -@end  
44 -  
45 -/**  
46 - * userid转换tinyid回调  
47 - *  
48 - * @param resp 回包结构  
49 - *  
50 - * @return 0 处理成功  
51 - */  
52 -typedef int (^OMUserIdSucc)(OMUserIdResp *resp);  
53 -  
54 -//请求回调  
55 -typedef int (^OMErr)(OMErrResp *resp);  
56 -  
57 -  
58 -/**  
59 - * 音视频回调  
60 - */  
61 -@interface OMCommandResp : NSObject{  
62 - NSData* rspbody;  
63 -}  
64 -  
65 -  
66 -@property(nonatomic,strong) NSData* rspbody;  
67 -  
68 -@end  
69 -  
70 -// relay 回调  
71 -typedef int (^OMCommandSucc)(OMCommandResp *resp);  
72 -  
73 -// request 回调  
74 -typedef void (^OMRequestSucc)(NSData * data);  
75 -typedef void (^OMRequsetFail)(int code, NSString* msg);  
76 -  
77 -/**  
78 - * UserId 结构,表示一个用户的账号信息  
79 - */  
80 -@interface IMUserId : NSObject{  
81 - NSString* uidtype; // uid 类型  
82 - unsigned int userappid;  
83 - NSString* userid; // 用户id  
84 - unsigned long long tinyid;  
85 - unsigned long long uin;  
86 -}  
87 -  
88 -@property(nonatomic,strong) NSString* uidtype;  
89 -@property(nonatomic,assign) unsigned int userappid;  
90 -@property(nonatomic,strong) NSString* userid;  
91 -@property(nonatomic,assign) unsigned long long tinyid;  
92 -@property(nonatomic,assign) unsigned long long uin;  
93 -  
94 -@end  
95 -  
96 -/**  
97 - * 一般多人音视频操作成功回调  
98 - */  
99 -typedef void (^OMMultiSucc)();  
100 -  
101 -/**  
102 - * 一般多人音视频操作失败回调  
103 - *  
104 - * @param code 错误码  
105 - * @param err 错误描述  
106 - */  
107 -typedef void (^OMMultiFail)(int code, NSString * err);  
108 -  
109 -#endif  
@@ -15,8 +15,9 @@ @@ -15,8 +15,9 @@
15 #import "TIMConversation.h" 15 #import "TIMConversation.h"
16 #import "TIMGroupManager.h" 16 #import "TIMGroupManager.h"
17 #import "TIMCallback.h" 17 #import "TIMCallback.h"
18 -//#import "TIMFriendshipManager.h"  
19 -  
20 -//#import "IMSdkInt.h" 18 +#import "TIMFriendshipManager.h"
  19 +#import "TIMErrorCode.h"
  20 +#import "IMGroupExt.h"
  21 +#import "IMMessageExt.h"
21 22
22 #endif 23 #endif
@@ -14,6 +14,8 @@ @@ -14,6 +14,8 @@
14 @class TIMMessage; 14 @class TIMMessage;
15 @class TIMGroupTipsElem; 15 @class TIMGroupTipsElem;
16 @class TIMGroupInfo; 16 @class TIMGroupInfo;
  17 +@class TIMSNSChangeInfo;
  18 +@class TIMFriendPendencyInfo;
17 19
18 /** 20 /**
19 * 连接通知回调 21 * 连接通知回调
@@ -35,7 +37,7 @@ @@ -35,7 +37,7 @@
35 - (void)onConnFailed:(int)code err:(NSString*)err; 37 - (void)onConnFailed:(int)code err:(NSString*)err;
36 38
37 /** 39 /**
38 - * 网络连接断开(断线只是通知用户,不需要重新登,重连以后会自动上线) 40 + * 网络连接断开(断线只是通知用户,不需要重新登,重连以后会自动上线)
39 * 41 *
40 * @param code 错误码 42 * @param code 错误码
41 * @param err 错误描述 43 * @param err 错误描述
@@ -83,11 +85,12 @@ @@ -83,11 +85,12 @@
83 - (void)onRefresh; 85 - (void)onRefresh;
84 86
85 /** 87 /**
86 - * 刷新部分会话(包括多终端已读上报同步) 88 + * 刷新部分会话
87 * 89 *
88 * @param conversations 会话(TIMConversation*)列表 90 * @param conversations 会话(TIMConversation*)列表
89 */ 91 */
90 -- (void)onRefreshConversations:(NSArray*)conversations; 92 +- (void)onRefreshConversations:(NSArray<TIMConversation *>*)conversations;
  93 +
91 @end 94 @end
92 95
93 /** 96 /**
@@ -139,7 +142,7 @@ @@ -139,7 +142,7 @@
139 @end 142 @end
140 143
141 /** 144 /**
142 - * 图片上传进度回调 145 + * 上传进度回调
143 */ 146 */
144 @protocol TIMUploadProgressListener <NSObject> 147 @protocol TIMUploadProgressListener <NSObject>
145 @optional 148 @optional
@@ -167,90 +170,40 @@ @@ -167,90 +170,40 @@
167 - (void)onGroupTipsEvent:(TIMGroupTipsElem*)elem; 170 - (void)onGroupTipsEvent:(TIMGroupTipsElem*)elem;
168 @end 171 @end
169 172
170 -///**  
171 -// * 好友代理事件回调  
172 -// */  
173 -//@protocol TIMFriendshipListener <NSObject>  
174 -//@optional  
175 -//  
176 -///**  
177 -// * 添加好友通知  
178 -// *  
179 -// * @param users 好友列表(TIMUserProfile*)  
180 -// */  
181 -//- (void)onAddFriends:(NSArray*)users;  
182 -//  
183 -///**  
184 -// * 删除好友通知  
185 -// *  
186 -// * @param identifiers 用户id列表(NSString*)  
187 -// */  
188 -//- (void)onDelFriends:(NSArray*)identifiers;  
189 -//  
190 -///**  
191 -// * 好友资料更新通知  
192 -// *  
193 -// * @param profiles 资料列表(TIMUserProfile*)  
194 -// */  
195 -//- (void)onFriendProfileUpdate:(NSArray*)profiles;  
196 -//  
197 -///**  
198 -// * 好友申请通知  
199 -// *  
200 -// * @param reqs 好友申请者id列表(TIMSNSChangeInfo*)  
201 -// */  
202 -//- (void)onAddFriendReqs:(NSArray*)reqs;  
203 -//  
204 -//@end 173 +/**
  174 + * 好友代理事件回调
  175 + */
  176 +@protocol TIMFriendshipListener <NSObject>
  177 +@optional
205 178
206 -//@protocol TIMGroupListener <NSObject>  
207 -//@optional  
208 -//  
209 -///**  
210 -// * 有新用户加入群时的通知回调  
211 -// *  
212 -// * @param groupId 群ID  
213 -// * @param membersInfo 加群用户的群资料(TIMGroupMemberInfo*)列表  
214 -// */  
215 -//- (void)onMemberJoin:(NSString*)groupId membersInfo:(NSArray*)membersInfo;  
216 -//  
217 -///**  
218 -// * 有群成员退群时的通知回调  
219 -// *  
220 -// * @param groupId 群ID  
221 -// * @param members 退群成员的identifier(NSString*)列表  
222 -// */  
223 -//- (void)onMemberQuit:(NSString*)groupId members:(NSArray*)members;  
224 -//  
225 -///**  
226 -// * 群成员信息更新的通知回调  
227 -// *  
228 -// * @param groupId 群ID  
229 -// * @param membersInfo 更新后的群成员资料(TIMGroupMemberInfo*)列表  
230 -// */  
231 -//- (void)onMemberUpdate:(NSString*)groupId membersInfo:(NSArray*)membersInfo;  
232 -//  
233 -///**  
234 -// * 加入群的通知回调  
235 -// *  
236 -// * @param groupInfo 加入群的群组资料  
237 -// */  
238 -//- (void)onGroupAdd:(TIMGroupInfo*)groupInfo;  
239 -//  
240 -///**  
241 -// * 本地群组资料被删除的通知回调,包括主动退群,被踢,群被解散,群被回收  
242 -// *  
243 -// * @param groupId 对应的群ID  
244 -// */  
245 -//- (void)onGroupDelete:(NSString*)groupId;  
246 -//  
247 -///**  
248 -// * 群资料更新的通知回调  
249 -// *  
250 -// * @param groupInfo 更新后的群资料信息  
251 -// */  
252 -//- (void)onGroupUpdate:(TIMGroupInfo*)groupInfo;  
253 -//  
254 -//@end 179 +/**
  180 + * 添加好友通知
  181 + *
  182 + * @param users 好友列表(NSString*)
  183 + */
  184 +- (void)onAddFriends:(NSArray*)users;
  185 +
  186 +/**
  187 + * 删除好友通知
  188 + *
  189 + * @param identifiers 用户id列表(NSString*)
  190 + */
  191 +- (void)onDelFriends:(NSArray*)identifiers;
  192 +
  193 +/**
  194 + * 好友资料更新通知
  195 + *
  196 + * @param profiles 资料列表(TIMSNSChangeInfo *)
  197 + */
  198 +- (void)onFriendProfileUpdate:(NSArray<TIMSNSChangeInfo *> *)profiles;
  199 +
  200 +/**
  201 + * 好友申请通知
  202 + *
  203 + * @param reqs 好友申请者id列表(TIMFriendPendencyInfo *)
  204 + */
  205 +- (void)onAddFriendReqs:(NSArray<TIMFriendPendencyInfo *> *)reqs;
  206 +
  207 +@end
255 208
256 #endif 209 #endif
@@ -9,481 +9,7 @@ @@ -9,481 +9,7 @@
9 #ifndef TIMComm_Group_h 9 #ifndef TIMComm_Group_h
10 #define TIMComm_Group_h 10 #define TIMComm_Group_h
11 11
12 -#import "ImSDK.h"  
13 -  
14 -@class TIMGroupPendencyMeta;  
15 -  
16 -#pragma mark - 枚举类型  
17 -  
18 -/**  
19 - * 群基本获取资料标志  
20 - */  
21 -typedef NS_ENUM(NSInteger, TIMGetGroupBaseInfoFlag) {  
22 - /**  
23 - * 不获取群组资料  
24 - */  
25 - TIM_GET_GROUP_BASE_INFO_FLAG_NONE = 0x00,  
26 - /**  
27 - * 获取群组名  
28 - */  
29 - TIM_GET_GROUP_BASE_INFO_FLAG_NAME = 0x01,  
30 - /**  
31 - * 获取创建时间  
32 - */  
33 - TIM_GET_GROUP_BASE_INFO_FLAG_CREATE_TIME = 0x01 << 1,  
34 - /**  
35 - * 获取群主id  
36 - */  
37 - TIM_GET_GROUP_BASE_INFO_FLAG_OWNER_UIN = 0x01 << 2,  
38 - /**  
39 - * (不可用)  
40 - */  
41 - TIM_GET_GROUP_BASE_INFO_FLAG_SEQ = 0x01 << 3,  
42 - /**  
43 - * 获取最近一次修改群信息时间  
44 - */  
45 - TIM_GET_GROUP_BASE_INFO_FLAG_TIME = 0x01 << 4,  
46 - /**  
47 - * (不可用)  
48 - */  
49 - TIM_GET_GROUP_BASE_INFO_FLAG_NEXT_MSG_SEQ = 0x01 << 5,  
50 - /**  
51 - * 获取最近一次发消息时间  
52 - */  
53 - TIM_GET_GROUP_BASE_INFO_FLAG_LAST_MSG_TIME = 0x01 << 6,  
54 - /**  
55 - * (不可用)  
56 - */  
57 - TIM_GET_GROUP_BASE_INFO_FLAG_APP_ID = 0x01 << 7,  
58 - /**  
59 - * 获取群成员数量  
60 - */  
61 - TIM_GET_GROUP_BASE_INFO_FLAG_MEMBER_NUM = 0x01 << 8,  
62 - /**  
63 - * 获取最大群成员数量  
64 - */  
65 - TIM_GET_GROUP_BASE_INFO_FLAG_MAX_MEMBER_NUM = 0x01 << 9,  
66 - /**  
67 - * 获取群公告  
68 - */  
69 - TIM_GET_GROUP_BASE_INFO_FLAG_NOTIFICATION = 0x01 << 10,  
70 - /**  
71 - * 获取群简介  
72 - */  
73 - TIM_GET_GROUP_BASE_INFO_FLAG_INTRODUCTION = 0x01 << 11,  
74 - /**  
75 - * 获取群头像  
76 - */  
77 - TIM_GET_GROUP_BASE_INFO_FLAG_FACE_URL = 0x01 << 12,  
78 - /**  
79 - * 获取入群类型  
80 - */  
81 - TIM_GET_GROUP_BASE_INFO_FLAG_ADD_OPTION = 0x01 << 13,  
82 - /**  
83 - * 获取群组类型  
84 - */  
85 - TIM_GET_GROUP_BASE_INFO_FLAG_GROUP_TYPE = 0x01 << 14,  
86 - /**  
87 - * 获取最后一条群消息  
88 - */  
89 - TIM_GET_GROUP_BASE_INFO_FLAG_LAST_MSG = 0x01 << 15,  
90 - /**  
91 - * 获取在线人数  
92 - */  
93 - TIM_GET_GROUP_BASE_INFO_FLAG_ONLINE_NUM = 0x01 << 16,  
94 - /**  
95 - * 获取群成员是否可见标志  
96 - */  
97 - TIM_GET_GROUP_BASE_INFO_VISIBLE = 0x01 << 17,  
98 - /**  
99 - * 获取群是否能被搜到标志  
100 - */  
101 - TIM_GET_GROUP_BASE_INFO_SEARCHABLE = 0x01 << 18,  
102 - /**  
103 - * 获取群全员禁言时间  
104 - */  
105 - TIM_GET_GROUP_BASE_INFO_ALL_SHUTUP = 0x01 << 19  
106 -};  
107 -  
108 -/**  
109 - * 群成员角色过滤方式  
110 - */  
111 -typedef NS_ENUM(NSInteger, TIMGroupMemberFilter) {  
112 - /**  
113 - * 全部成员  
114 - */  
115 - TIM_GROUP_MEMBER_FILTER_ALL = 0x00,  
116 - /**  
117 - * 群主  
118 - */  
119 - TIM_GROUP_MEMBER_FILTER_SUPER = 0x01,  
120 - /**  
121 - * 管理员  
122 - */  
123 - TIM_GROUP_MEMBER_FILTER_ADMIN = 0x02,  
124 - /**  
125 - * 普通成员  
126 - */  
127 - TIM_GROUP_MEMBER_FILTER_COMMON = 0x04,  
128 -};  
129 -  
130 -/**  
131 - * 群成员获取资料标志  
132 - */  
133 -typedef NS_ENUM(NSInteger, TIMGetGroupMemInfoFlag) {  
134 -  
135 - /**  
136 - * 入群时间  
137 - */  
138 - TIM_GET_GROUP_MEM_INFO_FLAG_JOIN_TIME = 0x01,  
139 - /**  
140 - * 消息标志  
141 - */  
142 - TIM_GET_GROUP_MEM_INFO_FLAG_MSG_FLAG = 0x01 << 1,  
143 - /**  
144 - * 角色  
145 - */  
146 - TIM_GET_GROUP_MEM_INFO_FLAG_ROLE_INFO = 0x01 << 3,  
147 - /**  
148 - * 禁言时间  
149 - */  
150 - TIM_GET_GROUP_MEM_INFO_FLAG_SHUTUP_TIME = 0x01 << 4,  
151 - /**  
152 - * 群名片  
153 - */  
154 - TIM_GET_GROUP_MEM_INFO_FLAG_NAME_CARD = 0x01 << 5,  
155 -};  
156 -  
157 -/**  
158 - * 群组操作结果  
159 - */  
160 -typedef NS_ENUM(NSInteger, TIMGroupMemberStatus) {  
161 - /**  
162 - * 操作失败  
163 - */  
164 - TIM_GROUP_MEMBER_STATUS_FAIL = 0,  
165 -  
166 - /**  
167 - * 操作成功  
168 - */  
169 - TIM_GROUP_MEMBER_STATUS_SUCC = 1,  
170 -  
171 - /**  
172 - * 无效操作,加群时已经是群成员,移除群组时不在群内  
173 - */  
174 - TIM_GROUP_MEMBER_STATUS_INVALID = 2,  
175 -  
176 - /**  
177 - * 等待处理,邀请入群时等待对方处理  
178 - */  
179 - TIM_GROUP_MEMBER_STATUS_PENDING = 3,  
180 -};  
181 -  
182 -typedef NS_ENUM(NSInteger, TIMGroupPendencyGetType) {  
183 - /**  
184 - * 申请入群  
185 - */  
186 - TIM_GROUP_PENDENCY_GET_TYPE_JOIN = 0x0,  
187 - /**  
188 - * 邀请入群  
189 - */  
190 - TIM_GROUP_PENDENCY_GET_TYPE_INVITE = 0x1,  
191 -};  
192 -  
193 -typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleStatus) {  
194 - /**  
195 - * 未处理  
196 - */  
197 - TIM_GROUP_PENDENCY_HANDLE_STATUS_UNHANDLED = 0,  
198 - /**  
199 - * 被他人处理  
200 - */  
201 - TIM_GROUP_PENDENCY_HANDLE_STATUS_OTHER_HANDLED = 1,  
202 - /**  
203 - * 被用户处理  
204 - */  
205 - TIM_GROUP_PENDENCY_HANDLE_STATUS_OPERATOR_HANDLED = 2,  
206 -};  
207 -  
208 -typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleResult) {  
209 - /**  
210 - * 拒绝申请  
211 - */  
212 - TIM_GROUP_PENDENCY_HANDLE_RESULT_REFUSE = 0,  
213 - /**  
214 - * 同意申请  
215 - */  
216 - TIM_GROUP_PENDENCY_HANDLE_RESULT_AGREE = 1,  
217 -};  
218 -  
219 -#pragma mark - block回调  
220 -  
221 -/**  
222 - * 群成员列表回调  
223 - *  
224 - * @param members 群成员列表  
225 - */  
226 -typedef void (^TIMGroupMemberSucc)(NSArray * members);  
227 -  
228 -/**  
229 - * 群列表回调  
230 - *  
231 - * @param arr 群列表  
232 - */  
233 -typedef void (^TIMGroupListSucc)(NSArray * arr);  
234 -  
235 -/**  
236 - * 本人群组内成员信息回调  
237 - *  
238 - * @param selfInfo 本人成员信息  
239 - */  
240 -typedef void (^TIMGroupSelfSucc)(TIMGroupMemberInfo * selfInfo);  
241 -  
242 -/**  
243 - * 群接受消息选项回调  
244 - *  
245 - * @param opt 群接受消息选项  
246 - */  
247 -typedef void (^TIMGroupReciveMessageOptSucc)(TIMGroupReceiveMessageOpt opt);  
248 -  
249 -/**  
250 - * 群成员列表回调(分页使用)  
251 - *  
252 - * @param members 群成员(TIMGroupMemberInfo*)列表  
253 - */  
254 -typedef void (^TIMGroupMemberSuccV2)(uint64_t nextSeq, NSArray * members);  
255 -  
256 -/**  
257 - * 群搜索回调  
258 - *  
259 - * @param totalNum 搜索结果的总数  
260 - * @param groups 请求的群列表片段  
261 - */  
262 -typedef void (^TIMGroupSearchSucc)(uint64_t totalNum, NSArray * groups);  
263 -  
264 -/**  
265 - * 获取群组未决请求列表成功  
266 - *  
267 - * @param meta 未决请求元信息  
268 - * @param pendencies 未决请求列表(TIMGroupPendencyItem)数组  
269 - */  
270 -typedef void (^TIMGetGroupPendencyListSucc)(TIMGroupPendencyMeta * meta, NSArray * pendencies);  
271 -  
272 -#pragma mark - 基本类型  
273 -  
274 -/**  
275 - * 创建群参数  
276 - */  
277 -@interface TIMCreateGroupInfo : TIMCodingModel  
278 -  
279 -/**  
280 - * 群组Id,nil则使用系统默认Id  
281 - */  
282 -@property(nonatomic,strong) NSString* group;  
283 -  
284 -/**  
285 - * 群名  
286 - */  
287 -@property(nonatomic,strong) NSString* groupName;  
288 -  
289 -/**  
290 - * 群类型:Private,Public,ChatRoom,AVChatRoom,BChatRoom  
291 - */  
292 -@property(nonatomic,strong) NSString* groupType;  
293 -  
294 -/**  
295 - * 是否设置入群选项,Private类型群组请设置为false  
296 - */  
297 -@property(nonatomic,assign) BOOL setAddOpt;  
298 -  
299 -/**  
300 - * 入群选项  
301 - */  
302 -@property(nonatomic,assign) TIMGroupAddOpt addOpt;  
303 -  
304 -/**  
305 - * 最大成员数,填0则系统使用默认值  
306 - */  
307 -@property(nonatomic,assign) uint32_t maxMemberNum;  
308 -  
309 -/**  
310 - * 群公告  
311 - */  
312 -@property(nonatomic,strong) NSString* notification;  
313 -  
314 -/**  
315 - * 群简介  
316 - */  
317 -@property(nonatomic,strong) NSString* introduction;  
318 -  
319 -/**  
320 - * 群头像  
321 - */  
322 -@property(nonatomic,strong) NSString* faceURL;  
323 -  
324 -/**  
325 - * 自定义字段集合,key是NSString*类型,value是NSData*类型  
326 - */  
327 -@property(nonatomic,strong) NSDictionary* customInfo;  
328 -  
329 -/**  
330 - * 创建成员(TIMCreateGroupMemberInfo*)列表  
331 - */  
332 -@property(nonatomic,strong) NSArray* membersInfo;  
333 -  
334 -@end  
335 -  
336 -/**  
337 - * 未决请求选项  
338 - */  
339 -@interface TIMGroupPendencyOption : TIMCodingModel  
340 -  
341 -/**  
342 - * 拉取的起始时间 0:拉取最新的  
343 - */  
344 -@property(nonatomic,assign) uint64_t timestamp;  
345 -  
346 -/**  
347 - * 每页的数量  
348 - */  
349 -@property(nonatomic,assign) uint32_t numPerPage;  
350 -@end  
351 -  
352 -/**  
353 - * 未决请求元信息  
354 - */  
355 -@interface TIMGroupPendencyMeta : TIMCodingModel  
356 -  
357 -/**  
358 - * 下一次拉取的起始时间戳  
359 - */  
360 -@property(nonatomic,assign) uint64_t nextStartTime;  
361 -  
362 -/**  
363 - * 已读时间戳大小  
364 - */  
365 -@property(nonatomic,assign) uint64_t readTimeSeq;  
366 -  
367 -/**  
368 - * 未决未读数  
369 - */  
370 -@property(nonatomic,assign) uint32_t unReadCnt;  
371 -  
372 -@end  
373 -  
374 -/**  
375 - * 创建群组时的成员信息  
376 - */  
377 -@interface TIMCreateGroupMemberInfo : TIMCodingModel  
378 -  
379 -/**  
380 - * 被操作成员  
381 - */  
382 -@property(nonatomic,strong) NSString* member;  
383 -  
384 -/**  
385 - * 成员类型  
386 - */  
387 -@property(nonatomic,assign) TIMGroupMemberRole role;  
388 -  
389 -/**  
390 - * 自定义字段集合,key是NSString*类型,value是NSData*类型  
391 - */  
392 -@property(nonatomic,strong) NSDictionary* customInfo;  
393 -  
394 -@end  
395 -  
396 -/**  
397 - * 成员操作返回值  
398 - */  
399 -@interface TIMGroupMemberResult : NSObject  
400 -  
401 -/**  
402 - * 被操作成员  
403 - */  
404 -@property(nonatomic,strong) NSString* member;  
405 -/**  
406 - * 返回状态  
407 - */  
408 -@property(nonatomic,assign) TIMGroupMemberStatus status;  
409 -  
410 -@end  
411 -  
412 -/**  
413 - * 未决申请  
414 - */  
415 -@interface TIMGroupPendencyItem : TIMCodingModel  
416 -  
417 -/**  
418 - * 相关群组id  
419 - */  
420 -@property(nonatomic,strong) NSString* groupId;  
421 -  
422 -/**  
423 - * 请求者id,请求加群:请求者,邀请加群:邀请人  
424 - */  
425 -@property(nonatomic,strong) NSString* fromUser;  
426 -  
427 -/**  
428 - * 判决者id,请求加群:0,邀请加群:被邀请人  
429 - */  
430 -@property(nonatomic,strong) NSString* toUser;  
431 -  
432 -/**  
433 - * 未决添加时间  
434 - */  
435 -@property(nonatomic,assign) uint64_t addTime;  
436 -  
437 -/**  
438 - * 未决请求类型  
439 - */  
440 -@property(nonatomic,assign) TIMGroupPendencyGetType getType;  
441 -  
442 -/**  
443 - * 已决标志  
444 - */  
445 -@property(nonatomic,assign) TIMGroupPendencyHandleStatus handleStatus;  
446 -  
447 -/**  
448 - * 已决结果  
449 - */  
450 -@property(nonatomic,assign) TIMGroupPendencyHandleResult handleResult;  
451 -  
452 -/**  
453 - * 申请或邀请附加信息  
454 - */  
455 -@property(nonatomic,strong) NSString* requestMsg;  
456 -  
457 -/**  
458 - * 审批信息:同意或拒绝信息  
459 - */  
460 -@property(nonatomic,strong) NSString* handledMsg;  
461 -  
462 -  
463 -/**  
464 - * 同意申请  
465 - *  
466 - * @param msg 同意理由,选填  
467 - * @param succ 成功回调  
468 - * @param fail 失败回调,返回错误码和错误描述  
469 - */  
470 --(void) accept:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;  
471 -  
472 -/**  
473 - * 拒绝申请  
474 - *  
475 - * @param msg 拒绝理由,选填  
476 - * @param succ 成功回调  
477 - * @param fail 失败回调,返回错误码和错误描述  
478 - */  
479 --(void) refuse:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;  
480 -  
481 -  
482 -/**  
483 - * 用户自己的id  
484 - */  
485 -@property(nonatomic,strong) NSString* selfIdentifier;  
486 -  
487 -@end 12 +//消息扩展类待废弃,请直接使用 TIMComm.h 调用相关方法
  13 +#import "TIMComm.h"
488 14
489 #endif /* TIMComm_Group_h */ 15 #endif /* TIMComm_Group_h */
@@ -9,157 +9,7 @@ @@ -9,157 +9,7 @@
9 #ifndef TIMComm_MsgExt_h 9 #ifndef TIMComm_MsgExt_h
10 #define TIMComm_MsgExt_h 10 #define TIMComm_MsgExt_h
11 11
12 -#import <Foundation/Foundation.h>  
13 -#import "ImSDK.h"  
14 -  
15 -@class TIMSendToUsersDetailInfo;  
16 -  
17 -#pragma mark - 枚举类型  
18 -  
19 -typedef NS_ENUM(NSInteger, TIM_SNS_SYSTEM_TYPE){  
20 - /**  
21 - * 增加好友消息  
22 - */  
23 - TIM_SNS_SYSTEM_ADD_FRIEND = 0x01,  
24 - /**  
25 - * 删除好友消息  
26 - */  
27 - TIM_SNS_SYSTEM_DEL_FRIEND = 0x02,  
28 - /**  
29 - * 增加好友申请  
30 - */  
31 - TIM_SNS_SYSTEM_ADD_FRIEND_REQ = 0x03,  
32 - /**  
33 - * 删除未决申请  
34 - */  
35 - TIM_SNS_SYSTEM_DEL_FRIEND_REQ = 0x04,  
36 - /**  
37 - * 黑名单添加  
38 - */  
39 - TIM_SNS_SYSTEM_ADD_BLACKLIST = 0x05,  
40 - /**  
41 - * 黑名单删除  
42 - */  
43 - TIM_SNS_SYSTEM_DEL_BLACKLIST = 0x06,  
44 - /**  
45 - * 未决已读上报  
46 - */  
47 - TIM_SNS_SYSTEM_PENDENCY_REPORT = 0x07,  
48 - /**  
49 - * 关系链资料变更  
50 - */  
51 - TIM_SNS_SYSTEM_SNS_PROFILE_CHANGE = 0x08,  
52 - /**  
53 - * 推荐数据增加  
54 - */  
55 - TIM_SNS_SYSTEM_ADD_RECOMMEND = 0x09,  
56 - /**  
57 - * 推荐数据删除  
58 - */  
59 - TIM_SNS_SYSTEM_DEL_RECOMMEND = 0x0a,  
60 - /**  
61 - * 已决增加  
62 - */  
63 - TIM_SNS_SYSTEM_ADD_DECIDE = 0x0b,  
64 - /**  
65 - * 已决删除  
66 - */  
67 - TIM_SNS_SYSTEM_DEL_DECIDE = 0x0c,  
68 - /**  
69 - * 推荐已读上报  
70 - */  
71 - TIM_SNS_SYSTEM_RECOMMEND_REPORT = 0x0d,  
72 - /**  
73 - * 已决已读上报  
74 - */  
75 - TIM_SNS_SYSTEM_DECIDE_REPORT = 0x0e,  
76 -  
77 -  
78 -};  
79 -  
80 -/**  
81 - * 资料变更  
82 - */  
83 -typedef NS_ENUM(NSInteger, TIM_PROFILE_SYSTEM_TYPE){  
84 - /**  
85 - 好友资料变更  
86 - */  
87 - TIM_PROFILE_SYSTEM_FRIEND_PROFILE_CHANGE = 0x01,  
88 -};  
89 -  
90 -#pragma mark - block回调  
91 -  
92 -typedef void (^TIMSendToUsersFail)(int code, NSString *err, TIMSendToUsersDetailInfo *detailInfo);  
93 -  
94 -#pragma mark - 基本类型  
95 -  
96 -/**  
97 - * 发送消息给多用户的失败回调信息  
98 - */  
99 -@interface TIMSendToUsersDetailInfo : NSObject  
100 -/**  
101 - * 发送消息成功的目标用户数  
102 - */  
103 -@property(nonatomic,assign) uint32_t succCnt;  
104 -/**  
105 - * 发送消息失败的目标用户数  
106 - */  
107 -@property(nonatomic,assign) uint32_t failCnt;  
108 -/**  
109 - * 失败信息(TIMSendToUsersErrInfo*)列表  
110 - */  
111 -@property(nonatomic,strong) NSArray *errInofs;  
112 -@end  
113 -  
114 -/**  
115 - * 发送消息给多用户的失败信息  
116 - */  
117 -@interface TIMSendToUsersErrInfo : NSObject  
118 -/**  
119 - * 发送消息失败的目标用户id  
120 - */  
121 -@property(nonatomic,strong) NSString *identifier;  
122 -/**  
123 - * 错误码  
124 - */  
125 -@property(nonatomic,assign) int code;  
126 -/**  
127 - * 错误描述  
128 - */  
129 -@property(nonatomic,strong) NSString *err;  
130 -@end  
131 -  
132 -/**  
133 - * 关系链变更详细信息  
134 - */  
135 -@interface TIMSNSChangeInfo : NSObject  
136 -  
137 -/**  
138 - * 用户 identifier  
139 - */  
140 -@property(nonatomic,strong) NSString * identifier;  
141 -  
142 -/**  
143 - * 用户昵称  
144 - */  
145 -@property(nonatomic,strong) NSString * nickname;  
146 -  
147 -/**  
148 - * 申请添加时有效,添加理由  
149 - */  
150 -@property(nonatomic,strong) NSString * wording;  
151 -  
152 -/**  
153 - * 申请时填写,添加来源  
154 - */  
155 -@property(nonatomic,strong) NSString * source;  
156 -  
157 -  
158 -/**  
159 - * 备注 type=TIM_SNS_SYSTEM_SNS_PROFILE_CHANGE 有效  
160 - */  
161 -@property(nonatomic,strong) NSString * remark;  
162 -  
163 -@end 12 +//消息扩展类待废弃,请直接使用 TIMComm.h 调用相关方法
  13 +#import "TIMComm.h"
164 14
165 #endif /* TIMComm_MsgExt_h */ 15 #endif /* TIMComm_MsgExt_h */
@@ -21,16 +21,25 @@ @@ -21,16 +21,25 @@
21 @protocol TIMMessageRevokeListener; 21 @protocol TIMMessageRevokeListener;
22 @protocol TIMUploadProgressListener; 22 @protocol TIMUploadProgressListener;
23 @protocol TIMGroupEventListener; 23 @protocol TIMGroupEventListener;
24 -//@protocol TIMFriendshipListener; 24 +@protocol TIMFriendshipListener;
25 //@protocol TIMGroupListener; 25 //@protocol TIMGroupListener;
26 @class TIMMessage; 26 @class TIMMessage;
27 @class TIMImageElem; 27 @class TIMImageElem;
28 @class TIMConversation; 28 @class TIMConversation;
29 @class TIMAPNSConfig; 29 @class TIMAPNSConfig;
30 @class TIMUserProfile; 30 @class TIMUserProfile;
  31 +@class TIMFriend;
31 @class TIMGroupInfoOption; 32 @class TIMGroupInfoOption;
32 @class TIMGroupMemberInfoOption; 33 @class TIMGroupMemberInfoOption;
33 @class TIMFriendProfileOption; 34 @class TIMFriendProfileOption;
  35 +@class TIMFriendResult;
  36 +@class TIMCheckFriendResult;
  37 +@class TIMGroupPendencyMeta;
  38 +@class TIMCreateGroupMemberInfo;
  39 +@class TIMSendToUsersDetailInfo;
  40 +@class TIMGroupInfo;
  41 +@class TIMGroupMemberInfo;
  42 +@class TIMGroupPendencyItem;
34 43
35 #pragma mark - 枚举类型 44 #pragma mark - 枚举类型
36 45
@@ -53,10 +62,25 @@ typedef NS_ENUM(NSInteger, TIMNetworkStatus) { @@ -53,10 +62,25 @@ typedef NS_ENUM(NSInteger, TIMNetworkStatus) {
53 * 日志级别 62 * 日志级别
54 */ 63 */
55 typedef NS_ENUM(NSInteger, TIMLogLevel) { 64 typedef NS_ENUM(NSInteger, TIMLogLevel) {
  65 + /**
  66 + * 不输出任何 sdk log
  67 + */
56 TIM_LOG_NONE = 0, 68 TIM_LOG_NONE = 0,
  69 + /**
  70 + * 输出 DEBUG,INFO,WARNING,ERROR 级别的 log
  71 + */
57 TIM_LOG_DEBUG = 3, 72 TIM_LOG_DEBUG = 3,
  73 + /**
  74 + * 输出 INFO,WARNING,ERROR 级别的 log
  75 + */
58 TIM_LOG_INFO = 4, 76 TIM_LOG_INFO = 4,
  77 + /**
  78 + * 输出 WARNING,ERROR 级别的 log
  79 + */
59 TIM_LOG_WARN = 5, 80 TIM_LOG_WARN = 5,
  81 + /**
  82 + * 输出 ERROR 级别的 log
  83 + */
60 TIM_LOG_ERROR = 6, 84 TIM_LOG_ERROR = 6,
61 }; 85 };
62 86
@@ -175,19 +199,19 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_TYPE){ @@ -175,19 +199,19 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_TYPE){
175 */ 199 */
176 typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ 200 typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){
177 /** 201 /**
178 - * JPG格式 202 + * JPG 格式
179 */ 203 */
180 TIM_IMAGE_FORMAT_JPG = 0x1, 204 TIM_IMAGE_FORMAT_JPG = 0x1,
181 /** 205 /**
182 - * GIF格式 206 + * GIF 格式
183 */ 207 */
184 TIM_IMAGE_FORMAT_GIF = 0x2, 208 TIM_IMAGE_FORMAT_GIF = 0x2,
185 /** 209 /**
186 - * PNG格式 210 + * PNG 格式
187 */ 211 */
188 TIM_IMAGE_FORMAT_PNG = 0x3, 212 TIM_IMAGE_FORMAT_PNG = 0x3,
189 /** 213 /**
190 - * BMP格式 214 + * BMP 格式
191 */ 215 */
192 TIM_IMAGE_FORMAT_BMP = 0x4, 216 TIM_IMAGE_FORMAT_BMP = 0x4,
193 /** 217 /**
@@ -196,23 +220,57 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ @@ -196,23 +220,57 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){
196 TIM_IMAGE_FORMAT_UNKNOWN = 0xff, 220 TIM_IMAGE_FORMAT_UNKNOWN = 0xff,
197 }; 221 };
198 222
  223 +/**
  224 + * 登录状态
  225 + */
199 typedef NS_ENUM(NSInteger, TIMLoginStatus) { 226 typedef NS_ENUM(NSInteger, TIMLoginStatus) {
200 /** 227 /**
201 - * 已登 228 + * 已登
202 */ 229 */
203 TIM_STATUS_LOGINED = 1, 230 TIM_STATUS_LOGINED = 1,
204 231
205 /** 232 /**
206 - * 登 233 + * 登
207 */ 234 */
208 TIM_STATUS_LOGINING = 2, 235 TIM_STATUS_LOGINING = 2,
209 236
210 /** 237 /**
211 - * 无登 238 + * 无登
212 */ 239 */
213 TIM_STATUS_LOGOUT = 3, 240 TIM_STATUS_LOGOUT = 3,
214 }; 241 };
215 242
  243 +/**
  244 + * 推送规则
  245 + */
  246 +typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) {
  247 + /**
  248 + * 按照默认规则进行推送
  249 + */
  250 + TIM_OFFLINE_PUSH_DEFAULT = 0,
  251 + /**
  252 + * 不进行推送
  253 + */
  254 + TIM_OFFLINE_PUSH_NO_PUSH = 1,
  255 +};
  256 +
  257 +/**
  258 + * 安卓离线推送模式
  259 + */
  260 +typedef NS_ENUM(NSInteger, TIMAndroidOfflinePushNotifyMode) {
  261 + /**
  262 + * 通知栏消息
  263 + */
  264 + TIM_ANDROID_OFFLINE_PUSH_NOTIFY_MODE_NOTIFICATION = 0x00,
  265 + /**
  266 + * 不弹窗,由应用自行处理
  267 + */
  268 + TIM_ANDROID_OFFLINE_PUSH_NOTIFY_MODE_CUSTOM = 0x01,
  269 +};
  270 +
  271 +/**
  272 + * 群组成员是否可见
  273 + */
216 typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { 274 typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) {
217 /** 275 /**
218 * 未知 276 * 未知
@@ -228,6 +286,9 @@ typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { @@ -228,6 +286,9 @@ typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) {
228 TIM_GROUP_MEMBER_VISIBLE_YES = 0x02, 286 TIM_GROUP_MEMBER_VISIBLE_YES = 0x02,
229 }; 287 };
230 288
  289 +/**
  290 + * 群组是否能被搜到
  291 + */
231 typedef NS_ENUM(NSInteger, TIMGroupSearchableType) { 292 typedef NS_ENUM(NSInteger, TIMGroupSearchableType) {
232 /** 293 /**
233 * 未知 294 * 未知
@@ -302,13 +363,13 @@ typedef NS_ENUM(NSInteger, TIMGroupReceiveMessageOpt) { @@ -302,13 +363,13 @@ typedef NS_ENUM(NSInteger, TIMGroupReceiveMessageOpt) {
302 */ 363 */
303 TIM_GROUP_NOT_RECEIVE_MESSAGE = 1, 364 TIM_GROUP_NOT_RECEIVE_MESSAGE = 1,
304 /** 365 /**
305 - * 接受消息,不进行iOS APNs 推送 366 + * 接受消息,不进行 iOS APNs 推送
306 */ 367 */
307 TIM_GROUP_RECEIVE_NOT_NOTIFY_MESSAGE = 2, 368 TIM_GROUP_RECEIVE_NOT_NOTIFY_MESSAGE = 2,
308 }; 369 };
309 370
310 /** 371 /**
311 - * 群Tips类型 372 + * 群 Tips 类型
312 */ 373 */
313 typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ 374 typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){
314 /** 375 /**
@@ -342,7 +403,7 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ @@ -342,7 +403,7 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){
342 }; 403 };
343 404
344 /** 405 /**
345 - * 群Tips类型 406 + * 群变更信息 Tips 类型
346 */ 407 */
347 typedef NS_ENUM(NSInteger, TIM_GROUP_INFO_CHANGE_TYPE){ 408 typedef NS_ENUM(NSInteger, TIM_GROUP_INFO_CHANGE_TYPE){
348 /** 409 /**
@@ -433,53 +494,244 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_SYSTEM_TYPE){ @@ -433,53 +494,244 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_SYSTEM_TYPE){
433 TIM_GROUP_SYSTEM_CUSTOM_INFO = 0xff, 494 TIM_GROUP_SYSTEM_CUSTOM_INFO = 0xff,
434 }; 495 };
435 496
436 -typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) { 497 +/**
  498 + * 群成员角色
  499 + */
  500 +typedef NS_ENUM(NSInteger, TIMGroupMemberRole) {
437 /** 501 /**
438 - * 按照默认规则进行推送 502 + * 未定义(没有获取该字段)
439 */ 503 */
440 - TIM_OFFLINE_PUSH_DEFAULT = 0, 504 + TIM_GROUP_MEMBER_UNDEFINED = 0,
  505 +
441 /** 506 /**
442 - * 不进行推送 507 + * 群成员
443 */ 508 */
444 - TIM_OFFLINE_PUSH_NO_PUSH = 1, 509 + TIM_GROUP_MEMBER_ROLE_MEMBER = 200,
  510 +
  511 + /**
  512 + * 群管理员
  513 + */
  514 + TIM_GROUP_MEMBER_ROLE_ADMIN = 300,
  515 +
  516 + /**
  517 + * 群主
  518 + */
  519 + TIM_GROUP_MEMBER_ROLE_SUPER = 400,
445 }; 520 };
446 521
447 -typedef NS_ENUM(NSInteger, TIMAndroidOfflinePushNotifyMode) { 522 +/**
  523 + * 群基本获取资料标志
  524 + */
  525 +typedef NS_ENUM(NSInteger, TIMGetGroupBaseInfoFlag) {
448 /** 526 /**
449 - * 通知栏消息 527 + * 不获取群组资料
450 */ 528 */
451 - TIM_ANDROID_OFFLINE_PUSH_NOTIFY_MODE_NOTIFICATION = 0x00, 529 + TIM_GET_GROUP_BASE_INFO_FLAG_NONE = 0x00,
452 /** 530 /**
453 - * 不弹窗,由应用自行处理 531 + * 获取群组名
454 */ 532 */
455 - TIM_ANDROID_OFFLINE_PUSH_NOTIFY_MODE_CUSTOM = 0x01, 533 + TIM_GET_GROUP_BASE_INFO_FLAG_NAME = 0x01,
  534 + /**
  535 + * 获取创建时间
  536 + */
  537 + TIM_GET_GROUP_BASE_INFO_FLAG_CREATE_TIME = 0x01 << 1,
  538 + /**
  539 + * 获取群主id
  540 + */
  541 + TIM_GET_GROUP_BASE_INFO_FLAG_OWNER_UIN = 0x01 << 2,
  542 + /**
  543 + * (不可用)
  544 + */
  545 + TIM_GET_GROUP_BASE_INFO_FLAG_SEQ = 0x01 << 3,
  546 + /**
  547 + * 获取最近一次修改群信息时间
  548 + */
  549 + TIM_GET_GROUP_BASE_INFO_FLAG_TIME = 0x01 << 4,
  550 + /**
  551 + * (不可用)
  552 + */
  553 + TIM_GET_GROUP_BASE_INFO_FLAG_NEXT_MSG_SEQ = 0x01 << 5,
  554 + /**
  555 + * 获取最近一次发消息时间
  556 + */
  557 + TIM_GET_GROUP_BASE_INFO_FLAG_LAST_MSG_TIME = 0x01 << 6,
  558 + /**
  559 + * (不可用)
  560 + */
  561 + TIM_GET_GROUP_BASE_INFO_FLAG_APP_ID = 0x01 << 7,
  562 + /**
  563 + * 获取群成员数量
  564 + */
  565 + TIM_GET_GROUP_BASE_INFO_FLAG_MEMBER_NUM = 0x01 << 8,
  566 + /**
  567 + * 获取最大群成员数量
  568 + */
  569 + TIM_GET_GROUP_BASE_INFO_FLAG_MAX_MEMBER_NUM = 0x01 << 9,
  570 + /**
  571 + * 获取群公告
  572 + */
  573 + TIM_GET_GROUP_BASE_INFO_FLAG_NOTIFICATION = 0x01 << 10,
  574 + /**
  575 + * 获取群简介
  576 + */
  577 + TIM_GET_GROUP_BASE_INFO_FLAG_INTRODUCTION = 0x01 << 11,
  578 + /**
  579 + * 获取群头像
  580 + */
  581 + TIM_GET_GROUP_BASE_INFO_FLAG_FACE_URL = 0x01 << 12,
  582 + /**
  583 + * 获取入群类型
  584 + */
  585 + TIM_GET_GROUP_BASE_INFO_FLAG_ADD_OPTION = 0x01 << 13,
  586 + /**
  587 + * 获取群组类型
  588 + */
  589 + TIM_GET_GROUP_BASE_INFO_FLAG_GROUP_TYPE = 0x01 << 14,
  590 + /**
  591 + * 获取最后一条群消息
  592 + */
  593 + TIM_GET_GROUP_BASE_INFO_FLAG_LAST_MSG = 0x01 << 15,
  594 + /**
  595 + * 获取在线人数
  596 + */
  597 + TIM_GET_GROUP_BASE_INFO_FLAG_ONLINE_NUM = 0x01 << 16,
  598 + /**
  599 + * 获取群成员是否可见标志
  600 + */
  601 + TIM_GET_GROUP_BASE_INFO_VISIBLE = 0x01 << 17,
  602 + /**
  603 + * 获取群是否能被搜到标志
  604 + */
  605 + TIM_GET_GROUP_BASE_INFO_SEARCHABLE = 0x01 << 18,
  606 + /**
  607 + * 获取群全员禁言时间
  608 + */
  609 + TIM_GET_GROUP_BASE_INFO_ALL_SHUTUP = 0x01 << 19
456 }; 610 };
457 611
458 /** 612 /**
459 - * 群成员角色 613 + * 群成员角色过滤方式
460 */ 614 */
461 -typedef NS_ENUM(NSInteger, TIMGroupMemberRole) { 615 +typedef NS_ENUM(NSInteger, TIMGroupMemberFilter) {
462 /** 616 /**
463 - * 未定义(没有获取该字段) 617 + * 全部成员
464 */ 618 */
465 - TIM_GROUP_MEMBER_UNDEFINED = 0, 619 + TIM_GROUP_MEMBER_FILTER_ALL = 0x00,
  620 + /**
  621 + * 群主
  622 + */
  623 + TIM_GROUP_MEMBER_FILTER_SUPER = 0x01,
  624 + /**
  625 + * 管理员
  626 + */
  627 + TIM_GROUP_MEMBER_FILTER_ADMIN = 0x02,
  628 + /**
  629 + * 普通成员
  630 + */
  631 + TIM_GROUP_MEMBER_FILTER_COMMON = 0x04,
  632 +};
  633 +
  634 +/**
  635 + * 群成员获取资料标志
  636 + */
  637 +typedef NS_ENUM(NSInteger, TIMGetGroupMemInfoFlag) {
466 638
467 /** 639 /**
468 - * 群成员 640 + * 入群时间
469 */ 641 */
470 - TIM_GROUP_MEMBER_ROLE_MEMBER = 200, 642 + TIM_GET_GROUP_MEM_INFO_FLAG_JOIN_TIME = 0x01,
  643 + /**
  644 + * 消息标志
  645 + */
  646 + TIM_GET_GROUP_MEM_INFO_FLAG_MSG_FLAG = 0x01 << 1,
  647 + /**
  648 + * 角色
  649 + */
  650 + TIM_GET_GROUP_MEM_INFO_FLAG_ROLE_INFO = 0x01 << 3,
  651 + /**
  652 + * 禁言时间
  653 + */
  654 + TIM_GET_GROUP_MEM_INFO_FLAG_SHUTUP_TIME = 0x01 << 4,
  655 + /**
  656 + * 群名片
  657 + */
  658 + TIM_GET_GROUP_MEM_INFO_FLAG_NAME_CARD = 0x01 << 5,
  659 +};
  660 +
  661 +/**
  662 + * 群组操作结果
  663 + */
  664 +typedef NS_ENUM(NSInteger, TIMGroupMemberStatus) {
  665 + /**
  666 + * 操作失败
  667 + */
  668 + TIM_GROUP_MEMBER_STATUS_FAIL = 0,
471 669
472 /** 670 /**
473 - * 群管理员 671 + * 操作成功
474 */ 672 */
475 - TIM_GROUP_MEMBER_ROLE_ADMIN = 300, 673 + TIM_GROUP_MEMBER_STATUS_SUCC = 1,
476 674
477 /** 675 /**
478 - * 群主 676 + * 无效操作,加群时已经是群成员,移除群组时不在群内
479 */ 677 */
480 - TIM_GROUP_MEMBER_ROLE_SUPER = 400, 678 + TIM_GROUP_MEMBER_STATUS_INVALID = 2,
  679 +
  680 + /**
  681 + * 等待处理,邀请入群时等待对方处理
  682 + */
  683 + TIM_GROUP_MEMBER_STATUS_PENDING = 3,
  684 +};
  685 +
  686 +/**
  687 + * 群组未决请求类型
  688 + */
  689 +typedef NS_ENUM(NSInteger, TIMGroupPendencyGetType) {
  690 + /**
  691 + * 申请入群
  692 + */
  693 + TIM_GROUP_PENDENCY_GET_TYPE_JOIN = 0x0,
  694 + /**
  695 + * 邀请入群
  696 + */
  697 + TIM_GROUP_PENDENCY_GET_TYPE_INVITE = 0x1,
  698 +};
  699 +
  700 +/**
  701 + * 群组已决标志
  702 + */
  703 +typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleStatus) {
  704 + /**
  705 + * 未处理
  706 + */
  707 + TIM_GROUP_PENDENCY_HANDLE_STATUS_UNHANDLED = 0,
  708 + /**
  709 + * 被他人处理
  710 + */
  711 + TIM_GROUP_PENDENCY_HANDLE_STATUS_OTHER_HANDLED = 1,
  712 + /**
  713 + * 被用户处理
  714 + */
  715 + TIM_GROUP_PENDENCY_HANDLE_STATUS_OPERATOR_HANDLED = 2,
  716 +};
  717 +
  718 +/**
  719 + * 群组已决结果
  720 + */
  721 +typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleResult) {
  722 + /**
  723 + * 拒绝申请
  724 + */
  725 + TIM_GROUP_PENDENCY_HANDLE_RESULT_REFUSE = 0,
  726 + /**
  727 + * 同意申请
  728 + */
  729 + TIM_GROUP_PENDENCY_HANDLE_RESULT_AGREE = 1,
481 }; 730 };
482 731
  732 +/**
  733 + * 好友验证方式
  734 + */
483 typedef NS_ENUM(NSInteger, TIMFriendAllowType) { 735 typedef NS_ENUM(NSInteger, TIMFriendAllowType) {
484 /** 736 /**
485 * 同意任何用户加好友 737 * 同意任何用户加好友
@@ -497,6 +749,9 @@ typedef NS_ENUM(NSInteger, TIMFriendAllowType) { @@ -497,6 +749,9 @@ typedef NS_ENUM(NSInteger, TIMFriendAllowType) {
497 TIM_FRIEND_DENY_ANY = 2, 749 TIM_FRIEND_DENY_ANY = 2,
498 }; 750 };
499 751
  752 +/**
  753 + * 性别
  754 + */
500 typedef NS_ENUM(NSInteger, TIMGender) { 755 typedef NS_ENUM(NSInteger, TIMGender) {
501 /** 756 /**
502 * 未知性别 757 * 未知性别
@@ -514,60 +769,80 @@ typedef NS_ENUM(NSInteger, TIMGender) { @@ -514,60 +769,80 @@ typedef NS_ENUM(NSInteger, TIMGender) {
514 }; 769 };
515 770
516 /** 771 /**
517 - * 基本资料标志位 772 + * 操作类型
518 */ 773 */
519 -typedef NS_ENUM(NSInteger, TIMProfileFlag) { 774 +typedef NS_ENUM(NSInteger, TIM_SNS_SYSTEM_TYPE){
  775 + /**
  776 + * 增加好友消息
  777 + */
  778 + TIM_SNS_SYSTEM_ADD_FRIEND = 0x01,
  779 + /**
  780 + * 删除好友消息
  781 + */
  782 + TIM_SNS_SYSTEM_DEL_FRIEND = 0x02,
  783 + /**
  784 + * 增加好友申请
  785 + */
  786 + TIM_SNS_SYSTEM_ADD_FRIEND_REQ = 0x03,
520 /** 787 /**
521 - * 昵称 788 + * 删除未决申请
522 */ 789 */
523 - TIM_PROFILE_FLAG_NICK = 0x01, 790 + TIM_SNS_SYSTEM_DEL_FRIEND_REQ = 0x04,
524 /** 791 /**
525 - * 好友验证方式 792 + * 黑名单添加
526 */ 793 */
527 - TIM_PROFILE_FLAG_ALLOW_TYPE = (0x01 << 1), 794 + TIM_SNS_SYSTEM_ADD_BLACKLIST = 0x05,
528 /** 795 /**
529 - * 头像 796 + * 黑名单删除
530 */ 797 */
531 - TIM_PROFILE_FLAG_FACE_URL = (0x01 << 2), 798 + TIM_SNS_SYSTEM_DEL_BLACKLIST = 0x06,
532 /** 799 /**
533 - * 好友备注 800 + * 未决已读上报
534 */ 801 */
535 - TIM_PROFILE_FLAG_REMARK = (0x01 << 3), 802 + TIM_SNS_SYSTEM_PENDENCY_REPORT = 0x07,
536 /** 803 /**
537 - * 好友分组 804 + * 关系链资料变更
538 */ 805 */
539 - TIM_PROFILE_FLAG_GROUP = (0x01 << 4), 806 + TIM_SNS_SYSTEM_SNS_PROFILE_CHANGE = 0x08,
540 /** 807 /**
541 - * 用户签名 808 + * 推荐数据增加
542 */ 809 */
543 - TIM_PROFILE_FLAG_SELFSIGNATURE = (0x01 << 5), 810 + TIM_SNS_SYSTEM_ADD_RECOMMEND = 0x09,
544 /** 811 /**
545 - * 用户性别 812 + * 推荐数据删除
546 */ 813 */
547 - TIM_PROFILE_FLAG_GENDER = (0x01 << 6), 814 + TIM_SNS_SYSTEM_DEL_RECOMMEND = 0x0a,
548 /** 815 /**
549 - * 用户生日 816 + * 已决增加
550 */ 817 */
551 - TIM_PROFILE_FLAG_BIRTHDAY = (0x01 << 7), 818 + TIM_SNS_SYSTEM_ADD_DECIDE = 0x0b,
552 /** 819 /**
553 - * 用户区域 820 + * 已决删除
554 */ 821 */
555 - TIM_PROFILE_FLAG_LOCATION = (0x01 << 8), 822 + TIM_SNS_SYSTEM_DEL_DECIDE = 0x0c,
556 /** 823 /**
557 - * 用户语言 824 + * 推荐已读上报
558 */ 825 */
559 - TIM_PROFILE_FLAG_LANGUAGE = (0x01 << 9), 826 + TIM_SNS_SYSTEM_RECOMMEND_REPORT = 0x0d,
560 /** 827 /**
561 - * 用户等级 828 + * 已决已读上报
562 */ 829 */
563 - TIM_PROFILE_FLAG_LEVEL = (0x01 << 10), 830 + TIM_SNS_SYSTEM_DECIDE_REPORT = 0x0e,
  831 +
  832 +
  833 +};
  834 +
  835 +/**
  836 + * 资料变更
  837 + */
  838 +typedef NS_ENUM(NSInteger, TIM_PROFILE_SYSTEM_TYPE){
564 /** 839 /**
565 - * 用户角色 840 + 好友资料变更
566 */ 841 */
567 - TIM_PROFILE_FLAG_ROLE = (0x01 << 11), 842 + TIM_PROFILE_SYSTEM_FRIEND_PROFILE_CHANGE = 0x01,
568 }; 843 };
569 844
570 -#pragma mark - block回调 845 +#pragma mark - block 回调
571 846
572 /** 847 /**
573 * 获取消息回调 848 * 获取消息回调
@@ -598,7 +873,7 @@ typedef void (^TIMFail)(int code, NSString * msg); @@ -598,7 +873,7 @@ typedef void (^TIMFail)(int code, NSString * msg);
598 typedef void (^TIMProgress)(NSInteger curSize, NSInteger totalSize); 873 typedef void (^TIMProgress)(NSInteger curSize, NSInteger totalSize);
599 874
600 /** 875 /**
601 - * 登成功回调 876 + * 登成功回调
602 */ 877 */
603 typedef void (^TIMLoginSucc)(void); 878 typedef void (^TIMLoginSucc)(void);
604 879
@@ -620,12 +895,12 @@ typedef void (^TIMLogFunc)(TIMLogLevel lvl, NSString * msg); @@ -620,12 +895,12 @@ typedef void (^TIMLogFunc)(TIMLogLevel lvl, NSString * msg);
620 /** 895 /**
621 * 上传图片成功回调 896 * 上传图片成功回调
622 * 897 *
623 - * @param elem 上传图片成功后elem 898 + * @param elem 上传图片成功后 elem
624 */ 899 */
625 typedef void (^TIMUploadImageSucc)(TIMImageElem * elem); 900 typedef void (^TIMUploadImageSucc)(TIMImageElem * elem);
626 901
627 /** 902 /**
628 - * APNs推送配置更新成功回调 903 + * APNs 推送配置更新成功回调
629 * 904 *
630 * @param config 配置 905 * @param config 配置
631 */ 906 */
@@ -634,7 +909,7 @@ typedef void (^TIMAPNSConfigSucc)(TIMAPNSConfig* config); @@ -634,7 +909,7 @@ typedef void (^TIMAPNSConfigSucc)(TIMAPNSConfig* config);
634 /** 909 /**
635 * 群创建成功 910 * 群创建成功
636 * 911 *
637 - * @param groupId 群组Id 912 + * @param groupId 群组 Id
638 */ 913 */
639 typedef void (^TIMCreateGroupSucc)(NSString * groupId); 914 typedef void (^TIMCreateGroupSucc)(NSString * groupId);
640 915
@@ -643,7 +918,7 @@ typedef void (^TIMCreateGroupSucc)(NSString * groupId); @@ -643,7 +918,7 @@ typedef void (^TIMCreateGroupSucc)(NSString * groupId);
643 * 918 *
644 * @param friends 好友列表 919 * @param friends 好友列表
645 */ 920 */
646 -typedef void (^TIMFriendSucc)(NSArray * friends); 921 +typedef void (^TIMFriendArraySucc)(NSArray<TIMFriend *> *friends);
647 922
648 /** 923 /**
649 * 获取资料回调 924 * 获取资料回调
@@ -652,507 +927,696 @@ typedef void (^TIMFriendSucc)(NSArray * friends); @@ -652,507 +927,696 @@ typedef void (^TIMFriendSucc)(NSArray * friends);
652 */ 927 */
653 typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile); 928 typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile);
654 929
655 -#pragma mark - 基本类型  
656 -  
657 -@interface TIMCodingModel : NSObject <NSCoding>  
658 -  
659 -- (void)encodeWithCoder:(NSCoder *)encoder;  
660 -- (id)initWithCoder:(NSCoder *)decoder;  
661 -  
662 -@end  
663 -  
664 -@interface TIMSdkConfig : NSObject  
665 -  
666 /** 930 /**
667 - * 用户标识接入SDK的应用ID,必填 931 + * 获取资料回调
  932 + *
  933 + * @param profiles 资料
668 */ 934 */
669 -@property(nonatomic,assign) int sdkAppId; 935 +typedef void (^TIMUserProfileArraySucc)(NSArray<TIMUserProfile *> *profiles);
670 936
671 /** 937 /**
672 - * 用户的账号类型,必填 938 + * 好友操作回调
  939 + *
  940 + * @param result 资料
673 */ 941 */
674 -@property(nonatomic,strong) NSString * accountType; 942 +typedef void (^TIMFriendResultSucc)(TIMFriendResult *result);
675 943
676 /** 944 /**
677 - * 禁用crash上报,默认上报 945 + * 好友操作回调
  946 + *
  947 + * @param results 资料
678 */ 948 */
679 -@property(nonatomic,assign) BOOL disableCrashReport; 949 +typedef void (^TIMFriendResultArraySucc)(NSArray<TIMFriendResult *> *results);
680 950
681 /** 951 /**
682 - * 禁止在控制台打印log 952 + * 检查好友操作回调
  953 + *
  954 + * @param results 检查结果
683 */ 955 */
684 -@property(nonatomic,assign) BOOL disableLogPrint; 956 +typedef void (^TIMCheckFriendResultArraySucc)(NSArray<TIMCheckFriendResult *> *results);
685 957
686 -/**  
687 - * 本地写log文件的等级,默认DEBUG等级  
688 - */  
689 -@property(nonatomic,assign) TIMLogLevel logLevel;  
690 958
691 /** 959 /**
692 - * log文件路径,不设置时为默认路径 960 + * 群成员列表回调
  961 + *
  962 + * @param members 群成员列表
693 */ 963 */
694 -@property(nonatomic,strong) NSString * logPath; 964 +typedef void (^TIMGroupMemberSucc)(NSArray * members);
695 965
696 /** 966 /**
697 - * 回调给log函数的log等级,默认DEBUG等级 967 + * 群列表回调
  968 + *
  969 + * @param arr 群列表,成员类型 TIMGroupInfo
698 */ 970 */
699 -@property(nonatomic,assign) TIMLogLevel logFuncLevel; 971 +typedef void (^TIMGroupListSucc)(NSArray<TIMGroupInfo *> * arr);
700 972
701 /** 973 /**
702 - * log监听函数 974 + * 本人群组内成员信息回调
  975 + *
  976 + * @param selfInfo 本人成员信息
703 */ 977 */
704 -@property(nonatomic,copy) TIMLogFunc logFunc; 978 +typedef void (^TIMGroupSelfSucc)(TIMGroupMemberInfo * selfInfo);
705 979
706 /** 980 /**
707 - * 消息数据库路径,不设置时为默认路径 981 + * 群接受消息选项回调
  982 + *
  983 + * @param opt 群接受消息选项
708 */ 984 */
709 -@property(nonatomic,strong) NSString * dbPath; 985 +typedef void (^TIMGroupReciveMessageOptSucc)(TIMGroupReceiveMessageOpt opt);
710 986
711 /** 987 /**
712 - * 网络监听器 988 + * 群成员列表回调(分页使用)
  989 + *
  990 + * @param members 群成员(TIMGroupMemberInfo*)列表
713 */ 991 */
714 -@property(nonatomic,strong) id<TIMConnListener> connListener;  
715 -  
716 -@end  
717 -  
718 -  
719 -@interface TIMUserConfig : NSObject 992 +typedef void (^TIMGroupMemberSuccV2)(uint64_t nextSeq, NSArray * members);
720 993
721 /** 994 /**
722 - * 禁用本地存储(加载消息扩展包有效) 995 + * 群搜索回调
  996 + *
  997 + * @param totalNum 搜索结果的总数
  998 + * @param groups 请求的群列表片段
723 */ 999 */
724 -@property(nonatomic,assign) BOOL disableStorage; 1000 +typedef void (^TIMGroupSearchSucc)(uint64_t totalNum, NSArray * groups);
725 1001
726 /** 1002 /**
727 - * 禁止自动上报(加载消息扩展包有效) 1003 + * 获取群组未决请求列表成功
  1004 + *
  1005 + * @param meta 未决请求元信息
  1006 + * @param pendencies 未决请求列表(TIMGroupPendencyItem)数组
728 */ 1007 */
729 -@property(nonatomic,assign) BOOL disableAutoReport; 1008 +typedef void (^TIMGetGroupPendencyListSucc)(TIMGroupPendencyMeta * meta, NSArray<TIMGroupPendencyItem *> * pendencies);
730 1009
731 /** 1010 /**
732 - * 开启C2C已读回执(加载消息扩展包有效) 1011 + * 发送消息给多个用户失败
  1012 + *
  1013 + * @param code 错误码
  1014 + * @param err 错误信息
  1015 + * @param detailInfo 错误详情
733 */ 1016 */
734 -@property(nonatomic,assign) BOOL enableReadReceipt; 1017 +typedef void (^TIMSendToUsersFail)(int code, NSString *err, TIMSendToUsersDetailInfo *detailInfo);
735 1018
736 -/**  
737 - * 不开启最近联系人(加载消息扩展包有效)  
738 - */  
739 -@property(nonatomic,assign) BOOL disableRecnetContact; 1019 +#pragma mark - 基本类型
740 1020
741 -/**  
742 - * 不通过onNewMessage:抛出最近联系人的最后一条消息(加载消息扩展包有效)  
743 - */  
744 -@property(nonatomic,assign) BOOL disableRecentContactNotify; 1021 +/// 实现 NSCoding 协议
  1022 +@interface TIMCodingModel : NSObject <NSCoding>
745 1023
746 -///**  
747 -// * 开启关系链数据本地缓存功能(加载好友扩展包有效)  
748 -// */  
749 -//@property(nonatomic,assign) BOOL enableFriendshipProxy; 1024 +///读取实例变量,并把这些数据写到 coder 中去,序列化数据
  1025 +- (void)encodeWithCoder:(NSCoder *)encoder;
750 1026
751 -///**  
752 -// * 开启群组数据本地缓存功能(加载群组扩展包有效)  
753 -// */  
754 -//@property(nonatomic,assign) BOOL enableGroupAssistant; 1027 +///从 coder 中读取数据,保存到相应的变量中,即反序列化数据
  1028 +- (id)initWithCoder:(NSCoder *)decoder;
755 1029
756 -/**  
757 - * 设置默认拉取的群组资料  
758 - */  
759 -@property(nonatomic,strong) TIMGroupInfoOption * groupInfoOpt; 1030 +@end
760 1031
761 -/**  
762 - * 设置默认拉取的群成员资料  
763 - */  
764 -@property(nonatomic,strong) TIMGroupMemberInfoOption * groupMemberInfoOpt; 1032 +/// 初始化 SDK 配置信息
  1033 +@interface TIMSdkConfig : NSObject
765 1034
766 -/**  
767 - * 设置默认拉取的好友资料  
768 - */  
769 -@property(nonatomic,strong) TIMFriendProfileOption * friendProfileOpt; 1035 +///用户标识接入 SDK 的应用 ID,必填
  1036 +@property(nonatomic,assign) int sdkAppId;
770 1037
771 -/**  
772 - * 用户登录状态监听器  
773 - */  
774 -@property(nonatomic,strong) id<TIMUserStatusListener> userStatusListener; 1038 +///用户的账号类型,新版本不需要再填写
  1039 +//@property(nonatomic,strong) NSString * accountType;
775 1040
776 -/**  
777 - * 会话刷新监听器(未读计数、已读同步)(加载消息扩展包有效)  
778 - */  
779 -@property(nonatomic,strong) id<TIMRefreshListener> refreshListener;  
780 -  
781 -/**  
782 - * 消息已读回执监听器(加载消息扩展包有效)  
783 - */  
784 -@property(nonatomic,strong) id<TIMMessageReceiptListener> messageReceiptListener; 1041 +///禁止在控制台打印 log
  1042 +@property(nonatomic,assign) BOOL disableLogPrint;
785 1043
786 -/**  
787 - * 消息svr重写监听器(加载消息扩展包有效)  
788 - */  
789 -@property(nonatomic,strong) id<TIMMessageUpdateListener> messageUpdateListener; 1044 +///本地写 log 文件的等级,默认 DEBUG 等级
  1045 +@property(nonatomic,assign) TIMLogLevel logLevel;
790 1046
791 -/**  
792 - * 消息撤回监听器(加载消息扩展包有效)  
793 - */  
794 -@property(nonatomic,strong) id<TIMMessageRevokeListener> messageRevokeListener; 1047 +///log 文件路径,不设置时为默认路径,可以通过 TIMManager -> getLogPath 获取 log 路径
  1048 +@property(nonatomic,strong) NSString * logPath;
795 1049
796 -/**  
797 - * 文件上传进度监听器  
798 - */  
799 -@property(nonatomic,strong) id<TIMUploadProgressListener> uploadProgressListener; 1050 +///回调给 logFunc 函数的 log 等级,默认 DEBUG 等级
  1051 +@property(nonatomic,assign) TIMLogLevel logFuncLevel;
800 1052
801 -/**  
802 - * 群组事件通知监听器  
803 - */  
804 -@property(nonatomic,strong) id<TIMGroupEventListener> groupEventListener; 1053 +///log 监听函数
  1054 +@property(nonatomic,copy) TIMLogFunc logFunc;
805 1055
806 -///**  
807 -// * 关系链数据本地缓存监听器(加载好友扩展包、enableFriendshipProxy有效)  
808 -// */  
809 -//@property(nonatomic,strong) id<TIMFriendshipListener> friendshipListener; 1056 +///消息数据库路径,不设置时为默认路径
  1057 +@property(nonatomic,strong) NSString * dbPath;
810 1058
811 -///**  
812 -// * 群组据本地缓存监听器(加载群组扩展包、enableGroupAssistant有效)  
813 -// */  
814 -//@property(nonatomic,strong) id<TIMGroupListener> groupListener; 1059 +///网络监听器,监听网络连接成功失败的状态
  1060 +@property(nonatomic,strong) id<TIMConnListener> connListener;
815 1061
816 @end 1062 @end
817 1063
818 -/**  
819 - * 登陆信息  
820 - */ 1064 +/// 设置用户配置信息
  1065 +@interface TIMUserConfig : NSObject
  1066 +
  1067 +///禁用本地存储
  1068 +@property(nonatomic,assign) BOOL disableStorage;
  1069 +
  1070 +///默认情况下,出于性能考虑,当用户在终端 A 收到未读消息后,Server 默认会删除未读消息,但如果用户切换到终端 B 后,IM SDK 无法再同步到未读消息,未读计数也不会增加,如果需要在终端 B 下也有未读,请设置 disableAutoReport 为 YES,这个时候 Server 不会再主动删除未读消息。注意一旦这这样设置,开发者需要主动调用 TIMConversation.h -> setReadMessage ,否则未读消息会一直存在 Server,IM SDK 每次登录或则断网重连都会再次同步到未读消息,详情请参考官方文档 [自动已读上报](https://cloud.tencent.com/document/product/269/9151)。
  1071 +@property(nonatomic,assign) BOOL disableAutoReport;
821 1072
  1073 +///已读回执是自己发出去的消息,对方设置为已读后,自己能收到已读的回调,只针对单聊(C2C)会话生效,默认是关闭的,如果需要开启,请设置 enableReadReceipt 为 YES,收到消息的用户需要显式调用 TIMConversation.h -> setReadMessage,发消息的用户才能通过 TIMMessageReceiptListener 监听到消息的已读回执。
  1074 +@property(nonatomic,assign) BOOL enableReadReceipt;
  1075 +
  1076 +///设置默认拉取的群组资料,当您获取群资料的时候,默认只能拉取内置字段,如果想要拉取自定义字段,首先要通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群维度自定义字段 配置对应的 "自定义字段" 和用户操作权限,然后设置 IMGroupInfoOption -> groupCustom = @[@"自定义字段名称",...]。
  1077 +@property(nonatomic,strong) TIMGroupInfoOption * groupInfoOpt;
  1078 +
  1079 +///设置默认拉取的群成员资料,当您获取群成员资料的时候,默认只能拉取内置字段,如果想要拉取自定义字段,首先要通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群成员维度自定义字段配置对应的 "自定义字段" 和用户操作权限,后设置 TIMGroupMemberInfoOption -> memberCustom = @[@"自定义字段名称",...]。
  1080 +@property(nonatomic,strong) TIMGroupMemberInfoOption * groupMemberInfoOpt;
  1081 +
  1082 +///关系链参数
  1083 +@property(nonatomic,strong) TIMFriendProfileOption * friendProfileOpt;
  1084 +
  1085 +///用户登录状态监听器,用于监听用户被踢,断网重连失败,userSig 过期的通知
  1086 +@property(nonatomic,weak) id<TIMUserStatusListener> userStatusListener;
  1087 +
  1088 +///会话刷新监听器,用于监听会话的刷新
  1089 +@property(nonatomic,weak) id<TIMRefreshListener> refreshListener;
  1090 +
  1091 +///消息已读回执监听器,用于监听消息已读回执,enableReadReceipt 字段需要设置为 YES
  1092 +@property(nonatomic,weak) id<TIMMessageReceiptListener> messageReceiptListener;
  1093 +
  1094 +///消息修改监听器,用于监听消息状态的变化
  1095 +@property(nonatomic,weak) id<TIMMessageUpdateListener> messageUpdateListener;
  1096 +
  1097 +///消息撤回监听器,用于监听会话中的消息撤回通知
  1098 +@property(nonatomic,weak) id<TIMMessageRevokeListener> messageRevokeListener;
  1099 +
  1100 +///文件上传进度监听器,发送语音,图片,视频,文件消息的时候需要先上传对应文件到服务器,这里可以监听上传进度
  1101 +@property(nonatomic,weak) id<TIMUploadProgressListener> uploadProgressListener;
  1102 +
  1103 +///群组事件通知监听器
  1104 +@property(nonatomic,weak) id<TIMGroupEventListener> groupEventListener;
  1105 +
  1106 +///关系链数据本地缓存监听器
  1107 +@property(nonatomic,weak) id<TIMFriendshipListener> friendshipListener;
  1108 +
  1109 +@end
  1110 +
  1111 +/// 登录参数
822 @interface TIMLoginParam : NSObject 1112 @interface TIMLoginParam : NSObject
823 1113
824 -/**  
825 - * 用户名  
826 - */ 1114 +///用户名
827 @property(nonatomic,strong) NSString* identifier; 1115 @property(nonatomic,strong) NSString* identifier;
828 1116
829 -/**  
830 - * 鉴权Token  
831 - */ 1117 +///鉴权 Token
832 @property(nonatomic,strong) NSString* userSig; 1118 @property(nonatomic,strong) NSString* userSig;
833 1119
834 -/**  
835 - * App用户使用OAuth授权体系分配的Appid  
836 - */ 1120 +///App 用户使用 OAuth 授权体系分配的 Appid
837 @property(nonatomic,strong) NSString* appidAt3rd; 1121 @property(nonatomic,strong) NSString* appidAt3rd;
838 1122
839 1123
840 @end 1124 @end
841 1125
842 -/**  
843 - * APNs 配置  
844 - */ 1126 +/// APNs 配置
845 @interface TIMAPNSConfig : NSObject 1127 @interface TIMAPNSConfig : NSObject
846 -/**  
847 - * 是否开启推送:0-不进行设置 1-开启推送 2-关闭推送  
848 - */ 1128 +
  1129 +///是否开启推送:0-不进行设置 1-开启推送 2-关闭推送
849 @property(nonatomic,assign) uint32_t openPush; 1130 @property(nonatomic,assign) uint32_t openPush;
850 -/**  
851 - * C2C消息声音,不设置传入nil  
852 - */ 1131 +
  1132 +///C2C 消息声音,不设置传入 nil
853 @property(nonatomic,strong) NSString * c2cSound; 1133 @property(nonatomic,strong) NSString * c2cSound;
854 1134
855 -/**  
856 - * Group消息声音,不设置传入nil  
857 - */ 1135 +///Group 消息声音,不设置传入 nil
858 @property(nonatomic,strong) NSString * groupSound; 1136 @property(nonatomic,strong) NSString * groupSound;
859 1137
860 -/**  
861 - * Video声音,不设置传入nil  
862 - */ 1138 +///Video 音视频邀请声音,不设置传入 nil (暂不支持)
863 @property(nonatomic,strong) NSString * videoSound; 1139 @property(nonatomic,strong) NSString * videoSound;
864 1140
865 @end 1141 @end
866 1142
867 -/**  
868 - * SetToken 参数  
869 - */ 1143 +/// SetToken 参数
870 @interface TIMTokenParam : NSObject 1144 @interface TIMTokenParam : NSObject
871 -/**  
872 - * 获取的客户端Token信息  
873 - */ 1145 +
  1146 +///token 是苹果后台对客户端的唯一标识,需要主动调用系统 API 向苹果请求获取
874 @property(nonatomic,strong) NSData* token; 1147 @property(nonatomic,strong) NSData* token;
875 -/**  
876 - * 业务ID,传递证书时分配  
877 - */ 1148 +
  1149 +///业务 ID,传递证书时分配
878 @property(nonatomic,assign) uint32_t busiId; 1150 @property(nonatomic,assign) uint32_t busiId;
879 1151
880 @end 1152 @end
881 1153
882 -  
883 -/**  
884 - * 切后台参数  
885 - */ 1154 +/// 切后台参数
886 @interface TIMBackgroundParam : NSObject 1155 @interface TIMBackgroundParam : NSObject
887 1156
888 -/**  
889 - * C2C 未读计数  
890 - */ 1157 +///C2C 未读计数
891 @property(nonatomic,assign) int c2cUnread; 1158 @property(nonatomic,assign) int c2cUnread;
892 1159
893 -/**  
894 - * 群 未读计数  
895 - */ 1160 +///群未读计数
896 @property(nonatomic,assign) int groupUnread; 1161 @property(nonatomic,assign) int groupUnread;
897 1162
898 @end 1163 @end
899 1164
  1165 +/// 消息定位
900 @interface TIMMessageLocator : NSObject 1166 @interface TIMMessageLocator : NSObject
901 -/**  
902 - * 所属会话的id  
903 - */ 1167 +
  1168 +///所属会话的 id
904 @property(nonatomic,strong) NSString * sessId; 1169 @property(nonatomic,strong) NSString * sessId;
905 -/**  
906 - * 所属会话的类型  
907 - */ 1170 +
  1171 +///所属会话的类型
908 @property(nonatomic,assign) TIMConversationType sessType; 1172 @property(nonatomic,assign) TIMConversationType sessType;
909 -/**  
910 - * 消息序列号  
911 - */ 1173 +
  1174 +///消息序列号
912 @property(nonatomic,assign) uint64_t seq; 1175 @property(nonatomic,assign) uint64_t seq;
913 -/**  
914 - * 消息随机码  
915 - */ 1176 +
  1177 +///消息随机码
916 @property(nonatomic,assign) uint64_t rand; 1178 @property(nonatomic,assign) uint64_t rand;
917 -/**  
918 - * 消息时间戳  
919 - */ 1179 +
  1180 +///消息时间戳
920 @property(nonatomic,assign) time_t time; 1181 @property(nonatomic,assign) time_t time;
921 -/**  
922 - * 是否本人消息  
923 - */ 1182 +
  1183 +///是否本人消息
924 @property(nonatomic,assign) BOOL isSelf; 1184 @property(nonatomic,assign) BOOL isSelf;
925 1185
926 -/**  
927 - * 是否来自撤销通知  
928 - */ 1186 +///是否来自撤销通知
929 @property(nonatomic,assign) BOOL isFromRevokeNotify; 1187 @property(nonatomic,assign) BOOL isFromRevokeNotify;
930 1188
931 @end 1189 @end
932 1190
933 -/**  
934 - * 已读回执  
935 - */ 1191 +/// 已读回执
936 @interface TIMMessageReceipt : NSObject 1192 @interface TIMMessageReceipt : NSObject
937 -/**  
938 - * 已读回执对应的会话(目前只支持C2C会话)  
939 - */ 1193 +
  1194 +///已读回执对应的会话(目前只支持 C2C 会话)
940 @property(nonatomic,strong) TIMConversation * conversation; 1195 @property(nonatomic,strong) TIMConversation * conversation;
941 -/**  
942 - * 收到已读回执时,这个时间戳之前的消息都已读  
943 - */ 1196 +
  1197 +///收到已读回执时,这个时间戳之前的消息都已读
944 @property(nonatomic,assign) time_t timestamp; 1198 @property(nonatomic,assign) time_t timestamp;
945 @end 1199 @end
946 1200
  1201 +/// Android 离线推送配置
947 @interface TIMAndroidOfflinePushConfig : NSObject 1202 @interface TIMAndroidOfflinePushConfig : NSObject
948 -/**  
949 - * 离线推送时展示标签  
950 - */ 1203 +
  1204 +///离线推送时展示标签
951 @property(nonatomic,strong) NSString * title; 1205 @property(nonatomic,strong) NSString * title;
952 -/**  
953 - * Android离线Push时声音字段信息  
954 - */ 1206 +
  1207 +///Android 离线 Push 时声音字段信息
955 @property(nonatomic,strong) NSString * sound; 1208 @property(nonatomic,strong) NSString * sound;
956 -/**  
957 - * 离线推送时通知形式  
958 - */ 1209 +
  1210 +///离线推送时通知形式
959 @property(nonatomic,assign) TIMAndroidOfflinePushNotifyMode notifyMode; 1211 @property(nonatomic,assign) TIMAndroidOfflinePushNotifyMode notifyMode;
960 1212
961 @end 1213 @end
962 1214
  1215 +/// iOS 离线推送配置
963 @interface TIMIOSOfflinePushConfig : NSObject 1216 @interface TIMIOSOfflinePushConfig : NSObject
964 -/**  
965 - * 离线Push时声音字段信息  
966 - */ 1217 +
  1218 +///离线 Push 时声音字段信息
967 @property(nonatomic,strong) NSString * sound; 1219 @property(nonatomic,strong) NSString * sound;
968 -/**  
969 - * 忽略badge计数  
970 - */ 1220 +
  1221 +///忽略 badge 计数
971 @property(nonatomic,assign) BOOL ignoreBadge; 1222 @property(nonatomic,assign) BOOL ignoreBadge;
972 1223
973 @end 1224 @end
974 1225
  1226 +/// 填入 sound 字段表示接收时不会播放声音
  1227 +extern NSString * const kIOSOfflinePushNoSound;
  1228 +
  1229 +/// 自定义消息 push
  1230 +@interface TIMOfflinePushInfo : NSObject
  1231 +
  1232 +///自定义消息描述信息,做离线Push时文本展示
  1233 +@property(nonatomic,strong) NSString * desc;
  1234 +
  1235 +///离线 Push 时扩展字段信息
  1236 +@property(nonatomic,strong) NSString * ext;
  1237 +
  1238 +///推送规则标志
  1239 +@property(nonatomic,assign) TIMOfflinePushFlag pushFlag;
  1240 +
  1241 +///iOS离线推送配置
  1242 +@property(nonatomic,strong) TIMIOSOfflinePushConfig * iosConfig;
  1243 +
  1244 +///Android离线推送配置
  1245 +@property(nonatomic,strong) TIMAndroidOfflinePushConfig * androidConfig;
  1246 +@end
  1247 +
  1248 +/// 群组内的本人信息
  1249 +@interface TIMGroupSelfInfo : NSObject
  1250 +
  1251 +///加入群组时间
  1252 +@property(nonatomic,assign) uint32_t joinTime;
  1253 +
  1254 +///群组中的角色
  1255 +@property(nonatomic,assign) TIMGroupMemberRole role;
  1256 +
  1257 +///群组消息接收选项
  1258 +@property(nonatomic,assign) TIMGroupReceiveMessageOpt recvOpt;
  1259 +
  1260 +///群组中的未读消息数
  1261 +@property(nonatomic,assign) uint32_t unReadMessageNum;
  1262 +
  1263 +@end
  1264 +
  1265 +/// 群资料信息
  1266 +@interface TIMGroupInfo : TIMCodingModel
  1267 +
  1268 +///群组 Id
  1269 +@property(nonatomic,strong) NSString* group;
  1270 +
  1271 +///群名
  1272 +@property(nonatomic,strong) NSString* groupName;
  1273 +
  1274 +///群创建人/管理员
  1275 +@property(nonatomic,strong) NSString * owner;
  1276 +
  1277 +///群类型:Private,Public,ChatRoom
  1278 +@property(nonatomic,strong) NSString* groupType;
  1279 +
  1280 +///群创建时间
  1281 +@property(nonatomic,assign) uint32_t createTime;
  1282 +
  1283 +///最近一次群资料修改时间
  1284 +@property(nonatomic,assign) uint32_t lastInfoTime;
  1285 +
  1286 +///最近一次发消息时间
  1287 +@property(nonatomic,assign) uint32_t lastMsgTime;
  1288 +
  1289 +///最大成员数
  1290 +@property(nonatomic,assign) uint32_t maxMemberNum;
  1291 +
  1292 +///群成员数量
  1293 +@property(nonatomic,assign) uint32_t memberNum;
  1294 +
  1295 +///入群类型
  1296 +@property(nonatomic,assign) TIMGroupAddOpt addOpt;
  1297 +
  1298 +///群公告
  1299 +@property(nonatomic,strong) NSString* notification;
  1300 +
  1301 +///群简介
  1302 +@property(nonatomic,strong) NSString* introduction;
  1303 +
  1304 +///群头像
  1305 +@property(nonatomic,strong) NSString* faceURL;
  1306 +
  1307 +///最后一条消息
  1308 +@property(nonatomic,strong) TIMMessage* lastMsg;
  1309 +
  1310 +///在线成员数量
  1311 +@property(nonatomic,assign) uint32_t onlineMemberNum;
  1312 +
  1313 +///群组是否被搜索类型
  1314 +@property(nonatomic,assign) TIMGroupSearchableType isSearchable;
  1315 +
  1316 +///群组成员可见类型
  1317 +@property(nonatomic,assign) TIMGroupMemberVisibleType isMemberVisible;
  1318 +
  1319 +///是否全员禁言
  1320 +@property(nonatomic,assign) BOOL allShutup;
  1321 +
  1322 +///群组中的本人信息
  1323 +@property(nonatomic,strong) TIMGroupSelfInfo* selfInfo;
  1324 +
  1325 +///自定义字段集合,key 是 NSString* 类型,value 是 NSData* 类型
  1326 +@property(nonatomic,strong) NSDictionary<NSString *,NSData *>* customInfo;
  1327 +
  1328 +@end
  1329 +
  1330 +/// 事件上报信息
  1331 +@interface TIMEventReportItem : NSObject
  1332 +
  1333 +///事件 id
  1334 +@property(nonatomic,assign) uint32_t event;
  1335 +
  1336 +///错误码
  1337 +@property(nonatomic,assign) uint32_t code;
  1338 +
  1339 +///错误描述
  1340 +@property(nonatomic,strong) NSString * desc;
  1341 +
  1342 +///事件延迟(单位 ms)
  1343 +@property(nonatomic,assign) uint32_t delay;
  1344 +
  1345 +@end
  1346 +
  1347 +/// 获取某个群组资料
  1348 +@interface TIMGroupInfoOption : NSObject
  1349 +
  1350 +///需要获取的群组信息标志(TIMGetGroupBaseInfoFlag),默认为0xffffff
  1351 +@property(nonatomic,assign) uint64_t groupFlags;
  1352 +
  1353 +///需要获取群组资料的自定义信息(NSString*)列表
  1354 +@property(nonatomic,strong) NSArray * groupCustom;
  1355 +
  1356 +@end
  1357 +
  1358 +/// 需要某个群成员资料
  1359 +@interface TIMGroupMemberInfoOption : NSObject
  1360 +
  1361 +///需要获取的群成员标志(TIMGetGroupMemInfoFlag),默认为0xffffff
  1362 +@property(nonatomic,assign) uint64_t memberFlags;
  1363 +
  1364 +///需要获取群成员资料的自定义信息(NSString*)列表
  1365 +@property(nonatomic,strong) NSArray * memberCustom;
  1366 +
  1367 +@end
  1368 +
  1369 +/// 群成员资料
  1370 +@interface TIMGroupMemberInfo : TIMCodingModel
  1371 +
  1372 +///成员
  1373 +@property(nonatomic,strong) NSString* member;
  1374 +
  1375 +///群名片
  1376 +@property(nonatomic,strong) NSString* nameCard;
  1377 +
  1378 +///加入群组时间
  1379 +@property(nonatomic,assign) time_t joinTime;
  1380 +
  1381 +///成员类型
  1382 +@property(nonatomic,assign) TIMGroupMemberRole role;
  1383 +
  1384 +///禁言结束时间(时间戳)
  1385 +@property(nonatomic,assign) uint32_t silentUntil;
  1386 +
  1387 +///自定义字段集合,key 是 NSString*类型,value 是 NSData*类型
  1388 +@property(nonatomic,strong) NSDictionary* customInfo;
  1389 +
  1390 +@end
  1391 +
  1392 +///资料与关系链
  1393 +@interface TIMFriendProfileOption : NSObject
  1394 +
  1395 +///关系链最大缓存时间(默认缓存一天;获取资料和关系链超过缓存时间,将自动向服务器发起请求)
  1396 +@property NSInteger expiredSeconds;
  1397 +
  1398 +@end
  1399 +
  1400 +///用户资料
  1401 +@interface TIMUserProfile : TIMCodingModel
  1402 +
975 /** 1403 /**
976 - * 群组内的本人信息 1404 + * 用户 identifier
977 */ 1405 */
978 -@interface TIMGroupSelfInfo : NSObject 1406 +@property(nonatomic,strong) NSString* identifier;
979 1407
980 /** 1408 /**
981 - * 加入群组时间 1409 + * 用户昵称
982 */ 1410 */
983 -@property(nonatomic,assign) uint32_t joinTime; 1411 +@property(nonatomic,strong) NSString* nickname;
984 1412
985 /** 1413 /**
986 - * 群组中的角色 1414 + * 好友验证方式
987 */ 1415 */
988 -@property(nonatomic,assign) TIMGroupMemberRole role; 1416 +@property(nonatomic,assign) TIMFriendAllowType allowType;
989 1417
990 /** 1418 /**
991 - * 群组消息接收选项 1419 + * 用户头像
992 */ 1420 */
993 -@property(nonatomic,assign) TIMGroupReceiveMessageOpt recvOpt; 1421 +@property(nonatomic,strong) NSString* faceURL;
994 1422
995 /** 1423 /**
996 - * 群组中的未读消息数 1424 + * 用户签名
997 */ 1425 */
998 -@property(nonatomic,assign) uint32_t unReadMessageNum; 1426 +@property(nonatomic,strong) NSData* selfSignature;
999 1427
1000 -@end 1428 +/**
  1429 + * 用户性别
  1430 + */
  1431 +@property(nonatomic,assign) TIMGender gender;
1001 1432
1002 /** 1433 /**
1003 - * 群资料信息 1434 + * 用户生日
1004 */ 1435 */
1005 -@interface TIMGroupInfo : TIMCodingModel 1436 +@property(nonatomic,assign) uint32_t birthday;
1006 1437
1007 /** 1438 /**
1008 - * 群组Id 1439 + * 用户区域
1009 */ 1440 */
1010 -@property(nonatomic,strong) NSString* group; 1441 +@property(nonatomic,strong) NSData* location;
  1442 +
1011 /** 1443 /**
1012 - * 群名 1444 + * 用户语言
1013 */ 1445 */
1014 -@property(nonatomic,strong) NSString* groupName; 1446 +@property(nonatomic,assign) uint32_t language;
  1447 +
1015 /** 1448 /**
1016 - * 群创建人/管理员 1449 + * 等级
1017 */ 1450 */
1018 -@property(nonatomic,strong) NSString * owner; 1451 +@property(nonatomic,assign) uint32_t level;
  1452 +
1019 /** 1453 /**
1020 - * 群类型:Private,Public,ChatRoom 1454 + * 角色
1021 */ 1455 */
1022 -@property(nonatomic,strong) NSString* groupType; 1456 +@property(nonatomic,assign) uint32_t role;
  1457 +
1023 /** 1458 /**
1024 - * 群创建时间 1459 + * 自定义字段集合,key是NSString类型,value是NSData类型或者NSNumber类型
  1460 + * key值按照后台配置的字符串传入,不包括 TIMProfileTypeKey_Custom_Prefix 前缀
1025 */ 1461 */
1026 -@property(nonatomic,assign) uint32_t createTime; 1462 +@property(nonatomic,strong) NSDictionary* customInfo;
  1463 +
  1464 +@end
  1465 +
  1466 +typedef void(^ProfileCallBack) (TIMUserProfile * proflie);
  1467 +
1027 /** 1468 /**
1028 - * 最近一次群资料修改时间 1469 + * 好友
1029 */ 1470 */
1030 -@property(nonatomic,assign) uint32_t lastInfoTime; 1471 +@interface TIMFriend : TIMCodingModel
  1472 +
1031 /** 1473 /**
1032 - * 最近一次发消息时间 1474 + * 好友identifier
1033 */ 1475 */
1034 -@property(nonatomic,assign) uint32_t lastMsgTime; 1476 +@property(nonatomic,strong) NSString *identifier;
  1477 +
1035 /** 1478 /**
1036 - * 最大成员数 1479 + * 好友备注(最大96字节,获取自己资料时,该字段为空)
1037 */ 1480 */
1038 -@property(nonatomic,assign) uint32_t maxMemberNum; 1481 +@property(nonatomic,strong) NSString *remark;
  1482 +
1039 /** 1483 /**
1040 - * 群成员数量 1484 + * 分组名称 NSString* 列表
1041 */ 1485 */
1042 -@property(nonatomic,assign) uint32_t memberNum; 1486 +@property(nonatomic,strong) NSArray *groups;
1043 1487
1044 /** 1488 /**
1045 - * 入群类型 1489 + * 申请时的添加理由
1046 */ 1490 */
1047 -@property(nonatomic,assign) TIMGroupAddOpt addOpt; 1491 +@property(nonatomic,strong) NSString *addWording;
1048 1492
1049 /** 1493 /**
1050 - * 群公告 1494 + * 申请时的添加来源
1051 */ 1495 */
1052 -@property(nonatomic,strong) NSString* notification; 1496 +@property(nonatomic,strong) NSString *addSource;
1053 1497
1054 /** 1498 /**
1055 - * 群简介 1499 + * 添加时间
1056 */ 1500 */
1057 -@property(nonatomic,strong) NSString* introduction; 1501 +@property(nonatomic,assign) uint64_t addTime;
1058 1502
1059 /** 1503 /**
1060 - * 群头像 1504 + * 自定义字段集合,key是NSString类型,value是NSData类型或者NSNumber类型
  1505 + * key值按照后台配置的字符串传入,不包括 TIMFriendTypeKey_Custom_Prefix 前缀
1061 */ 1506 */
1062 -@property(nonatomic,strong) NSString* faceURL; 1507 +@property(nonatomic,strong) NSDictionary* customInfo;
1063 1508
1064 /** 1509 /**
1065 - * 最后一条消息 1510 + * 好友资料
1066 */ 1511 */
1067 -@property(nonatomic,strong) TIMMessage* lastMsg; 1512 +@property(nonatomic,strong) TIMUserProfile *profile;
  1513 +
  1514 +@end
1068 1515
1069 /** 1516 /**
1070 - * 在线成员数量 1517 + * 创建群参数
1071 */ 1518 */
1072 -@property(nonatomic,assign) uint32_t onlineMemberNum; 1519 +@interface TIMCreateGroupInfo : TIMCodingModel
1073 1520
1074 /** 1521 /**
1075 - * 群组是否被搜索类型 1522 + * 群组Id,nil则使用系统默认Id
1076 */ 1523 */
1077 -@property(nonatomic,assign) TIMGroupSearchableType isSearchable; 1524 +@property(nonatomic,strong) NSString* group;
1078 1525
1079 /** 1526 /**
1080 - * 群组成员可见类型 1527 + * 群
1081 */ 1528 */
1082 -@property(nonatomic,assign) TIMGroupMemberVisibleType isMemberVisible; 1529 +@property(nonatomic,strong) NSString* groupName;
1083 1530
1084 /** 1531 /**
1085 - 是否全员禁言 1532 + * 群类型:Private,Public,ChatRoom,AVChatRoom,BChatRoom
1086 */ 1533 */
1087 -@property(nonatomic,assign) BOOL allShutup; 1534 +@property(nonatomic,strong) NSString* groupType;
1088 1535
1089 /** 1536 /**
1090 - * 群组中的本人信息 1537 + * 是否设置入群选项,Private类型群组请设置为false
1091 */ 1538 */
1092 -@property(nonatomic,strong) TIMGroupSelfInfo* selfInfo; 1539 +@property(nonatomic,assign) BOOL setAddOpt;
1093 1540
1094 /** 1541 /**
1095 - * 自定义字段集合,key是NSString*类型,value是NSData*类型 1542 + * 入群选项
1096 */ 1543 */
1097 -@property(nonatomic,strong) NSDictionary* customInfo; 1544 +@property(nonatomic,assign) TIMGroupAddOpt addOpt;
1098 1545
1099 -@end 1546 +/**
  1547 + * 最大成员数,填0则系统使用默认值
  1548 + */
  1549 +@property(nonatomic,assign) uint32_t maxMemberNum;
1100 1550
1101 /** 1551 /**
1102 - * 事件上报信息 1552 + * 群公告
1103 */ 1553 */
1104 -@interface TIMEventReportItem : NSObject 1554 +@property(nonatomic,strong) NSString* notification;
  1555 +
1105 /** 1556 /**
1106 - * 事件id 1557 + * 群简介
1107 */ 1558 */
1108 -@property(nonatomic,assign) uint32_t event; 1559 +@property(nonatomic,strong) NSString* introduction;
  1560 +
1109 /** 1561 /**
1110 - * 错误码 1562 + * 群头像
1111 */ 1563 */
1112 -@property(nonatomic,assign) uint32_t code; 1564 +@property(nonatomic,strong) NSString* faceURL;
  1565 +
1113 /** 1566 /**
1114 - * 错误描述 1567 + * 自定义字段集合,key是NSString*类型,value是NSData*类型
1115 */ 1568 */
1116 -@property(nonatomic,strong) NSString * desc; 1569 +@property(nonatomic,strong) NSDictionary* customInfo;
  1570 +
1117 /** 1571 /**
1118 - * 事件延迟(单位ms) 1572 + * 创建成员(TIMCreateGroupMemberInfo*)列表
1119 */ 1573 */
1120 -@property(nonatomic,assign) uint32_t delay; 1574 +@property(nonatomic,strong) NSArray <TIMCreateGroupMemberInfo *>* membersInfo;
1121 1575
1122 @end 1576 @end
1123 1577
1124 -@interface TIMGroupInfoOption : NSObject  
1125 -  
1126 /** 1578 /**
1127 - * 需要获取的群组信息标志(TIMGetGroupBaseInfoFlag),默认为0xffffff 1579 + * 未决请求选项
1128 */ 1580 */
1129 -@property(nonatomic,assign) uint64_t groupFlags; 1581 +@interface TIMGroupPendencyOption : TIMCodingModel
1130 1582
1131 /** 1583 /**
1132 - * 需要获取群组资料的自定义信息(NSString*)列表 1584 + * 拉取的起始时间 0:拉取最新的
1133 */ 1585 */
1134 -@property(nonatomic,strong) NSArray * groupCustom; 1586 +@property(nonatomic,assign) uint64_t timestamp;
1135 1587
  1588 +/**
  1589 + * 每页的数量
  1590 + */
  1591 +@property(nonatomic,assign) uint32_t numPerPage;
1136 @end 1592 @end
1137 1593
1138 -@interface TIMGroupMemberInfoOption : NSObject 1594 +/**
  1595 + * 未决请求元信息
  1596 + */
  1597 +@interface TIMGroupPendencyMeta : TIMCodingModel
1139 1598
1140 /** 1599 /**
1141 - * 需要获取的群成员标志(TIMGetGroupMemInfoFlag),默认为0xffffff 1600 + * 下一次拉取的起始时间戳
1142 */ 1601 */
1143 -@property(nonatomic,assign) uint64_t memberFlags; 1602 +@property(nonatomic,assign) uint64_t nextStartTime;
1144 1603
1145 /** 1604 /**
1146 - * 需要获取群成员资料的自定义信息(NSString*)列表 1605 + * 已读时间戳大小
1147 */ 1606 */
1148 -@property(nonatomic,strong) NSArray * memberCustom; 1607 +@property(nonatomic,assign) uint64_t readTimeSeq;
  1608 +
  1609 +/**
  1610 + * 未决未读数
  1611 + */
  1612 +@property(nonatomic,assign) uint32_t unReadCnt;
1149 1613
1150 @end 1614 @end
1151 1615
1152 /** 1616 /**
1153 - * 成员操作返回值 1617 + * 创建群组时的成员信息
1154 */ 1618 */
1155 -@interface TIMGroupMemberInfo : TIMCodingModel 1619 +@interface TIMCreateGroupMemberInfo : TIMCodingModel
1156 1620
1157 /** 1621 /**
1158 * 被操作成员 1622 * 被操作成员
@@ -1160,127 +1624,176 @@ typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile); @@ -1160,127 +1624,176 @@ typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile);
1160 @property(nonatomic,strong) NSString* member; 1624 @property(nonatomic,strong) NSString* member;
1161 1625
1162 /** 1626 /**
1163 - * 群名片 1627 + * 成员类型
1164 */ 1628 */
1165 -@property(nonatomic,strong) NSString* nameCard; 1629 +@property(nonatomic,assign) TIMGroupMemberRole role;
1166 1630
1167 /** 1631 /**
1168 - * 加入群组时间 1632 + * 自定义字段集合,key是NSString*类型,value是NSData*类型
1169 */ 1633 */
1170 -@property(nonatomic,assign) time_t joinTime; 1634 +@property(nonatomic,strong) NSDictionary* customInfo;
  1635 +
  1636 +@end
1171 1637
1172 /** 1638 /**
1173 - * 成员类型 1639 + * 成员操作返回值
1174 */ 1640 */
1175 -@property(nonatomic,assign) TIMGroupMemberRole role; 1641 +@interface TIMGroupMemberResult : NSObject
1176 1642
1177 /** 1643 /**
1178 - * 禁言结束时间(时间戳) 1644 + * 被操作成员
1179 */ 1645 */
1180 -@property(nonatomic,assign) uint32_t silentUntil;  
1181 - 1646 +@property(nonatomic,strong) NSString* member;
1182 /** 1647 /**
1183 - * 自定义字段集合,key是NSString*类型,value是NSData*类型 1648 + * 返回状态
1184 */ 1649 */
1185 -@property(nonatomic,strong) NSDictionary* customInfo; 1650 +@property(nonatomic,assign) TIMGroupMemberStatus status;
1186 1651
1187 @end 1652 @end
1188 1653
1189 -@interface TIMFriendProfileOption : NSObject  
1190 -  
1191 /** 1654 /**
1192 - * 需要获取的好友信息标志(TIMProfileFlag),默认为0xffffff 1655 + * 未决申请
1193 */ 1656 */
1194 -@property(nonatomic,assign) uint64_t friendFlags; 1657 +@interface TIMGroupPendencyItem : TIMCodingModel
1195 1658
1196 /** 1659 /**
1197 - * 需要获取的好友自定义信息(NSString*)列表 1660 + * 相关群组id
1198 */ 1661 */
1199 -@property(nonatomic,strong) NSArray * friendCustom; 1662 +@property(nonatomic,strong) NSString* groupId;
1200 1663
1201 /** 1664 /**
1202 - * 需要获取的用户自定义信息(NSString*)列表 1665 + * 请求者id,请求加群:请求者,邀请加群:邀请人
1203 */ 1666 */
1204 -@property(nonatomic,strong) NSArray * userCustom; 1667 +@property(nonatomic,strong) NSString* fromUser;
1205 1668
1206 -@end 1669 +/**
  1670 + * 判决者id,请求加群:0,邀请加群:被邀请人
  1671 + */
  1672 +@property(nonatomic,strong) NSString* toUser;
1207 1673
1208 /** 1674 /**
1209 - * 好友资料 1675 + * 未决添加时间
1210 */ 1676 */
1211 -@interface TIMUserProfile : TIMCodingModel 1677 +@property(nonatomic,assign) uint64_t addTime;
1212 1678
1213 /** 1679 /**
1214 - * 用户identifier 1680 + * 未决请求类型
1215 */ 1681 */
1216 -@property(nonatomic,strong) NSString* identifier; 1682 +@property(nonatomic,assign) TIMGroupPendencyGetType getType;
1217 1683
1218 /** 1684 /**
1219 - * 用户昵称 1685 + * 已决标志
1220 */ 1686 */
1221 -@property(nonatomic,strong) NSString* nickname; 1687 +@property(nonatomic,assign) TIMGroupPendencyHandleStatus handleStatus;
1222 1688
1223 /** 1689 /**
1224 - * 用户备注(最大96字节,获取自己资料时,该字段为空) 1690 + * 已决结果
1225 */ 1691 */
1226 -@property(nonatomic,strong) NSString* remark; 1692 +@property(nonatomic,assign) TIMGroupPendencyHandleResult handleResult;
1227 1693
1228 /** 1694 /**
1229 - * 好友验证方式 1695 + * 申请或邀请附加信息
1230 */ 1696 */
1231 -@property(nonatomic,assign) TIMFriendAllowType allowType; 1697 +@property(nonatomic,strong) NSString* requestMsg;
1232 1698
1233 /** 1699 /**
1234 - * 用户头像 1700 + * 审批信息:同意或拒绝信息
1235 */ 1701 */
1236 -@property(nonatomic,strong) NSString* faceURL; 1702 +@property(nonatomic,strong) NSString* handledMsg;
  1703 +
1237 1704
1238 /** 1705 /**
1239 - * 用户签名 1706 + * 同意申请
  1707 + *
  1708 + * @param msg 同意理由,选填
  1709 + * @param succ 成功回调
  1710 + * @param fail 失败回调,返回错误码和错误描述
1240 */ 1711 */
1241 -@property(nonatomic,strong) NSData* selfSignature; 1712 +-(void) accept:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
1242 1713
1243 /** 1714 /**
1244 - * 好友性别 1715 + * 拒绝申请
  1716 + *
  1717 + * @param msg 拒绝理由,选填
  1718 + * @param succ 成功回调
  1719 + * @param fail 失败回调,返回错误码和错误描述
1245 */ 1720 */
1246 -@property(nonatomic,assign) TIMGender gender; 1721 +-(void) refuse:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
  1722 +
1247 1723
1248 /** 1724 /**
1249 - * 好友生日 1725 + * 用户自己的id
1250 */ 1726 */
1251 -@property(nonatomic,assign) uint32_t birthday; 1727 +@property(nonatomic,strong) NSString* selfIdentifier;
  1728 +
  1729 +@end
1252 1730
1253 /** 1731 /**
1254 - * 好友区域 1732 + * 关系链变更详细信息
1255 */ 1733 */
1256 -@property(nonatomic,strong) NSData* location; 1734 +@interface TIMSNSChangeInfo : NSObject
1257 1735
1258 /** 1736 /**
1259 - * 好友语言 1737 + * 用户 identifier
1260 */ 1738 */
1261 -@property(nonatomic,assign) uint32_t language; 1739 +@property(nonatomic,strong) NSString * identifier;
1262 1740
1263 /** 1741 /**
1264 - * 等级 1742 + * 用户昵称
1265 */ 1743 */
1266 -@property(nonatomic,assign) uint32_t level; 1744 +@property(nonatomic,strong) NSString * nickname;
1267 1745
1268 /** 1746 /**
1269 - * 角色 1747 + * 申请添加时有效,添加理由
1270 */ 1748 */
1271 -@property(nonatomic,assign) uint32_t role; 1749 +@property(nonatomic,strong) NSString * wording;
1272 1750
1273 /** 1751 /**
1274 - * 好友分组名称 NSString* 列表 1752 + * 申请时填写,添加来源
1275 */ 1753 */
1276 -@property(nonatomic,strong) NSArray* friendGroups; 1754 +@property(nonatomic,strong) NSString * source;
  1755 +
1277 1756
1278 /** 1757 /**
1279 - * 自定义字段集合,key是NSString类型,value是NSData类型或者NSNumber类型  
1280 - * (key值按照后台配置的字符串传入) 1758 + * 备注 type=TIM_SNS_SYSTEM_SNS_PROFILE_CHANGE 有效
1281 */ 1759 */
1282 -@property(nonatomic,strong) NSDictionary* customInfo; 1760 +@property(nonatomic,strong) NSString * remark;
  1761 +
  1762 +@end
1283 1763
  1764 +/**
  1765 + * 发送消息给多用户的失败回调信息
  1766 + */
  1767 +@interface TIMSendToUsersDetailInfo : NSObject
  1768 +/**
  1769 + * 发送消息成功的目标用户数
  1770 + */
  1771 +@property(nonatomic,assign) uint32_t succCnt;
  1772 +/**
  1773 + * 发送消息失败的目标用户数
  1774 + */
  1775 +@property(nonatomic,assign) uint32_t failCnt;
  1776 +/**
  1777 + * 失败信息(TIMSendToUsersErrInfo*)列表
  1778 + */
  1779 +@property(nonatomic,strong) NSArray *errInofs;
1284 @end 1780 @end
1285 1781
  1782 +/**
  1783 + * 发送消息给多用户的失败信息
  1784 + */
  1785 +@interface TIMSendToUsersErrInfo : NSObject
  1786 +/**
  1787 + * 发送消息失败的目标用户id
  1788 + */
  1789 +@property(nonatomic,strong) NSString *identifier;
  1790 +/**
  1791 + * 错误码
  1792 + */
  1793 +@property(nonatomic,assign) int code;
  1794 +/**
  1795 + * 错误描述
  1796 + */
  1797 +@property(nonatomic,strong) NSString *err;
  1798 +@end
1286 #endif 1799 #endif
  1 +/////////////////////////////////////////////////////////////////////
1 // 2 //
2 -// TIMConversation+MsgExt.h  
3 -// IMMessageExt 3 +// 腾讯云通信服务 IMSDK
4 // 4 //
5 -// Created by tomzhu on 2016/12/27. 5 +// 模块名称:TIMConversation + MsgExt
6 // 6 //
  7 +// 模块功能:此处主要存放待废弃的 API 函数,建议您使用 TIMConversation.h 内部声明的接口函数
7 // 8 //
  9 +/////////////////////////////////////////////////////////////////////
8 10
9 #ifndef TIMConversation_h 11 #ifndef TIMConversation_h
10 #define TIMConversation_h 12 #define TIMConversation_h
  13 +#import "TIMConversation.h"
11 14
12 -#import "ImSDK.h"  
13 -#import "TIMMessage+MsgExt.h"  
14 15
15 @interface TIMConversation (MsgExt) 16 @interface TIMConversation (MsgExt)
16 17
17 /** 18 /**
18 - * 保存消息到消息列表,这里只保存在本地 19 + * 向前获取会话漫游消息
19 * 20 *
20 - * @param msg 消息体  
21 - * @param sender 发送方  
22 - * @param isReaded 是否已读,如果发送方是自己,默认已读  
23 - *  
24 - * @return 0 成功  
25 - */  
26 -- (int)saveMessage:(TIMMessage*)msg sender:(NSString*)sender isReaded:(BOOL)isReaded;  
27 -  
28 -/**  
29 - * 获取会话消息  
30 - *  
31 - * @param count 获取数量  
32 - * @param last 上次最后一条消息  
33 - * @param succ 成功时回调  
34 - * @param fail 失败时回调  
35 - *  
36 - * @return 0 本次操作成功  
37 - */  
38 -- (int)getMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail;  
39 -  
40 -/**  
41 - * 向前获取会话消息 21 + * 调用方式和 getMessage 一样,区别是 getMessage 获取的是时间更老的消息,主要用于下拉 Tableview 刷新消息数据,getMessageForward 获取的是时间更新的消息,主要用于上拉 Tableview 刷新消息数据。
42 * 22 *
43 * @param count 获取数量 23 * @param count 获取数量
44 - * @param last 上次最后一条消息 24 + * @param last 上次最后一条消息,如果 last 为 nil,从最新的消息开始读取
45 * @param succ 成功时回调 25 * @param succ 成功时回调
46 * @param fail 失败时回调 26 * @param fail 失败时回调
47 * 27 *
48 - * @return 0 本次操作成功 28 + * @return 0:本次操作成功;1:本次操作失败
49 */ 29 */
50 - (int)getMessageForward:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; 30 - (int)getMessageForward:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail;
51 31
52 /** 32 /**
53 - * 获取本地会话消息  
54 - *  
55 - * @param count 获取数量  
56 - * @param last 上次最后一条消息  
57 - * @param succ 成功时回调  
58 - * @param fail 失败时回调  
59 - *  
60 - * @return 0 本次操作成功  
61 - */  
62 -- (int)getLocalMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail;  
63 -  
64 -/**  
65 - * 获取会话消息 33 + * 获取指定会话消息
66 * 34 *
67 * @param locators 消息定位符(TIMMessageLocator)数组 35 * @param locators 消息定位符(TIMMessageLocator)数组
68 * @param succ 成功时回调 36 * @param succ 成功时回调
69 * @param fail 失败时回调 37 * @param fail 失败时回调
70 * 38 *
71 - * @return 0 本次操作成功 39 + * @return 0:本次操作成功;1:本次操作失败
72 */ 40 */
73 - (int)findMessages:(NSArray*)locators succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; 41 - (int)findMessages:(NSArray*)locators succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail;
74 42
75 /** 43 /**
76 - * 撤回消息(仅C2C和GROUP会话有效、onlineMessage无效、AVChatRoom和BChatRoom无效)  
77 - *  
78 - * @param msg 被撤回的消息  
79 - * @param succ 成功时回调  
80 - * @param fail 失败时回调  
81 - *  
82 - * @return 0 本次操作成功  
83 - */  
84 -- (int)revokeMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;  
85 -  
86 -/**  
87 - * 同步本会话的消息撤回通知(仅GROUP会话有效) 44 + * 获取自己的 id
88 * 45 *
89 - * @param succ 成功时回调,同步的通知会通过TIMMessageRevokeListener抛出  
90 - * @param fail 失败时回调  
91 - *  
92 - * @return 0 本次操作成功  
93 - */  
94 -- (int)syncRevokeNotify:(TIMSucc)succ fail:(TIMFail)fail;  
95 -  
96 -/**  
97 - * 删除本地会话消息  
98 - *  
99 - * @param succ 成功时回调  
100 - * @param fail 失败时回调  
101 - *  
102 - * @return 0 本次操作成功  
103 - */  
104 -- (int)deleteLocalMessage:(TIMSucc)succ fail:(TIMFail)fail;  
105 -  
106 -/**  
107 - * 设置已读消息  
108 - *  
109 - * @param readed 会话内最近一条已读的消息,nil表示上报最新消息  
110 - *  
111 - * @param succ 成功时回调  
112 - * @param fail 失败时回调  
113 - *  
114 - * @return 0 表示成功  
115 - */  
116 -- (int)setReadMessage:(TIMMessage*)readed succ:(TIMSucc)succ fail:(TIMFail)fail;  
117 -  
118 -/**  
119 - * 获取该会话的未读计数  
120 - *  
121 - * @return 返回未读计数  
122 - */  
123 -- (int)getUnReadMessageNum;  
124 -  
125 -/**  
126 - * 获取最后一条消息  
127 - *  
128 - * @return 最后一条消息  
129 - */  
130 -- (TIMMessage*)getLastMsg;  
131 -  
132 -/**  
133 - * 将消息导入本地数据库  
134 - *  
135 - * @param msgs 消息(TIMMessage*)列表  
136 - *  
137 - * @return 0 成功  
138 - */  
139 -- (int)importMessages:(NSArray*)msgs;  
140 -  
141 -/**  
142 - * 设置会话草稿  
143 - *  
144 - * @param draft 草稿内容  
145 - *  
146 - * @return 0 成功  
147 - */  
148 -- (int)setDraft:(TIMMessageDraft*)draft;  
149 -  
150 -/**  
151 - * 获取会话草稿  
152 - *  
153 - * @return 草稿内容,没有草稿返回nil  
154 - */  
155 -- (TIMMessageDraft*)getDraft;  
156 -  
157 -/**  
158 - * 禁用本会话的存储,只对当前初始化有效,重启后需要重新设置  
159 - * 需要 initSdk 之后调用 46 + * @return 用户 id
160 */ 47 */
161 -- (void)disableStorage; 48 +- (NSString*)getSelfIdentifier;
162 49
163 @end 50 @end
164 51
  1 +/////////////////////////////////////////////////////////////////////
1 // 2 //
2 -// TIMConversation.h  
3 -// ImSDK 3 +// 腾讯云通信服务 IMSDK
4 // 4 //
5 -// Created by bodeng on 28/1/15.  
6 -// Copyright (c) 2015 tencent. All rights reserved. 5 +// 模块名称:TIMConversation 会话模块
7 // 6 //
  7 +// 模块功能:一个会话对应一个聊天窗口,比如跟一个好友的 C2C 聊天叫做一个会话,一个聊天群也叫做一个会话。
  8 +//
  9 +// TIMConversation 提供的接口函数都是围绕消息的相关操作,包括:消息发送、获取历史消息、设置消息已读设置、撤回和删除等等。
  10 +//
  11 +/////////////////////////////////////////////////////////////////////
8 12
9 #ifndef ImSDK_TIMConversation_h 13 #ifndef ImSDK_TIMConversation_h
10 #define ImSDK_TIMConversation_h 14 #define ImSDK_TIMConversation_h
11 15
12 #import "TIMComm.h" 16 #import "TIMComm.h"
13 #import "TIMCallback.h" 17 #import "TIMCallback.h"
  18 +#import "TIMMessage.h"
14 19
15 @class TIMMessage; 20 @class TIMMessage;
16 21
17 -/**  
18 - * 会话  
19 - */  
20 @interface TIMConversation : NSObject 22 @interface TIMConversation : NSObject
21 23
  24 +#pragma mark 一,发消息
  25 +
  26 +/////////////////////////////////////////////////////////////////////////////////
  27 +//
  28 +// (一)发消息
  29 +//
  30 +/////////////////////////////////////////////////////////////////////////////////
  31 +/// @name 发消息相关接口
  32 +/// @{
22 /** 33 /**
23 - * 发送消息 34 + * 1.1 发送消息
  35 + *
  36 + * TIMMessage 由多个 TIMElem 组成,一个 TIMElem 可以是一串文本,也可以是一张图片。
  37 + * 虽然说每一条消息都可以包含多个 TIMElem,但这个并不常用,通常您只需要在一个 TIMMessage 塞入一个 TIMElem 即可。
  38 + *
  39 + * 详情请参考官网文档 [消息收发](https://cloud.tencent.com/document/product/269/9150)
24 * 40 *
25 * @param msg 消息体 41 * @param msg 消息体
26 * @param succ 发送成功时回调 42 * @param succ 发送成功时回调
27 * @param fail 发送失败时回调 43 * @param fail 发送失败时回调
28 * 44 *
29 - * @return 0 本次操作成功 45 + * @return 0:操作成功;1:操作失败
30 */ 46 */
31 - (int)sendMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; 47 - (int)sendMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
32 48
33 /** 49 /**
34 - * 发送在线消息(服务器不保存消息) 50 + * 1.2 发送在线消息(无痕消息)
  51 + *
  52 + * “在线消息”,也可以称为是“无痕消息”。跟普通消息的区别在于:在线消息不会被云服务存储,也不会存储于本地数据库中。
  53 + * 如果接收者在线,可以收到消息,但如果接收者离线,重新上线后也不能通过 getMessage() 接口从历史消息里查到它们。
  54 + *
  55 + * 该类型消息比较适合用作发送广播通知等不重要的提示消息。
  56 + *
  57 + * 1. 在线消息不会被计入未读计数
  58 + * 2. 暂不支持在 AVChatRoom 和 BChatRoom 中发送。
35 * 59 *
36 * @param msg 消息体 60 * @param msg 消息体
37 * @param succ 成功回调 61 * @param succ 成功回调
38 * @param fail 失败回调 62 * @param fail 失败回调
39 * 63 *
40 - * @return 0 成功 64 + * @return 0:操作成功;1:操作失败
41 */ 65 */
42 - (int)sendOnlineMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; 66 - (int)sendOnlineMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
43 67
  68 +///@}
  69 +
  70 +#pragma mark 二,获取消息
  71 +/////////////////////////////////////////////////////////////////////////////////
  72 +//
  73 +// (二)获取消息
  74 +//
  75 +/////////////////////////////////////////////////////////////////////////////////
  76 +/// @name 获取消息相关接口
  77 +/// @{
  78 +/**
  79 + * 2.1 从云端拉取历史消息
  80 + *
  81 + * 如果用户的网络正常且登录成功,可以通过该接口拉取历史消息,该接口会返回云端存储的历史消息(最多存储7天)。
  82 + *
  83 + * 1. 单聊和群聊消息会在云端免费存储7天,如果希望存储更长时间,可前往
  84 + * ([IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 消息 ->消息漫游时长)进行购买,
  85 + * 具体资费请参考 [价格说明](https://cloud.tencent.com/document/product/269/11673)。
  86 + *
  87 + * 2. 对于图片、语音等资源类消息,获取到的消息体只会包含描述信息,需要通过额外的接口下载数据,
  88 + * 详情请参考 [消息收发](https://cloud.tencent.com/document/product/269/9150)中的 "消息解析" 部分文档。
  89 + *
  90 + * @param count 获取数量
  91 + * @param last 上次最后一条消息,如果 last 为 nil,从最新的消息开始读取
  92 + * @param succ 成功时回调
  93 + * @param fail 失败时回调
  94 + *
  95 + * @return 0:本次操作成功;1:本次操作失败
  96 + */
  97 +- (int)getMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail;
  98 +
  99 +/**
  100 + * 2.2 从本地数据库中获取历史消息
  101 + *
  102 + * 如果客户网络异常或登录失败,可以通过该接口获取本地存储的历史消息,调用方法和 getMessage() 一致
  103 + *
  104 + * @param count 获取数量
  105 + * @param last 上次最后一条消息
  106 + * @param succ 成功时回调
  107 + * @param fail 失败时回调
  108 + *
  109 + * @return 0:本次操作成功;1:本次操作失败
  110 + */
  111 +- (int)getLocalMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail;
  112 +
44 /** 113 /**
45 - * 获取会话人,单聊为对方账号,群聊为群组Id 114 + * 2.3 获取当前会话的最后一条消息
  115 + *
  116 + * 可用于“装饰”会话列表,目前大多数 App 的会话列表中都会显示该会话的最后一条消息
  117 + *
  118 + * @return 最后一条消息
  119 + */
  120 +- (TIMMessage*)getLastMsg;
  121 +
  122 +///@}
  123 +
  124 +#pragma mark 三,设置消息已读
  125 +/////////////////////////////////////////////////////////////////////////////////
  126 +//
  127 +// (三)设置消息已读
  128 +//
  129 +/////////////////////////////////////////////////////////////////////////////////
  130 +/// @name 设置消息已读
  131 +/// @{
  132 +/**
  133 + * 3.1 标记消息为已读状态
  134 + *
  135 + * 该接口会标记当前消息以及之前的所有消息为已读状态,标记消息为已读状态会有两个作用:
  136 + * 1. 已经被标记为已读的消息不会重复提醒,下次登录或者换一台终端设备登录 IM 时,都不会再次收到该消息的未读提醒。
  137 + * 2. 如果发送者通过 TIMUserConfig -> enableReadReceipt 开启了 “被阅回执”,接收者在标记已读状态时,发送者会收到“被阅提醒”。
  138 + *
  139 + * @note 该接口尚不支持标记单独一条消息,只能标记一批。即标记当前一条消息,之前的消息也会全被标记为已读状态。
  140 + * 如果您想做语音的单条消息已读逻辑,请暂时使用 TIMMessage.h -> setCustomInt 接口自定义一个“已读”字段,
  141 + * 需要注意的是,这个接口设置的字段只会在本地保存,如果切换了终端或则 App 被卸载,这个自定义的字段都会失效。
  142 + *
  143 + * @param fromMsg 会话内最近一条已读的消息,nil 表示上报最新消息
  144 + * @param succ 成功时回调
  145 + * @param fail 失败时回调
  146 + *
  147 + * @return 0 表示成功
  148 + */
  149 +- (int)setReadMessage:(TIMMessage*)fromMsg succ:(TIMSucc)succ fail:(TIMFail)fail;
  150 +
  151 +/**
  152 + * 3.2 获取会话的未读消息计数
  153 + *
  154 + * 1. 同一个终端登录,在未卸载 APP 的情况下,您可以通过当前接口获取的未读消息的个数。
  155 + * 2. 如果希望换一台终端也能取到同样的未读计数提醒,或者卸载 APP 再重装,未读计数提醒还能保留卸载前的状态,
  156 + * 就需要设置 TIMUserConfig 的 disableAutoReport 为 YES,这样可以开启多终端同步未读提醒。
  157 + *
  158 + * 详情参考 [未读消息计数](https://cloud.tencent.com/document/product/269/9151)
  159 + *
  160 + * @return 返回未读计数
  161 + */
  162 +- (int)getUnReadMessageNum;
  163 +
  164 +///@}
  165 +
  166 +#pragma mark 四,撤回/删除消息
  167 +/////////////////////////////////////////////////////////////////////////////////
  168 +//
  169 +// (四)撤回/删除消息
  170 +//
  171 +/////////////////////////////////////////////////////////////////////////////////
  172 +/// @name 撤回/删除消息相关接口
  173 +/// @{
  174 +/**
  175 + * 4.1 撤回一条已发送的消息(消息发送后 )
  176 + *
  177 + * 1. 仅支持 C2C 会话和 GROUP 会话中发送的消息,无法撤销 OnlineMessage,也无法撤销 AVChatRoom 和 BChatRoom 中的消息。
  178 + * 2. 只支持两分钟之内的消息撤回。
  179 + * 3. 您需要在 TIMUserConfig -> TIMMessageRevokeListener 监听 onRevokeMessage() 消息撤回回调,
  180 + * 如果消息撤回成功,消息的接收方会收到一次 onRevokeMessage:(TIMMessageLocator*) 回调,TIMMessageLocator 相当于一条消息的定位标志。
  181 + * 您可以在已收到的历史消息里进行遍历,通过 TIMMessage 中的 respondsToLocator() 接口进行比对,以便定位到该条消息。
  182 + *
  183 + * @param msg 被撤回的消息
  184 + * @param succ 成功时回调
  185 + * @param fail 失败时回调
  186 + *
  187 + * @return 0:本次操作成功;1:本次操作失败
  188 + */
  189 +- (int)revokeMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
  190 +
  191 +/**
  192 + * 4.2 删除当前会话的本地历史消息
  193 + *
  194 + * @param succ 成功时回调
  195 + * @param fail 失败时回调
  196 + *
  197 + * @return 0 本次操作成功
  198 + */
  199 +- (int)deleteLocalMessage:(TIMSucc)succ fail:(TIMFail)fail;
  200 +
  201 +///@}
  202 +
  203 +#pragma mark 五,获取会话信息
  204 +/////////////////////////////////////////////////////////////////////////////////
  205 +//
  206 +// (五)获取会话信息
  207 +//
  208 +/////////////////////////////////////////////////////////////////////////////////
  209 +/// @name 获取会话信息相关接口
  210 +/// @{
  211 +
  212 +/**
  213 + * 5.1 获取会话类型
  214 + *
  215 + * @return 会话类型
  216 + */
  217 +- (TIMConversationType)getType;
  218 +
  219 +/**
  220 + * 5.2 获取会话 ID
  221 + *
  222 + * C2C:对方账号;Group:群组Id。
  223 + *
  224 + * 对同一个单聊或则群聊会话,getReceiver 获取的会话 ID 都是固定的,C2C 获取的是对方账号,Group 获取的是群组 Id。
46 * 225 *
47 * @return 会话人 226 * @return 会话人
48 */ 227 */
49 - (NSString*)getReceiver; 228 - (NSString*)getReceiver;
50 229
51 /** 230 /**
52 - * 获取群名称(只有群会话有效) 231 + * 5.3 获取群名称
  232 + *
  233 + * 获取群名称,只有群会话有效。
53 * 234 *
54 * @return 群名称 235 * @return 群名称
55 */ 236 */
56 - (NSString*)getGroupName; 237 - (NSString*)getGroupName;
57 238
  239 +///@}
  240 +
  241 +#pragma mark 六,草稿箱
  242 +/////////////////////////////////////////////////////////////////////////////////
  243 +//
  244 +// (六)草稿箱
  245 +//
  246 +/////////////////////////////////////////////////////////////////////////////////
  247 +/// @name 草稿箱
  248 +/// @{
  249 +
58 /** 250 /**
59 - * 获取会话类型 251 + * 6.1 添加未编辑完的草稿消息
60 * 252 *
61 - * @return 会话类型 253 + * 在发送消息时,常常会遇到尚未编辑完毕就要切换到其它聊天窗口的情况,这些未编辑完的消息就可以通过 setDraft() 接口存储到草稿箱中。
  254 + * 草稿信息会存本地数据库,重新登录后依然可以获取。
  255 + *
  256 + *
  257 + * @param draft 草稿内容,详情请参考 TIMMessage.h 里面的 TIMMessageDraft 定义
  258 + *
  259 + * @return 0:成功;1:失败
62 */ 260 */
63 -- (TIMConversationType)getType; 261 +- (int)setDraft:(TIMMessageDraft*)draft;
  262 +
  263 +/**
  264 + * 6.2 获取未编辑完的草稿消息
  265 + *
  266 + * @return 草稿内容,没有草稿返回 nil
  267 + */
  268 +- (TIMMessageDraft*)getDraft;
  269 +
  270 +///@}
  271 +
  272 +#pragma mark 七,导入消息到会话
  273 +/////////////////////////////////////////////////////////////////////////////////
  274 +//
  275 +// (七)导入消息到会话
  276 +//
  277 +/////////////////////////////////////////////////////////////////////////////////
  278 +/// @name 导入消息到会话相关接口
  279 +/// @{
  280 +/**
  281 + * 7.1 向本地消息列表中添加一条消息,但并不将其发送出去。
  282 + *
  283 + * 该接口主要用于满足向聊天会话中插入一些提示性消息的需求,比如“您已经退出该群”,这类消息有展示
  284 + * 在聊天消息区的需求,但并没有发送给其他人的必要。
  285 + * 所以 saveMessage() 相当于一个被禁用了网络发送能力的 sendMessage() 接口。
  286 + *
  287 + * @param msg 消息体
  288 + * @param sender 发送方
  289 + * @param isRead 是否已读,如果发送方是自己,默认已读
  290 + *
  291 + * @return 0:成功;1:失败
  292 + */
  293 +- (int)saveMessage:(TIMMessage*)msg sender:(NSString*)sender isReaded:(BOOL)isRead;
64 294
65 /** 295 /**
66 - * 获取该会话所属用户的id 296 + * 7.2 将消息导入本地数据库
  297 + *
  298 + * @param msgs 消息(TIMMessage*)列表
67 * 299 *
68 - * @return 用户id 300 + * @return 0:成功;1:失败
69 */ 301 */
70 -- (NSString*)getSelfIdentifier; 302 +- (int)importMessages:(NSArray*)msgs;
71 303
  304 +///@}
72 @end 305 @end
73 306
74 307
  1 +//
  2 +// TIMErrorCode.h
  3 +// ImSDK
  4 +//
  5 +// Created by jameskhdeng on 2018/11/23.
  6 +// Copyright © 2018 tencent. All rights reserved.
  7 +//
  8 +
  9 +#ifndef TIMErrorCode_h
  10 +#define TIMErrorCode_h
  11 +
  12 +enum ERROR_CODE {
  13 +
  14 + /////////////////////////////////////////////////////////////////////////////////
  15 + //
  16 + // (一)终端 IM SDK
  17 + //
  18 + /////////////////////////////////////////////////////////////////////////////////
  19 +
  20 + // 通用错误码
  21 +
  22 + ERR_SUCC = 0, ///< 无错误。
  23 + ERR_IN_PROGESS = 6015, ///< 执行中,请做好接口调用控制,例如,第一次初始化操作在回调前,后续的初始化操作会返回该错误码。
  24 + ERR_INVALID_PARAMETERS = 6017, ///< 参数无效,请检查参数是否符合要求,具体可查看错误信息进一步定义哪个字段。
  25 + ERR_IO_OPERATION_FAILED = 6022, ///< 操作本地 IO 错误,检查是否有读写权限,磁盘是否已满。
  26 + ERR_INVALID_JSON = 6027, ///< 错误的 JSON 格式,请检查参数是否符合接口的要求,具体可查看错误信息进一步定义哪个字段。
  27 + ERR_OUT_OF_MEMORY = 6028, ///< 内存不足,可能存在内存泄漏,iOS 平台使用 Instrument 工具,Android 平台使用 Profiler 工具,分析出什么地方的内存占用高。
  28 + ERR_PARSE_RESPONSE_FAILED = 6001, ///< PB 解析失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  29 + ERR_SERIALIZE_REQ_FAILED = 6002, ///< PB 序列化失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  30 + ERR_SDK_NOT_INITIALIZED = 6013, ///< IM SDK 未初始化,初始化成功回调之后重试。
  31 + ERR_LOADMSG_FAILED = 6005, ///< 加载本地数据库操作失败,可能存储文件有损坏,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 联系客服定位具体问题。
  32 + ERR_DATABASE_OPERATE_FAILED = 6019, ///< 本地数据库操作失败,可能是部分目录无权限或者数据库文件已损坏。
  33 + ERR_SDK_COMM_CROSS_THREAD = 7001, ///< 跨线程错误,不能在跨越不同线程中执行,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  34 + ERR_SDK_COMM_TINYID_EMPTY = 7002, ///< TinyId 为空,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  35 + ERR_SDK_COMM_INVALID_IDENTIFIER = 7003, ///< Identifier 非法,必须不为空,要求可打印 ASCII 字符(0x20-0x7e),长度不超过32字节。
  36 + ERR_SDK_COMM_FILE_NOT_FOUND = 7004, ///< 文件不存在,请检查文件路径是否正确。
  37 + ERR_SDK_COMM_FILE_TOO_LARGE = 7005, ///< 文件大小超出了限制,如果上传文件,最大限制是28MB。
  38 + ERR_SDK_COMM_FILE_SIZE_EMPTY = 7006, ///< 空文件,要求文件大小不是0字节,如果上传图片、语音、视频或文件,请检查文件是否正确生成。
  39 + ERR_SDK_COMM_FILE_OPEN_FAILED = 7007, ///< 文件打开失败,请检查文件是否存在,或者已被独占打开,引起 SDK 打开失败。
  40 +
  41 + // 帐号错误码
  42 +
  43 + ERR_SDK_NOT_LOGGED_IN = 6014, ///< IM SDK 未登录,请先登录,成功回调之后重试,或者已被踢下线,可使用 TIMManager getLoginUser 检查当前是否在线。
  44 + ERR_NO_PREVIOUS_LOGIN = 6026, ///< 自动登录时,并没有登录过该用户,这时候请调用 login 接口重新登录。
  45 + ERR_USER_SIG_EXPIRED = 6206, ///< UserSig 过期,需要监听 UserStatusListener,onUserSigExpired 后重新获取 UserSig 登录。
  46 + ERR_LOGIN_KICKED_OFF_BY_OTHER = 6208, ///< 其他终端登录同一个帐号,引起已登录的帐号被踢,需重新登录。
  47 + ERR_SDK_ACCOUNT_LOGIN_IN_PROCESS = 7501, ///< 登录正在执行中,例如,第一次 login 或 autoLogin 操作在回调前,后续的 login 或 autoLogin 操作会返回该错误码。
  48 + ERR_SDK_ACCOUNT_LOGOUT_IN_PROCESS = 7502, ///< 登出正在执行中,例如,第一次 logout 操作在回调前,后续的 logout 操作会返回该错误码。
  49 + ERR_SDK_ACCOUNT_TLS_INIT_FAILED = 7503, ///< TLS SDK 初始化失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  50 + ERR_SDK_ACCOUNT_TLS_NOT_INITIALIZED = 7504, ///< TLS SDK 未初始化,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  51 + ERR_SDK_ACCOUNT_TLS_TRANSPKG_ERROR = 7505, ///< TLS SDK TRANS 包格式错误,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  52 + ERR_SDK_ACCOUNT_TLS_DECRYPT_FAILED = 7506, ///< TLS SDK 解密失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  53 + ERR_SDK_ACCOUNT_TLS_REQUEST_FAILED = 7507, ///< TLS SDK 请求失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  54 + ERR_SDK_ACCOUNT_TLS_REQUEST_TIMEOUT = 7508, ///< TLS SDK 请求超时,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  55 +
  56 + // 消息错误码
  57 +
  58 + ERR_INVALID_CONVERSATION = 6004, ///< 会话无效,getConversation 时检查是否已经登录,如未登录获取会话,会有此错误码返回。
  59 + ERR_FILE_TRANS_AUTH_FAILED = 6006, ///< 文件传输鉴权失败,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  60 + ERR_FILE_TRANS_NO_SERVER = 6007, ///< 文件传输获取 Server 列表失败,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  61 + ERR_FILE_TRANS_UPLOAD_FAILED = 6008, ///< 文件传输上传失败,请检查网络是否连接,如果上传的是图片,确认图片能够正常打开。
  62 + ERR_FILE_TRANS_DOWNLOAD_FAILED = 6009, ///< 文件传输下载失败,请检查网络,或者文件、语音是否已经过期,目前资源文件存储7天。
  63 + ERR_HTTP_REQ_FAILED = 6010, ///< HTTP 请求失败,请检查 URL 地址是否合法,可在网页浏览器尝试访问该 URL 地址。
  64 + ERR_INVALID_MSG_ELEM = 6016, ///< IM SDK 无效消息 elem,具体可查看错误信息进一步定义哪个字段。
  65 + ERR_INVALID_SDK_OBJECT = 6021, ///< 无效的对象,例如用户自己生成 TIMImage 对象,或内部赋值错误导致对象无效。
  66 + ERR_SDK_MSG_BODY_SIZE_LIMIT = 8001, ///< 消息长度超出限制,消息长度不要超过8k,消息长度是各个 elem 长度的总和,elem 长度是所有 elem 字段的长度总和。
  67 + ERR_SDK_MSG_KEY_REQ_DIFFER_RSP = 8002, ///< 消息 KEY 错误,内部错误,网络请求包的 KEY 和 回复包的不一致。
  68 +
  69 + // 群组错误码
  70 +
  71 + ERR_SDK_GROUP_INVALID_ID = 8501, ///< 群组 ID 非法,自定义群组 ID 必须为可打印 ASCII 字符(0x20-0x7e),最长48个字节,且前缀不能为 @TGS#(避免与服务端默认分配的群组 ID 混淆)。
  72 + ERR_SDK_GROUP_INVALID_NAME = 8502, ///< 群名称非法,群名称最长30字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  73 + ERR_SDK_GROUP_INVALID_INTRODUCTION = 8503, ///< 群简介非法,群简介最长240字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  74 + ERR_SDK_GROUP_INVALID_NOTIFICATION = 8504, ///< 群公告非法,群公告最长300字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  75 + ERR_SDK_GROUP_INVALID_FACE_URL = 8505, ///< 群头像 URL 非法,群头像 URL 最长100字节,可在网页浏览器尝试访问该 URL 地址。
  76 + ERR_SDK_GROUP_INVALID_NAME_CARD = 8506, ///< 群名片非法,群名片最长50字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  77 + ERR_SDK_GROUP_MEMBER_COUNT_LIMIT = 8507, ///< 超过群组成员数的限制,在创建群和邀请成员时,指定的成员数超出限制,最大群成员数量:私有群是200人,公开群是2000人,聊天室是10000人,音视频聊天室和在线成员广播大群无限制。
  78 + ERR_SDK_GROUP_JOIN_PRIVATE_GROUP_DENY = 8508, ///< 不允许申请加入 Private 群组,任意群成员可邀请入群,且无需被邀请人同意。
  79 + ERR_SDK_GROUP_INVITE_SUPER_DENY = 8509, ///< 不允许邀请角色为群主的成员,请检查角色字段是否填写正确。
  80 + ERR_SDK_GROUP_INVITE_NO_MEMBER = 8510, ///< 不允许邀请0个成员,请检查成员字段是否填写正确。
  81 +
  82 + // 关系链错误码
  83 +
  84 + ERR_SDK_FRIENDSHIP_INVALID_PROFILE_KEY = 9001, ///< 资料字段非法,资料支持标配字段及自定义字段,其中自定义字段的关键字,必须是英文字母,且长度不得超过8字节,自定义字段的值最长不能超过500字节。
  85 + ERR_SDK_FRIENDSHIP_INVALID_ADD_REMARK = 9002, ///< 备注字段非法,最大96字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  86 + ERR_SDK_FRIENDSHIP_INVALID_ADD_WORDING = 9003, ///< 请求添加好友的请求说明字段非法,最大120字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  87 + ERR_SDK_FRIENDSHIP_INVALID_ADD_SOURCE = 9004, ///< 请求添加好友的添加来源字段非法,来源需要添加“AddSource_Type_”前缀。
  88 + ERR_SDK_FRIENDSHIP_FRIEND_GROUP_EMPTY = 9005, ///< 好友分组字段非法,必须不为空,每个分组的名称最长30字节,字符编码必须是 UTF-8 ,如果包含中文,可能用多个字节表示一个中文字符,请注意检查字符串的字节长度。
  89 +
  90 + // 网络错误码
  91 +
  92 + ERR_SDK_NET_ENCODE_FAILED = 9501, ///< SSO 加密失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  93 + ERR_SDK_NET_DECODE_FAILED = 9502, ///< SSO 解密失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  94 + ERR_SDK_NET_AUTH_INVALID = 9503, ///< SSO 未完成鉴权,可能登录未完成,请在登录完成后再操作。
  95 + ERR_SDK_NET_COMPRESS_FAILED = 9504, ///< 数据包压缩失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  96 + ERR_SDK_NET_UNCOMPRESS_FAILED = 9505, ///< 数据包解压失败,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  97 + ERR_SDK_NET_FREQ_LIMIT = 9506, ///< 调用频率限制,最大每秒发起 5 次请求。
  98 + ERR_SDK_NET_REQ_COUNT_LIMIT = 9507, ///< 请求队列満,超过同时请求的数量限制,最大同时发起1000个请求。
  99 + ERR_SDK_NET_DISCONNECT = 9508, ///< 网络已断开,未建立连接,或者建立 socket 连接时,检测到无网络。
  100 + ERR_SDK_NET_ALLREADY_CONN = 9509, ///< 网络连接已建立,重复创建连接,内部错误。
  101 + ERR_SDK_NET_CONN_TIMEOUT = 9510, ///< 建立网络连接超时,请等网络恢复后重试。
  102 + ERR_SDK_NET_CONN_REFUSE = 9511, ///< 网络连接已被拒绝,请求过于频繁,服务端拒绝服务。
  103 + ERR_SDK_NET_NET_UNREACH = 9512, ///< 没有到达网络的可用路由,请等网络恢复后重试。
  104 + ERR_SDK_NET_SOCKET_NO_BUFF = 9513, ///< 系统中没有足够的缓冲区空间资源可用来完成调用,系统过于繁忙,内部错误。
  105 + ERR_SDK_NET_RESET_BY_PEER = 9514, ///< 对端重置了连接,可能服务端过载,SDK 内部会自动重连,请等网络连接成功 onConnSucc ( iOS ) 或 onConnected ( Android ) 回调后重试。
  106 + ERR_SDK_NET_SOCKET_INVALID = 9515, ///< socket 套接字无效,内部错误,可 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 提供使用接口、错误码、错误信息给客服解决。
  107 + ERR_SDK_NET_HOST_GETADDRINFO_FAILED = 9516, ///< IP 地址解析失败,内部错误,可能是本地 imsdk_config 配置文件被损坏,读取到到 IP 地址非法。
  108 + ERR_SDK_NET_CONNECT_RESET = 9517, ///< 网络连接到中间节点或服务端重置,引起连接失效,内部错误,SDK 内部会自动重连,请等网络连接成功 onConnSucc ( iOS ) 或 onConnected ( Android ) 回调后重试。
  109 + ERR_SDK_NET_WAIT_INQUEUE_TIMEOUT = 9518, ///< 请求包等待进入待发送队列超时,发送时网络连接建立比较慢 或 频繁断网重连时,会出现该错误,请检查网络连接是否正常。
  110 + ERR_SDK_NET_WAIT_SEND_TIMEOUT = 9519, ///< 请求包已进入待发送队列,等待进入系统的网络 buffer 超时,数据包较多 或 发送线程处理不过来,内部错误。
  111 + ERR_SDK_NET_WAIT_ACK_TIMEOUT = 9520, ///< 请求包已进入系统的网络 buffer ,等待服务端回包超时,可能请求包没离开终端设备、中间路由丢弃、服务端意外丢包或回包被系统网络层丢弃,内部错误。
  112 +
  113 + /////////////////////////////////////////////////////////////////////////////////
  114 + //
  115 + // (二)服务端
  116 + //
  117 + /////////////////////////////////////////////////////////////////////////////////
  118 +
  119 + // SSO 接入层的错误码
  120 +
  121 + ERR_SVR_SSO_CONNECT_LIMIT = -302 , ///< SSO 的连接数量超出限制,服务端拒绝服务。
  122 + ERR_SVR_SSO_VCODE = -10000, ///< 下发验证码标志错误。
  123 + ERR_SVR_SSO_D2_EXPIRED = -10001, ///< D2 过期。
  124 + ERR_SVR_SSO_A2_UP_INVALID = -10003, ///< A2 校验失败等场景使用。
  125 + ERR_SVR_SSO_A2_DOWN_INVALID = -10004, ///< 处理下行包时发现 A2 验证没通过或者被安全打击。
  126 + ERR_SVR_SSO_EMPTY_KEY = -10005, ///< 不允许空 D2Key 加密。
  127 + ERR_SVR_SSO_UIN_INVALID = -10006, ///< D2 中的 uin 和 SSO 包头的 uin 不匹配。
  128 + ERR_SVR_SSO_VCODE_TIMEOUT = -10007, ///< 验证码下发超时。
  129 + ERR_SVR_SSO_NO_IMEI_AND_A2 = -10008, ///< 需要带上 IMEI 和 A2 。
  130 + ERR_SVR_SSO_COOKIE_INVALID = -10009, ///< Cookie 非法。
  131 + ERR_SVR_SSO_DOWN_TIP = -10101, ///< 下发提示语,D2 过期。
  132 + ERR_SVR_SSO_DISCONNECT = -10102, ///< 断链锁屏。
  133 + ERR_SVR_SSO_IDENTIFIER_INVALID = -10103, ///< 失效身份。
  134 + ERR_SVR_SSO_CLIENT_CLOSE = -10104, ///< 终端自动退出。
  135 + ERR_SVR_SSO_MSFSDK_QUIT = -10105, ///< MSFSDK 自动退出。
  136 + ERR_SVR_SSO_D2KEY_WRONG = -10106, ///< SSO D2key 解密失败次数太多,通知终端需要重置,重新刷新 D2 。
  137 + ERR_SVR_SSO_UNSURPPORT = -10107, ///< 不支持聚合,给终端返回统一的错误码。终端在该 TCP 长连接上停止聚合。
  138 + ERR_SVR_SSO_PREPAID_ARREARS = -10108, ///< 预付费欠费。
  139 + ERR_SVR_SSO_PACKET_WRONG = -10109, ///< 请求包格式错误。
  140 + ERR_SVR_SSO_APPID_BLACK_LIST = -10110, ///< SDKAppID 黑名单。
  141 + ERR_SVR_SSO_CMD_BLACK_LIST = -10111, ///< SDKAppID 设置 service cmd 黑名单。
  142 + ERR_SVR_SSO_APPID_WITHOUT_USING = -10112, ///< SDKAppID 停用。
  143 + ERR_SVR_SSO_FREQ_LIMIT = -10113, ///< 频率限制(用户),频率限制是设置针对某一个协议的每秒请求数的限制。
  144 + ERR_SVR_SSO_OVERLOAD = -10114, ///< 过载丢包(系统),连接的服务端处理过多请求,处理不过来,拒绝服务。
  145 +
  146 + // 资源文件错误码
  147 +
  148 + ERR_SVR_RES_NOT_FOUND = 114000, ///< 要发送的资源文件不存在。
  149 + ERR_SVR_RES_ACCESS_DENY = 114001, ///< 要发送的资源文件不允许访问。
  150 + ERR_SVR_RES_SIZE_LIMIT = 114002, ///< 文件大小超过限制。
  151 + ERR_SVR_RES_SEND_CANCEL = 114003, ///< 用户取消发送,如发送过程中登出等原因。
  152 + ERR_SVR_RES_READ_FAILED = 114004, ///< 读取文件内容失败。
  153 + ERR_SVR_RES_TRANSFER_TIMEOUT = 114005, ///< 资源文件(如图片、文件、语音、视频)传输超时,一般是网络问题导致。
  154 + ERR_SVR_RES_INVALID_PARAMETERS = 114011, ///< 参数非法。
  155 + ERR_SVR_RES_INVALID_FILE_MD5 = 115066, ///< 文件 MD5 校验失败。
  156 + ERR_SVR_RES_INVALID_PART_MD5 = 115068, ///< 分片 MD5 校验失败。
  157 +
  158 + // 后台公共错误码
  159 +
  160 + ERR_SVR_COMM_INVALID_HTTP_URL = 60002, ///< HTTP 解析错误 ,请检查 HTTP 请求 URL 格式。
  161 + ERR_SVR_COMM_REQ_JSON_PARSE_FAILED = 60003, ///< HTTP 请求 JSON 解析错误,请检查 JSON 格式。
  162 + ERR_SVR_COMM_INVALID_ACCOUNT = 60004, ///< 请求 URI 或 JSON 包体中 Identifier 或 UserSig 错误。
  163 + ERR_SVR_COMM_INVALID_ACCOUNT_EX = 60005, ///< 请求 URI 或 JSON 包体中 Identifier 或 UserSig 错误。
  164 + ERR_SVR_COMM_INVALID_SDKAPPID = 60006, ///< SDKAppID 失效,请核对 SDKAppID 有效性。
  165 + ERR_SVR_COMM_REST_FREQ_LIMIT = 60007, ///< REST 接口调用频率超过限制,请降低请求频率。
  166 + ERR_SVR_COMM_REQUEST_TIMEOUT = 60008, ///< 服务请求超时或 HTTP 请求格式错误,请检查并重试。
  167 + ERR_SVR_COMM_INVALID_RES = 60009, ///< 请求资源错误,请检查请求 URL。
  168 + ERR_SVR_COMM_ID_NOT_ADMIN = 60010, ///< REST API 请求的 Identifier 字段请填写 App 管理员帐号。
  169 + ERR_SVR_COMM_SDKAPPID_FREQ_LIMIT = 60011, ///< SDKAppID 请求频率超限,请降低请求频率。
  170 + ERR_SVR_COMM_SDKAPPID_MISS = 60012, ///< REST 接口需要带 SDKAppID,请检查请求 URL 中的 SDKAppID。
  171 + ERR_SVR_COMM_RSP_JSON_PARSE_FAILED = 60013, ///< HTTP 响应包 JSON 解析错误。
  172 + ERR_SVR_COMM_EXCHANGE_ACCOUNT_TIMEUT = 60014, ///< 置换帐号超时。
  173 + ERR_SVR_COMM_INVALID_ID_FORMAT = 60015, ///< 请求包体 Identifier 类型错误,请确认 Identifier 为字符串格式。
  174 + ERR_SVR_COMM_SDKAPPID_FORBIDDEN = 60016, ///< SDKAppID 被禁用,请 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 联系客服确认。
  175 + ERR_SVR_COMM_REQ_FORBIDDEN = 60017, ///< 请求被禁用,请 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 联系客服确认。
  176 + ERR_SVR_COMM_REQ_FREQ_LIMIT = 60018, ///< 请求过于频繁,请稍后重试。
  177 + ERR_SVR_COMM_REQ_FREQ_LIMIT_EX = 60019, ///< 请求过于频繁,请稍后重试。
  178 + ERR_SVR_COMM_INVALID_SERVICE = 60020, ///< 未购买套餐包或购买的套餐包正在配置中暂未生效,请五分钟后再次尝试。
  179 + ERR_SVR_COMM_SENSITIVE_TEXT = 80001, ///< 文本安全打击,文本中可能包含敏感词汇。
  180 + ERR_SVR_COMM_BODY_SIZE_LIMIT = 80002, ///< 发消息包体过长,目前支持最大8k消息包体长度,请减少包体大小重试。
  181 +
  182 + // 帐号错误码
  183 +
  184 + ERR_SVR_ACCOUNT_USERSIG_EXPIRED = 70001, ///< UserSig 已过期,请重新生成 UserSig,建议 UserSig 有效期不小于24小时。
  185 + ERR_SVR_ACCOUNT_USERSIG_EMPTY = 70002, ///< UserSig 长度为0,请检查传入的 UserSig 是否正确。
  186 + ERR_SVR_ACCOUNT_USERSIG_CHECK_FAILED = 70003, ///< UserSig 校验失败,请确认下 UserSig 内容是否被截断,如缓冲区长度不够导致的内容截断。
  187 + ERR_SVR_ACCOUNT_USERSIG_CHECK_FAILED_EX = 70005, ///< UserSig 校验失败,可用工具自行验证生成的 UserSig 是否正确。
  188 + ERR_SVR_ACCOUNT_USERSIG_MISMATCH_PUBLICKEY = 70009, ///< 用公钥验证 UserSig 失败,请确认生成的 UserSig 使用的私钥和 SDKAppID 是否对应。
  189 + ERR_SVR_ACCOUNT_USERSIG_MISMATCH_ID = 70013, ///< 请求的 Identifier 与生成 UserSig 的 Identifier 不匹配。
  190 + ERR_SVR_ACCOUNT_USERSIG_MISMATCH_SDKAPPID = 70014, ///< 请求的 SDKAppID 与生成 UserSig 的 SDKAppID 不匹配。
  191 + ERR_SVR_ACCOUNT_USERSIG_PUBLICKEY_NOT_FOUND = 70016, ///< 验证 UserSig 时公钥不存在。请先登录控制台下载私钥,下载私钥的具体方法可参考 [下载签名用的私钥](https://cloud.tencent.com/document/product/269/32688#.E4.B8.8B.E8.BD.BD.E7.AD.BE.E5.90.8D.E7.94.A8.E7.9A.84.E7.A7.81.E9.92.A5) 。
  192 + ERR_SVR_ACCOUNT_SDKAPPID_NOT_FOUND = 70020, ///< SDKAppID 未找到,请在云通信 IM 控制台确认应用信息。
  193 + ERR_SVR_ACCOUNT_INVALID_USERSIG = 70052, ///< UserSig 已经失效,请重新生成,再次尝试。
  194 + ERR_SVR_ACCOUNT_NOT_FOUND = 70107, ///< 请求的用户帐号不存在。
  195 + ERR_SVR_ACCOUNT_SEC_RSTR = 70114, ///< 安全原因被限制。
  196 + ERR_SVR_ACCOUNT_INTERNAL_TIMEOUT = 70169, ///< 服务端内部超时,请重试。
  197 + ERR_SVR_ACCOUNT_INVALID_COUNT = 70206, ///< 请求中批量数量不合法。
  198 + ERR_SVR_ACCOUNT_INVALID_PARAMETERS = 70402, ///< 参数非法,请检查必填字段是否填充,或者字段的填充是否满足协议要求。
  199 + ERR_SVR_ACCOUNT_ADMIN_REQUIRED = 70403, ///< 请求需要 App 管理员权限。
  200 + ERR_SVR_ACCOUNT_FREQ_LIMIT = 70050, ///< 因失败且重试次数过多导致被限制,请检查 UserSig 是否正确,一分钟之后再试。
  201 + ERR_SVR_ACCOUNT_BLACKLIST = 70051, ///< 帐号被拉入黑名单。
  202 + ERR_SVR_ACCOUNT_COUNT_LIMIT = 70398, ///< 创建帐号数量超过免费体验版数量限制,请升级为专业版。
  203 + ERR_SVR_ACCOUNT_INTERNAL_ERROR = 70500, ///< 服务端内部错误,请重试。
  204 +
  205 + // 资料错误码
  206 +
  207 + ERR_SVR_PROFILE_INVALID_PARAMETERS = 40001, ///< 请求参数错误,请根据错误描述检查请求是否正确。
  208 + ERR_SVR_PROFILE_ACCOUNT_MISS = 40002, ///< 请求参数错误,没有指定需要拉取资料的用户帐号。
  209 + ERR_SVR_PROFILE_ACCOUNT_NOT_FOUND = 40003, ///< 请求的用户帐号不存在。
  210 + ERR_SVR_PROFILE_ADMIN_REQUIRED = 40004, ///< 请求需要 App 管理员权限。
  211 + ERR_SVR_PROFILE_SENSITIVE_TEXT = 40005, ///< 资料字段中包含敏感词。
  212 + ERR_SVR_PROFILE_INTERNAL_ERROR = 40006, ///< 服务端内部错误,请稍后重试。
  213 + ERR_SVR_PROFILE_READ_PERMISSION_REQUIRED = 40007, ///< 没有资料字段的读权限,详情可参见 [资料字段](https://cloud.tencent.com/document/product/269/1500#.E8.B5.84.E6.96.99.E5.AD.97.E6.AE.B5) 。
  214 + ERR_SVR_PROFILE_WRITE_PERMISSION_REQUIRED = 40008, ///< 没有资料字段的写权限,详情可参见 [资料字段](https://cloud.tencent.com/document/product/269/1500#.E8.B5.84.E6.96.99.E5.AD.97.E6.AE.B5) 。
  215 + ERR_SVR_PROFILE_TAG_NOT_FOUND = 40009, ///< 资料字段的 Tag 不存在。
  216 + ERR_SVR_PROFILE_SIZE_LIMIT = 40601, ///< 资料字段的 Value 长度超过500字节。
  217 + ERR_SVR_PROFILE_VALUE_ERROR = 40605, ///< 标配资料字段的 Value 错误,详情可参见 [标配资料字段](https://cloud.tencent.com/doc/product/269/1500#.E6.A0.87.E9.85.8D.E8.B5.84.E6.96.99.E5.AD.97.E6.AE.B5) 。
  218 + ERR_SVR_PROFILE_INVALID_VALUE_FORMAT = 40610, ///< 资料字段的 Value 类型不匹配,详情可参见 [标配资料字段](https://cloud.tencent.com/doc/product/269/1500#.E6.A0.87.E9.85.8D.E8.B5.84.E6.96.99.E5.AD.97.E6.AE.B5) 。
  219 +
  220 + // 关系链错误码
  221 +
  222 + ERR_SVR_FRIENDSHIP_INVALID_PARAMETERS = 30001, ///< 请求参数错误,请根据错误描述检查请求是否正确。
  223 + ERR_SVR_FRIENDSHIP_INVALID_SDKAPPID = 30002, ///< SDKAppID 不匹配。
  224 + ERR_SVR_FRIENDSHIP_ACCOUNT_NOT_FOUND = 30003, ///< 请求的用户帐号不存在。
  225 + ERR_SVR_FRIENDSHIP_ADMIN_REQUIRED = 30004, ///< 请求需要 App 管理员权限。
  226 + ERR_SVR_FRIENDSHIP_SENSITIVE_TEXT = 30005, ///< 关系链字段中包含敏感词。
  227 + ERR_SVR_FRIENDSHIP_INTERNAL_ERROR = 30006, ///< 服务端内部错误,请重试。
  228 + ERR_SVR_FRIENDSHIP_NET_TIMEOUT = 30007, ///< 网络超时,请稍后重试。
  229 + ERR_SVR_FRIENDSHIP_WRITE_CONFLICT = 30008, ///< 并发写导致写冲突,建议使用批量方式。
  230 + ERR_SVR_FRIENDSHIP_ADD_FRIEND_DENY = 30009, ///< 后台禁止该用户发起加好友请求。
  231 + ERR_SVR_FRIENDSHIP_COUNT_LIMIT = 30010, ///< 自己的好友数已达系统上限。
  232 + ERR_SVR_FRIENDSHIP_GROUP_COUNT_LIMIT = 30011, ///< 分组已达系统上限。
  233 + ERR_SVR_FRIENDSHIP_PENDENCY_LIMIT = 30012, ///< 未决数已达系统上限。
  234 + ERR_SVR_FRIENDSHIP_BLACKLIST_LIMIT = 30013, ///< 黑名单数已达系统上限。
  235 + ERR_SVR_FRIENDSHIP_PEER_FRIEND_LIMIT = 30014, ///< 对方的好友数已达系统上限。
  236 + ERR_SVR_FRIENDSHIP_IN_SELF_BLACKLIST = 30515, ///< 请求添加好友时,对方在自己的黑名单中,不允许加好友。
  237 + ERR_SVR_FRIENDSHIP_ALLOW_TYPE_DENY_ANY = 30516, ///< 请求添加好友时,对方的加好友验证方式是不允许任何人添加自己为好友。
  238 + ERR_SVR_FRIENDSHIP_IN_PEER_BLACKLIST = 30525, ///< 请求添加好友时,自己在对方的黑名单中,不允许加好友。
  239 + ERR_SVR_FRIENDSHIP_ALLOW_TYPE_NEED_CONFIRM = 30539, ///< A 请求加 B 为好友,B 的加好友验证方式被设置为“AllowType_Type_NeedConfirm”,这时 A 与 B 之间只能形成未决关系,该返回码用于标识加未决成功,以便与加好友成功的返回码区分开,调用方可以捕捉该错误给用户一个合理的提示。
  240 + ERR_SVR_FRIENDSHIP_ADD_FRIEND_SEC_RSTR = 30540, ///< 添加好友请求被安全策略打击,请勿频繁发起添加好友请求。
  241 + ERR_SVR_FRIENDSHIP_PENDENCY_NOT_FOUND = 30614, ///< 请求的未决不存在。
  242 + ERR_SVR_FRIENDSHIP_DEL_NONFRIEND = 31704, ///< 与请求删除的帐号之间不存在好友关系。
  243 + ERR_SVR_FRIENDSHIP_DEL_FRIEND_SEC_RSTR = 31707, ///< 删除好友请求被安全策略打击,请勿频繁发起删除好友请求。
  244 + ERR_SVR_FRIENDSHIP_ACCOUNT_NOT_FOUND_EX = 31804, ///< 请求的用户帐号不存在。
  245 +
  246 + // 最近联系人错误码
  247 +
  248 + ERR_SVR_CONV_ACCOUNT_NOT_FOUND = 50001, ///< 请求的用户帐号不存在。
  249 + ERR_SVR_CONV_INVALID_PARAMETERS = 50002, ///< 请求参数错误,请根据错误描述检查请求是否正确。
  250 + ERR_SVR_CONV_ADMIN_REQUIRED = 50003, ///< 请求需要 App 管理员权限。
  251 + ERR_SVR_CONV_INTERNAL_ERROR = 50004, ///< 服务端内部错误,请重试。
  252 + ERR_SVR_CONV_NET_TIMEOUT = 50005, ///< 网络超时,请稍后重试。
  253 +
  254 + // 消息错误码
  255 +
  256 + ERR_SVR_MSG_PKG_PARSE_FAILED = 20001, ///< 请求包非法,请检查发送方和接收方帐号是否存在。
  257 + ERR_SVR_MSG_INTERNAL_AUTH_FAILED = 20002, ///< 内部鉴权失败。
  258 + ERR_SVR_MSG_INVALID_ID = 20003, ///< Identifier 无效或者 Identifier 未导入云通信 IM。
  259 + ERR_SVR_MSG_NET_ERROR = 20004, ///< 网络异常,请重试。
  260 + ERR_SVR_MSG_INTERNAL_ERROR1 = 20005, ///< 服务端内部错误,请重试。
  261 + ERR_SVR_MSG_PUSH_DENY = 20006, ///< 触发发送单聊消息之前回调,App 后台返回禁止下发该消息。
  262 + ERR_SVR_MSG_IN_PEER_BLACKLIST = 20007, ///< 发送单聊消息,被对方拉黑,禁止发送。
  263 + ERR_SVR_MSG_BOTH_NOT_FRIEND = 20009, ///< 消息发送双方互相不是好友,禁止发送(配置单聊消息校验好友关系才会出现)。
  264 + ERR_SVR_MSG_NOT_PEER_FRIEND = 20010, ///< 发送单聊消息,自己不是对方的好友(单向关系),禁止发送。
  265 + ERR_SVR_MSG_NOT_SELF_FRIEND = 20011, ///< 发送单聊消息,对方不是自己的好友(单向关系),禁止发送。
  266 + ERR_SVR_MSG_SHUTUP_DENY = 20012, ///< 因禁言,禁止发送消息。
  267 + ERR_SVR_MSG_REVOKE_TIME_LIMIT = 20016, ///< 消息撤回超过了时间限制(默认2分钟)。
  268 + ERR_SVR_MSG_DEL_RAMBLE_INTERNAL_ERROR = 20018, ///< 删除漫游内部错误。
  269 + ERR_SVR_MSG_JSON_PARSE_FAILED = 90001, ///< JSON 格式解析失败,请检查请求包是否符合 JSON 规范。
  270 + ERR_SVR_MSG_INVALID_JSON_BODY_FORMAT = 90002, ///< JSON 格式请求包中 MsgBody 不符合消息格式描述,或者 MsgBody 不是 Array 类型,请参考 [TIMMsgElement 对象](https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0timmsgelement) 的定义。
  271 + ERR_SVR_MSG_INVALID_TO_ACCOUNT = 90003, ///< JSON 格式请求包体中缺少 To_Account 字段或者 To_Account 字段不是 Integer 类型
  272 + ERR_SVR_MSG_INVALID_RAND = 90005, ///< JSON 格式请求包体中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型
  273 + ERR_SVR_MSG_INVALID_TIMESTAMP = 90006, ///< JSON 格式请求包体中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 类型
  274 + ERR_SVR_MSG_BODY_NOT_ARRAY = 90007, ///< JSON 格式请求包体中 MsgBody 类型不是 Array 类型,请将其修改为 Array 类型
  275 + ERR_SVR_MSG_ADMIN_REQUIRED = 90009, ///< 请求需要 App 管理员权限。
  276 + ERR_SVR_MSG_INVALID_JSON_FORMAT = 90010, ///< JSON 格式请求包不符合消息格式描述,请参考 [TIMMsgElement 对象](https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0timmsgelement) 的定义。
  277 + ERR_SVR_MSG_TO_ACCOUNT_COUNT_LIMIT = 90011, ///< 批量发消息目标帐号超过500,请减少 To_Account 中目标帐号数量。
  278 + ERR_SVR_MSG_TO_ACCOUNT_NOT_FOUND = 90012, ///< To_Account 没有注册或不存在,请确认 To_Account 是否导入云通信 IM 或者是否拼写错误。
  279 + ERR_SVR_MSG_TIME_LIMIT = 90026, ///< 消息离线存储时间错误(最多不能超过7天)。
  280 + ERR_SVR_MSG_INVALID_SYNCOTHERMACHINE = 90031, ///< JSON 格式请求包体中 SyncOtherMachine 字段不是 Integer 类型
  281 + ERR_SVR_MSG_INVALID_MSGLIFETIME = 90044, ///< JSON 格式请求包体中 MsgLifeTime 字段不是 Integer 类型
  282 + ERR_SVR_MSG_ACCOUNT_NOT_FOUND = 90048, ///< 请求的用户帐号不存在。
  283 + ERR_SVR_MSG_INTERNAL_ERROR2 = 90994, ///< 服务内部错误,请重试。
  284 + ERR_SVR_MSG_INTERNAL_ERROR3 = 90995, ///< 服务内部错误,请重试。
  285 + ERR_SVR_MSG_INTERNAL_ERROR4 = 91000, ///< 服务内部错误,请重试。
  286 + ERR_SVR_MSG_INTERNAL_ERROR5 = 90992, ///< 服务内部错误,请重试;如果所有请求都返回该错误码,且 App 配置了第三方回调,请检查 App 服务端是否正常向云通信 IM 后台服务端返回回调结果。
  287 + ERR_SVR_MSG_BODY_SIZE_LIMIT = 93000, ///< JSON 数据包超长,消息包体请不要超过8k。
  288 + ERR_SVR_MSG_LONGPOLLING_COUNT_LIMIT = 91101, ///< Web 端长轮询被踢(Web 端同时在线实例个数超出限制)。
  289 + // 120001 - 130000, ///< 单聊第三方回调返回的自定义错误码。
  290 +
  291 + // 群组错误码
  292 +
  293 + ERR_SVR_GROUP_INTERNAL_ERROR = 10002, ///< 服务端内部错误,请重试。
  294 + ERR_SVR_GROUP_API_NAME_ERROR = 10003, ///< 请求中的接口名称错误,请核对接口名称并重试。
  295 + ERR_SVR_GROUP_INVALID_PARAMETERS = 10004, ///< 参数非法,请根据错误描述检查请求是否正确。
  296 + ERR_SVR_GROUP_ACOUNT_COUNT_LIMIT = 10005, ///< 请求包体中携带的帐号数量过多。
  297 + ERR_SVR_GROUP_FREQ_LIMIT = 10006, ///< 操作频率限制,请尝试降低调用的频率。
  298 + ERR_SVR_GROUP_PERMISSION_DENY = 10007, ///< 操作权限不足,比如 Public 群组中普通成员尝试执行踢人操作,但只有 App 管理员才有权限。
  299 + ERR_SVR_GROUP_INVALID_REQ = 10008, ///< 请求非法,可能是请求中携带的签名信息验证不正确,请再次尝试或 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 联系技术客服。
  300 + ERR_SVR_GROUP_SUPER_NOT_ALLOW_QUIT = 10009, ///< 该群不允许群主主动退出。
  301 + ERR_SVR_GROUP_NOT_FOUND = 10010, ///< 群组不存在,或者曾经存在过,但是目前已经被解散。
  302 + ERR_SVR_GROUP_JSON_PARSE_FAILED = 10011, ///< 解析 JSON 包体失败,请检查包体的格式是否符合 JSON 格式。
  303 + ERR_SVR_GROUP_INVALID_ID = 10012, ///< 发起操作的 Identifier 非法,请检查发起操作的用户 Identifier 是否填写正确。
  304 + ERR_SVR_GROUP_ALLREADY_MEMBER = 10013, ///< 被邀请加入的用户已经是群成员。
  305 + ERR_SVR_GROUP_FULL_MEMBER_COUNT = 10014, ///< 群已满员,无法将请求中的用户加入群组,如果是批量加人,可以尝试减少加入用户的数量。
  306 + ERR_SVR_GROUP_INVALID_GROUPID = 10015, ///< 群组 ID 非法,请检查群组 ID 是否填写正确。
  307 + ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY = 10016, ///< App 后台通过第三方回调拒绝本次操作。
  308 + ERR_SVR_GROUP_SHUTUP_DENY = 10017, ///< 因被禁言而不能发送消息,请检查发送者是否被设置禁言。
  309 + ERR_SVR_GROUP_RSP_SIZE_LIMIT = 10018, ///< 应答包长度超过最大包长(1MB),请求的内容过多,请尝试减少单次请求的数据量。
  310 + ERR_SVR_GROUP_ACCOUNT_NOT_FOUND = 10019, ///< 请求的用户帐号不存在。
  311 + ERR_SVR_GROUP_GROUPID_IN_USED = 10021, ///< 群组 ID 已被使用,请选择其他的群组 ID。
  312 + ERR_SVR_GROUP_SEND_MSG_FREQ_LIMIT = 10023, ///< 发消息的频率超限,请延长两次发消息时间的间隔。
  313 + ERR_SVR_GROUP_REQ_ALLREADY_BEEN_PROCESSED = 10024, ///< 此邀请或者申请请求已经被处理。
  314 + ERR_SVR_GROUP_GROUPID_IN_USED_FOR_SUPER = 10025, ///< 群组 ID 已被使用,并且操作者为群主,可以直接使用。
  315 + ERR_SVR_GROUP_SDKAPPID_DENY = 10026, ///< 该 SDKAppID 请求的命令字已被禁用,请 [提交工单](https://console.cloud.tencent.com/workorder/category?level1_id=29&level2_id=40&source=0&data_title=%E4%BA%91%E9%80%9A%E4%BF%A1%20%20IM&step=1) 联系客服。
  316 + ERR_SVR_GROUP_REVOKE_MSG_NOT_FOUND = 10030, ///< 请求撤回的消息不存在。
  317 + ERR_SVR_GROUP_REVOKE_MSG_TIME_LIMIT = 10031, ///< 消息撤回超过了时间限制(默认2分钟)。
  318 + ERR_SVR_GROUP_REVOKE_MSG_DENY = 10032, ///< 请求撤回的消息不支持撤回操作。
  319 + ERR_SVR_GROUP_NOT_ALLOW_REVOKE_MSG = 10033, ///< 群组类型不支持消息撤回操作。
  320 + ERR_SVR_GROUP_REMOVE_MSG_DENY = 10034, ///< 该消息类型不支持删除操作。
  321 + ERR_SVR_GROUP_NOT_ALLOW_REMOVE_MSG = 10035, ///< 音视频聊天室和在线成员广播大群不支持删除消息。
  322 + ERR_SVR_GROUP_AVCHATROOM_COUNT_LIMIT = 10036, ///< 音视频聊天室创建数量超过了限制,请参考 [价格说明](https://cloud.tencent.com/document/product/269/11673) 购买预付费套餐“IM音视频聊天室”。
  323 + ERR_SVR_GROUP_COUNT_LIMIT = 10037, ///< 单个用户可创建和加入的群组数量超过了限制,请参考 [价格说明](https://cloud.tencent.com/document/product/269/11673) 购买或升级预付费套餐“单人可创建与加入群组数”。
  324 + ERR_SVR_GROUP_MEMBER_COUNT_LIMIT = 10038, ///< 群成员数量超过限制,请参考 [价格说明](https://cloud.tencent.com/document/product/269/11673) 购买或升级预付费套餐“扩展群人数上限”。
  325 +
  326 + /////////////////////////////////////////////////////////////////////////////////
  327 + //
  328 + // (三)V3版本的错误码(待废弃)
  329 + //
  330 + /////////////////////////////////////////////////////////////////////////////////
  331 +
  332 + ERR_NO_SUCC_RESULT = 6003, ///< 批量操作无成功结果。
  333 + ERR_TO_USER_INVALID = 6011, ///< 无效接收方。
  334 + ERR_REQUEST_TIMEOUT = 6012, ///< 请求超时。
  335 + ERR_INIT_CORE_FAIL = 6018, ///< INIT CORE 模块失败。
  336 + ERR_EXPIRED_SESSION_NODE = 6020, ///< SessionNode 为 null 。
  337 + ERR_LOGGED_OUT_BEFORE_LOGIN_FINISHED = 6023, ///< 在登录完成前进行了登出(在登录时返回)。
  338 + ERR_TLSSDK_NOT_INITIALIZED = 6024, ///< TLS SDK 未初始化。
  339 + ERR_TLSSDK_USER_NOT_FOUND = 6025, ///< TLS SDK 没有找到相应的用户信息。
  340 + ERR_BIND_FAIL_UNKNOWN = 6100, ///< QALSDK 未知原因BIND失败。
  341 + ERR_BIND_FAIL_NO_SSOTICKET = 6101, ///< 缺少 SSO 票据。
  342 + ERR_BIND_FAIL_REPEATD_BIND = 6102, ///< 重复 BIND。
  343 + ERR_BIND_FAIL_TINYID_NULL = 6103, ///< TinyId 为空。
  344 + ERR_BIND_FAIL_GUID_NULL = 6104, ///< GUID 为空。
  345 + ERR_BIND_FAIL_UNPACK_REGPACK_FAILED = 6105, ///< 解注册包失败。
  346 + ERR_BIND_FAIL_REG_TIMEOUT = 6106, ///< 注册超时。
  347 + ERR_BIND_FAIL_ISBINDING = 6107, ///< 正在 BIND 操作中。
  348 + ERR_PACKET_FAIL_UNKNOWN = 6120, ///< 发包未知错误。
  349 + ERR_PACKET_FAIL_REQ_NO_NET = 6121, ///< 发送请求包时没有网络。
  350 + ERR_PACKET_FAIL_RESP_NO_NET = 6122, ///< 发送回复包时没有网络。
  351 + ERR_PACKET_FAIL_REQ_NO_AUTH = 6123, ///< 发送请求包时没有权限。
  352 + ERR_PACKET_FAIL_SSO_ERR = 6124, ///< SSO 错误。
  353 + ERR_PACKET_FAIL_REQ_TIMEOUT = 6125, ///< 请求超时。
  354 + ERR_PACKET_FAIL_RESP_TIMEOUT = 6126, ///< 回复超时。
  355 + ERR_PACKET_FAIL_REQ_ON_RESEND = 6127, ///< 重发失败。
  356 + ERR_PACKET_FAIL_RESP_NO_RESEND = 6128, ///< 重发时没有真正发送。
  357 + ERR_PACKET_FAIL_FLOW_SAVE_FILTERED = 6129, ///< 保存被过滤。
  358 + ERR_PACKET_FAIL_REQ_OVER_LOAD = 6130, ///< 发送过载。
  359 + ERR_PACKET_FAIL_LOGIC_ERR = 6131, ///< 数据逻辑错误。
  360 + ERR_FRIENDSHIP_PROXY_NOT_SYNCED = 6150, ///< proxy_manager 没有完成服务端数据同步。
  361 + ERR_FRIENDSHIP_PROXY_SYNCING = 6151, ///< proxy_manager 正在进行服务端数据同步。
  362 + ERR_FRIENDSHIP_PROXY_SYNCED_FAIL = 6152, ///< proxy_manager 同步失败。
  363 + ERR_FRIENDSHIP_PROXY_LOCAL_CHECK_ERR = 6153, ///< proxy_manager 请求参数,在本地检查不合法。
  364 + ERR_GROUP_INVALID_FIELD = 6160, ///< Group assistant 请求字段中包含非预设字段。
  365 + ERR_GROUP_STORAGE_DISABLED = 6161, ///< Group assistant 群资料本地存储没有开启。
  366 + ERR_LOADGRPINFO_FAILED = 6162, ///< 加载群资料失败。
  367 + ERR_REQ_NO_NET_ON_REQ = 6200, ///< 请求的时候没有网络。
  368 + ERR_REQ_NO_NET_ON_RSP = 6201, ///< 响应的时候没有网络。
  369 + ERR_SERIVCE_NOT_READY = 6205, ///< QALSDK 服务未就绪。
  370 + ERR_LOGIN_AUTH_FAILED = 6207, ///< 账号认证失败( TinyId 转换失败)。
  371 + ERR_NEVER_CONNECT_AFTER_LAUNCH = 6209, ///< 在应用启动后没有尝试联网。
  372 + ERR_REQ_FAILED = 6210, ///< QALSDK 执行失败。
  373 + ERR_REQ_INVALID_REQ = 6211, ///< 请求非法,toMsgService 非法。
  374 + ERR_REQ_OVERLOADED = 6212, ///< 请求队列满。
  375 + ERR_REQ_KICK_OFF = 6213, ///< 已经被其他终端踢了。
  376 + ERR_REQ_SERVICE_SUSPEND = 6214, ///< 服务被暂停。
  377 + ERR_REQ_INVALID_SIGN = 6215, ///< SSO 签名错误。
  378 + ERR_REQ_INVALID_COOKIE = 6216, ///< SSO cookie 无效。
  379 + ERR_LOGIN_TLS_RSP_PARSE_FAILED = 6217, ///< 登录时 TLS SDK 回包校验,包体长度错误。
  380 + ERR_LOGIN_OPENMSG_TIMEOUT = 6218, ///< 登录时 OPENSTATSVC 向 OPENMSG 上报状态超时。
  381 + ERR_LOGIN_OPENMSG_RSP_PARSE_FAILED = 6219, ///< 登录时 OPENSTATSVC 向 OPENMSG 上报状态时解析回包失败。
  382 + ERR_LOGIN_TLS_DECRYPT_FAILED = 6220, ///< 登录时 TLS SDK 解密失败。
  383 + ERR_WIFI_NEED_AUTH = 6221, ///< WIFI 需要认证。
  384 + ERR_USER_CANCELED = 6222, ///< 用户已取消。
  385 + ERR_REVOKE_TIME_LIMIT_EXCEED = 6223, ///< 消息撤回超过了时间限制(默认2分钟)。
  386 + ERR_LACK_UGC_EXT = 6224, ///< 缺少 UGC 扩展包。
  387 + ERR_AUTOLOGIN_NEED_USERSIG = 6226, ///< 自动登录,本地票据过期,需要 UserSig 手动登录。
  388 + ERR_QAL_NO_SHORT_CONN_AVAILABLE = 6300, ///< 没有可用的短连接 SSO 。
  389 + ERR_REQ_CONTENT_ATTACK = 80101, ///< 消息内容安全打击。
  390 + ERR_LOGIN_SIG_EXPIRE = 70101, ///< 登录返回,票据过期。
  391 + ERR_SDK_HAD_INITIALIZED = 90101, ///< IM SDK 已经初始化无需重复初始化。
  392 + ERR_OPENBDH_BASE = 115000, ///< OpenBDH 错误码基。
  393 + ERR_REQUEST_NO_NET_ONREQ = 6250, ///< 请求时没有网络,请等网络恢复后重试。
  394 + ERR_REQUEST_NO_NET_ONRSP = 6251, ///< 响应时没有网络,请等网络恢复后重试。
  395 + ERR_REQUEST_FAILED = 6252, ///< QALSDK 执行失败。
  396 + ERR_REQUEST_INVALID_REQ = 6253, ///< 请求非法,toMsgService 非法。
  397 + ERR_REQUEST_OVERLOADED = 6254, ///< 请求队列満。
  398 + ERR_REQUEST_KICK_OFF = 6255, ///< 已经被其他终端踢了。
  399 + ERR_REQUEST_SERVICE_SUSPEND = 6256, ///< 服务被暂停。
  400 + ERR_REQUEST_INVALID_SIGN = 6257, ///< SSO 签名错误。
  401 + ERR_REQUEST_INVALID_COOKIE = 6258, ///< SSO cookie 无效。
  402 +
  403 +};
  404 +
  405 +#endif /* TIMErrorCode_h */
  1 +//
  2 +// TIMFriendshipDefine.h
  3 +// imsdk
  4 +//
  5 +// Created by annidyfeng on 2019/3/7.
  6 +// Copyright © 2019年 Tencent. All rights reserved.
  7 +//
  8 +
  9 +#ifndef TIMFriendshipDefine_h
  10 +#define TIMFriendshipDefine_h
  11 +
  12 +#import "ImSDK.h"
  13 +
  14 +@class TIMFriendPendencyResponse;
  15 +@class TIMFriendPendencyItem;
  16 +@class TIMFriendFutureMeta;
  17 +@class TIMFriendGroup;
  18 +
  19 +#pragma mark - 枚举类型
  20 +
  21 +/**
  22 + * 好友操作状态
  23 + *
  24 + * 详细错误码参见 https://cloud.tencent.com/document/product/269/1671#.E5.85.B3.E7.B3.BB.E9.93.BE.E9.94.99.E8.AF.AF.E7.A0.81
  25 + */
  26 +typedef NS_ENUM(NSInteger, TIMFriendStatus) {
  27 + /**
  28 + * 操作成功
  29 + */
  30 + TIM_FRIEND_STATUS_SUCC = 0,
  31 +
  32 + /**
  33 + * 请求参数错误,请根据错误描述检查请求是否正确
  34 + */
  35 + TIM_FRIEND_PARAM_INVALID = 30001,
  36 +
  37 + /**
  38 + * 请求参数错误,SdkAppid 不匹配。
  39 + */
  40 + TIM_FRIEND_SDK_APPID_INVALID = 30002,
  41 +
  42 + /**
  43 + * 请求的用户帐号不存在
  44 + */
  45 + TIM_FRIEND_ID_INVALID = 30003,
  46 +
  47 + /**
  48 + * 请求需要 App 管理员权限
  49 + */
  50 + TIM_FRIEND_NEED_ADMIN_PERMISSON = 30004,
  51 +
  52 + /**
  53 + * 关系链字段中包含敏感词
  54 + */
  55 + TIM_FRIEND_DIRTY_WORD = 30005,
  56 +
  57 + /**
  58 + * 服务器内部错误,请重试
  59 + */
  60 + TIM_FRIEND_SERVER_ERROR = 30006,
  61 +
  62 + /**
  63 + * 网络超时,请稍后重试
  64 + */
  65 + TIM_FRIEND_TIMEOUT = 30007,
  66 +
  67 + /**
  68 + * 并发写导致写冲突,建议使用批量方式
  69 + */
  70 + TIM_FRIEND_WRITE_ERROR = 30008,
  71 +
  72 + /**
  73 + * 后台禁止该用户发起加好友请求
  74 + */
  75 + TIM_ADD_FRIEND_FORBIDEN = 30009,
  76 +
  77 + /**
  78 + * 自己的好友数已达系统上限
  79 + */
  80 + TIM_ADD_FRIEND_STATUS_SELF_FRIEND_FULL = 30010,
  81 +
  82 + /**
  83 + * 分组已达系统上限
  84 + */
  85 + TIM_UPDATE_FRIEND_GROUP_STATUS_MAX_GROUPS_EXCEED = 30011,
  86 +
  87 + /**
  88 + * 未决数已达系统上限。
  89 + */
  90 + TIM_PENDENCY_STATUS_FULL = 30012,
  91 +
  92 + /**
  93 + * 黑名单数已达系统上限
  94 + */
  95 + TIM_ADD_BLACKLIST_STATUS_FULL = 30013,
  96 +
  97 + /**
  98 + * 对方的好友数已达系统上限
  99 + */
  100 + TIM_ADD_FRIEND_STATUS_THEIR_FRIEND_FULL = 30014,
  101 +
  102 + /**
  103 + * 被加好友在自己的黑名单中
  104 + */
  105 + TIM_ADD_FRIEND_STATUS_IN_SELF_BLACK_LIST = 30515,
  106 +
  107 + /**
  108 + * 被加好友设置为禁止加好友
  109 + */
  110 + TIM_ADD_FRIEND_STATUS_FRIEND_SIDE_FORBID_ADD = 30516,
  111 +
  112 + /**
  113 + * 已被被添加好友设置为黑名单
  114 + */
  115 + TIM_ADD_FRIEND_STATUS_IN_OTHER_SIDE_BLACK_LIST = 30525,
  116 +
  117 + /**
  118 + * 等待好友审核同意
  119 + */
  120 + TIM_ADD_FRIEND_STATUS_PENDING = 30539,
  121 +
  122 + /**
  123 + * 添加好友请求被安全策略打击,请勿频繁发起添加好友请求
  124 + */
  125 + TIM_ADD_FRIEND_STATUS_SENSITIVE = 30540,
  126 +
  127 + /**
  128 + * 对方没有申请过好友
  129 + */
  130 + TIM_RESPONSE_FRIEND_STATUS_NO_REQ = 30614,
  131 +
  132 + /**
  133 + * 删除好友请求被安全策略打击,请勿频繁发起删除好友请求
  134 + */
  135 + TIM_DELETE_FRIEND_STATUS_SENSITIVE = 31707,
  136 +};
  137 +
  138 +typedef NS_ENUM(NSInteger, TIMDelFriendType) {
  139 + /**
  140 + * 删除单向好友
  141 + */
  142 + TIM_FRIEND_DEL_SINGLE = 1,
  143 +
  144 + /**
  145 + * 删除双向好友
  146 + */
  147 + TIM_FRIEND_DEL_BOTH = 2,
  148 +};
  149 +
  150 +typedef NS_ENUM(NSInteger, TIMPendencyType) {
  151 + /**
  152 + * 别人发给我的
  153 + */
  154 + TIM_PENDENCY_COME_IN = 1,
  155 +
  156 + /**
  157 + * 我发给别人的
  158 + */
  159 + TIM_PENDENCY_SEND_OUT = 2,
  160 +
  161 + /**
  162 + * 别人发给我的 和 我发给别人的。仅拉取时有效
  163 + */
  164 + TIM_PENDENCY_BOTH = 3,
  165 +};
  166 +
  167 +/**
  168 + * 推荐好友类型
  169 + */
  170 +typedef NS_ENUM(NSInteger, TIMFutureFriendType) {
  171 + /**
  172 + * 收到的未决请求
  173 + */
  174 + TIM_FUTURE_FRIEND_PENDENCY_IN_TYPE = 0x1,
  175 +
  176 + /**
  177 + * 发出去的未决请求
  178 + */
  179 + TIM_FUTURE_FRIEND_PENDENCY_OUT_TYPE = 0x2,
  180 +
  181 + /**
  182 + * 推荐好友
  183 + */
  184 + TIM_FUTURE_FRIEND_RECOMMEND_TYPE = 0x4,
  185 +
  186 + /**
  187 + * 已决好友
  188 + */
  189 + TIM_FUTURE_FRIEND_DECIDE_TYPE = 0x8,
  190 +};
  191 +
  192 +/**
  193 + * 翻页选项
  194 + */
  195 +typedef NS_ENUM(NSInteger, TIMPageDirectionType) {
  196 + /**
  197 + * 向上翻页
  198 + */
  199 + TIM_PAGE_DIRECTION_UP_TYPE = 1,
  200 +
  201 + /**
  202 + * 向下翻页
  203 + */
  204 + TIM_PAGE_DIRECTION_DOWN_TYPE = 2,
  205 +};
  206 +
  207 +/**
  208 + * 好友检查类型
  209 + */
  210 +typedef NS_ENUM(NSInteger,TIMFriendCheckType) {
  211 + /**
  212 + * 单向好友
  213 + */
  214 + TIM_FRIEND_CHECK_TYPE_UNIDIRECTION = 0x1,
  215 + /**
  216 + * 互为好友
  217 + */
  218 + TIM_FRIEND_CHECK_TYPE_BIDIRECTION = 0x2,
  219 +};
  220 +
  221 +/**
  222 + * 好友关系类型
  223 + */
  224 +typedef NS_ENUM(NSInteger,TIMFriendRelationType) {
  225 + /**
  226 + * 不是好友
  227 + */
  228 + TIM_FRIEND_RELATION_TYPE_NONE = 0x0,
  229 + /**
  230 + * 对方在我的好友列表中
  231 + */
  232 + TIM_FRIEND_RELATION_TYPE_MY_UNI = 0x1,
  233 + /**
  234 + * 我在对方的好友列表中
  235 + */
  236 + TIM_FRIEND_RELATION_TYPE_OTHER_UNI = 0x2,
  237 + /**
  238 + * 互为好友
  239 + */
  240 + TIM_FRIEND_RELATION_TYPE_BOTHWAY = 0x3,
  241 +};
  242 +
  243 +typedef NS_ENUM(NSInteger, TIMFriendResponseType) {
  244 + /**
  245 + * 同意加好友(建立单向好友)
  246 + */
  247 + TIM_FRIEND_RESPONSE_AGREE = 0,
  248 +
  249 + /**
  250 + * 同意加好友并加对方为好友(建立双向好友)
  251 + */
  252 + TIM_FRIEND_RESPONSE_AGREE_AND_ADD = 1,
  253 +
  254 + /**
  255 + * 拒绝对方好友请求
  256 + */
  257 + TIM_FRIEND_RESPONSE_REJECT = 2,
  258 +};
  259 +
  260 +/**
  261 + * 好友检查类型
  262 + */
  263 +typedef NS_ENUM(NSInteger,TIMFriendAddType) {
  264 + /**
  265 + * 单向好友
  266 + */
  267 + TIM_FRIEND_ADD_TYPE_SINGLE = 1,
  268 + /**
  269 + * 互为好友
  270 + */
  271 + TIM_FRIEND_ADD_TYPE_BOTH = 2,
  272 +};
  273 +#pragma mark - block回调
  274 +
  275 +/**
  276 + * 获取未决请求列表成功
  277 + *
  278 + * @param pendencyResponse 未决请求元信息
  279 + */
  280 +typedef void (^TIMGetFriendPendencyListSucc)(TIMFriendPendencyResponse *pendencyResponse);
  281 +
  282 +/**
  283 + * 群搜索回调
  284 + *
  285 + * @param totalNum 搜索结果的总数
  286 + * @param users 请求的用户列表片段
  287 + */
  288 +typedef void (^TIMUserSearchSucc)(uint64_t totalNum, NSArray * users);
  289 +
  290 +/**
  291 + * 好友分组列表
  292 + *
  293 + * @param groups 好友分组(TIMFriendGroup*)列表
  294 + */
  295 +typedef void (^TIMFriendGroupArraySucc)(NSArray<TIMFriendGroup *> * groups);
  296 +
  297 +/**
  298 + * 好友关系检查回调
  299 + *
  300 + * @param results TIMCheckFriendResult列表
  301 + */
  302 +typedef void (^TIMFriendCheckSucc)(NSArray* results);
  303 +
  304 +#pragma mark - 基本类型
  305 +
  306 +/**
  307 + * 加好友请求
  308 + */
  309 +@interface TIMFriendRequest : TIMCodingModel
  310 +
  311 +/**
  312 + * 用户identifier(必填)
  313 + */
  314 +@property (nonatomic,strong) NSString* identifier;
  315 +
  316 +/**
  317 + * 备注(备注最大96字节)
  318 + */
  319 +@property (nonatomic,strong) NSString* remark;
  320 +
  321 +/**
  322 + * 请求说明(最大120字节)
  323 + */
  324 +@property (nonatomic,strong) NSString* addWording;
  325 +
  326 +/**
  327 + * 添加来源
  328 + * 来源需要添加“AddSource_Type_”前缀
  329 + */
  330 +@property (nonatomic,strong) NSString* addSource;
  331 +
  332 +/**
  333 + * 分组
  334 + */
  335 +@property (nonatomic,strong) NSString* group;
  336 +
  337 +/**
  338 + * 加好友方式 (可选)
  339 + */
  340 +@property (nonatomic,assign) TIMFriendAddType addType;
  341 +
  342 +@end
  343 +
  344 +/**
  345 + * 未决请求
  346 + */
  347 +@interface TIMFriendPendencyItem : TIMCodingModel
  348 +
  349 +/**
  350 + * 用户标识
  351 + */
  352 +@property(nonatomic,strong) NSString* identifier;
  353 +/**
  354 + * 增加时间
  355 + */
  356 +@property(nonatomic,assign) uint64_t addTime;
  357 +/**
  358 + * 来源
  359 + */
  360 +@property(nonatomic,strong) NSString* addSource;
  361 +/**
  362 + * 加好友附言
  363 + */
  364 +@property(nonatomic,strong) NSString* addWording;
  365 +
  366 +/**
  367 + * 加好友昵称
  368 + */
  369 +@property(nonatomic,strong) NSString* nickname;
  370 +
  371 +/**
  372 + * 未决请求类型
  373 + */
  374 +@property(nonatomic,assign) TIMPendencyType type;
  375 +
  376 +@end
  377 +
  378 +/**
  379 + * 未决推送
  380 + */
  381 +@interface TIMFriendPendencyInfo : TIMCodingModel
  382 +/**
  383 + * 用户标识
  384 + */
  385 +@property(nonatomic,strong) NSString* identifier;
  386 +/**
  387 + * 来源
  388 + */
  389 +@property(nonatomic,strong) NSString* addSource;
  390 +/**
  391 + * 加好友附言
  392 + */
  393 +@property(nonatomic,strong) NSString* addWording;
  394 +
  395 +/**
  396 + * 加好友昵称
  397 + */
  398 +@property(nonatomic,strong) NSString* nickname;
  399 +@end
  400 +
  401 +/**
  402 + * 未决请求信息
  403 + */
  404 +@interface TIMFriendPendencyRequest : TIMCodingModel
  405 +
  406 +/**
  407 + * 序列号,未决列表序列号
  408 + * 建议客户端保存seq和未决列表,请求时填入server返回的seq
  409 + * 如果seq是server最新的,则不返回数据
  410 + */
  411 +@property(nonatomic,assign) uint64_t seq;
  412 +
  413 +/**
  414 + * 翻页时间戳,只用来翻页,server返回0时表示没有更多数据,第一次请求填0
  415 + * 特别注意的是,如果server返回的seq跟填入的seq不同,翻页过程中,需要使用客户端原始seq请求,直到数据请求完毕,才能更新本地seq
  416 + */
  417 +@property(nonatomic,assign) uint64_t timestamp;
  418 +
  419 +/**
  420 + * 每页的数量,即本次请求最多返回多个数据,建议最大不超过 100,设置太大一次请求回包的时间会过长
  421 + */
  422 +@property(nonatomic,assign) uint64_t numPerPage;
  423 +
  424 +/**
  425 + * 未决请求拉取类型
  426 + */
  427 +@property(nonatomic,assign) TIMPendencyType type;
  428 +
  429 +@end
  430 +
  431 +/**
  432 + * 未决返回信息
  433 + */
  434 +@interface TIMFriendPendencyResponse : TIMCodingModel
  435 +
  436 +/**
  437 + * 本次请求的未决列表序列号
  438 + */
  439 +@property(nonatomic,assign) uint64_t seq;
  440 +
  441 +/**
  442 + * 本次请求的翻页时间戳
  443 + */
  444 +@property(nonatomic,assign) uint64_t timestamp;
  445 +
  446 +/**
  447 + * 未决请求未读数量
  448 + */
  449 +@property(nonatomic,assign) uint64_t unreadCnt;
  450 +
  451 +/**
  452 + * 未决数据
  453 + */
  454 +@property NSArray<TIMFriendPendencyItem *> * pendencies;
  455 +
  456 +@end
  457 +
  458 +/**
  459 + * 好友分组信息
  460 + */
  461 +@interface TIMFriendGroup : TIMCodingModel
  462 +/**
  463 + * 好友分组名称
  464 + */
  465 +@property(nonatomic,strong) NSString* name;
  466 +
  467 +/**
  468 + * 分组成员数量
  469 + */
  470 +@property(nonatomic,assign) uint64_t userCnt;
  471 +
  472 +/**
  473 + * 分组成员identifier列表
  474 + */
  475 +@property(nonatomic,strong) NSArray* friends;
  476 +
  477 +@end
  478 +
  479 +/**
  480 + * 好友关系检查
  481 + */
  482 +@interface TIMFriendCheckInfo : NSObject
  483 +/**
  484 + * 检查用户的id列表(NSString*)
  485 + */
  486 +@property(nonatomic,strong) NSArray* users;
  487 +
  488 +/**
  489 + * 检查类型
  490 + */
  491 +@property(nonatomic,assign) TIMFriendCheckType checkType;
  492 +
  493 +@end
  494 +
  495 +@interface TIMCheckFriendResult : NSObject
  496 +/**
  497 + * 用户id
  498 + */
  499 +@property NSString* identifier;
  500 +
  501 +/**
  502 + * 返回码
  503 + */
  504 +@property NSInteger result_code;
  505 +
  506 +/**
  507 + * 返回信息
  508 + */
  509 +@property NSString *result_info;
  510 +
  511 +/**
  512 + * 检查结果
  513 + */
  514 +@property(nonatomic,assign) TIMFriendRelationType resultType;
  515 +
  516 +@end
  517 +
  518 +@interface TIMFriendResult : NSObject
  519 +
  520 +/**
  521 + * 用户Id
  522 + */
  523 +@property NSString* identifier;
  524 +
  525 +/**
  526 + * 返回码
  527 + */
  528 +@property NSInteger result_code;
  529 +
  530 +/**
  531 + * 返回信息
  532 + */
  533 +@property NSString *result_info;
  534 +
  535 +@end
  536 +
  537 +/**
  538 + * 响应好友请求
  539 + */
  540 +@interface TIMFriendResponse : NSObject
  541 +
  542 +/**
  543 + * 响应类型
  544 + */
  545 +@property(nonatomic,assign) TIMFriendResponseType responseType;
  546 +
  547 +/**
  548 + * 用户identifier
  549 + */
  550 +@property(nonatomic,strong) NSString* identifier;
  551 +
  552 +/**
  553 + * 备注好友(可选,如果要加对方为好友)。备注最大96字节
  554 + */
  555 +@property(nonatomic,strong) NSString* remark;
  556 +
  557 +@end
  558 +
  559 +
  560 +/**
  561 + * 好友分组信息扩展
  562 + */
  563 +@interface TIMFriendGroupWithProfiles : TIMFriendGroup
  564 +/**
  565 + * 好友资料(TIMUserProfile*)列表
  566 + */
  567 +@property(nonatomic,strong) NSArray* profiles;
  568 +@end
  569 +
  570 +// 用户资料KEY
  571 +
  572 +/**
  573 + * 昵称
  574 + * 值类型: NSString
  575 + */
  576 +extern NSString *const TIMProfileTypeKey_Nick;
  577 +/**
  578 + * 头像
  579 + * 值类型: NSString
  580 + */
  581 +extern NSString *const TIMProfileTypeKey_FaceUrl;
  582 +/**
  583 + * 好友申请
  584 + * 值类型: NSNumber [TIM_FRIEND_ALLOW_ANY,TIM_FRIEND_NEED_CONFIRM,TIM_FRIEND_DENY_ANY]
  585 + */
  586 +extern NSString *const TIMProfileTypeKey_AllowType;
  587 +/**
  588 + * 性别
  589 + * 值类型: NSNumber [TIM_GENDER_UNKNOWN,TIM_GENDER_MALE,TIM_GENDER_FEMALE]
  590 + */
  591 +extern NSString *const TIMProfileTypeKey_Gender;
  592 +/**
  593 + * 生日
  594 + * 值类型: NSNumber
  595 + */
  596 +extern NSString *const TIMProfileTypeKey_Birthday;
  597 +/**
  598 + * 位置
  599 + * 值类型: NSString
  600 + */
  601 +extern NSString *const TIMProfileTypeKey_Location;
  602 +/**
  603 + * 语言
  604 + * 值类型: NSNumber
  605 + */
  606 +extern NSString *const TIMProfileTypeKey_Language;
  607 +/**
  608 + * 等级
  609 + * 值类型: NSNumber
  610 + */
  611 +extern NSString *const TIMProfileTypeKey_Level;
  612 +/**
  613 + * 角色
  614 + * 值类型: NSNumber
  615 + */
  616 +extern NSString *const TIMProfileTypeKey_Role;
  617 +/**
  618 + * 签名
  619 + * 值类型: NSString
  620 + */
  621 +extern NSString *const TIMProfileTypeKey_SelfSignature;
  622 +/**
  623 + * 自定义字段前缀
  624 + * 值类型: [NSString,NSData|NSNumber]
  625 + * @note 当设置自定义字的值NSString对象时,后台会将其转为UTF8保存在数据库中。由于部分用户迁移资料时可能不是UTF8类型,所以在获取资料时,统一返回NSData类型。
  626 + */
  627 +extern NSString *const TIMProfileTypeKey_Custom_Prefix;
  628 +
  629 +// 好友资料KEY
  630 +
  631 +/**
  632 + * 备注
  633 + * 值类型: NSString
  634 + */
  635 +extern NSString *const TIMFriendTypeKey_Remark;
  636 +/**
  637 + * 分组
  638 + * 值类型: [NSArray]
  639 + */
  640 +extern NSString *const TIMFriendTypeKey_Group;
  641 +/**
  642 + * 自定义字段前缀
  643 + * 值类型: [NSString,NSData|NSNumber]
  644 + */
  645 +extern NSString *const TIMFriendTypeKey_Custom_Prefix;
  646 +#endif /* TIMFriendshipDefine_h */
  647 +
  1 +//
  2 +// TIMFriendshipManager.h
  3 +// imsdk
  4 +//
  5 +// Created by annidyfeng on 2019/3/7.
  6 +// Copyright © 2019年 Tencent. All rights reserved.
  7 +//
  8 +
  9 +#ifndef TIMFriendshipManager_h
  10 +#define TIMFriendshipManager_h
  11 +
  12 +#import "TIMComm.h"
  13 +#import "TIMFriendshipDefine.h"
  14 +
  15 +@interface TIMFriendshipManager : NSObject
  16 +/**
  17 + * 获取好友管理器实例
  18 + *
  19 + * @return 管理器实例
  20 + */
  21 ++ (TIMFriendshipManager*)sharedInstance;
  22 +
  23 +/**
  24 + * 设置自己的资料
  25 + *
  26 + * @param values 需要更新的属性,可一次更新多个字段. 参见 TIMFriendshipDefine.h 的 TIMProfileTypeKey_XXX
  27 + * @param succ 成功回调
  28 + * @param fail 失败回调
  29 + *
  30 + * @return 0 发送请求成功
  31 + */
  32 +- (int)modifySelfProfile:(NSDictionary<NSString *, id> *)values succ:(TIMSucc)succ fail:(TIMFail)fail;
  33 +
  34 +/**
  35 + * 获取自己的资料
  36 + *
  37 + * @param succ 成功回调,返回 TIMUserProfile
  38 + * @param fail 失败回调
  39 + *
  40 + * @return 0 发送请求成功
  41 + */
  42 +- (int)getSelfProfile:(TIMGetProfileSucc)succ fail:(TIMFail)fail;
  43 +
  44 +/**
  45 + * 在缓存中查询自己的资料
  46 + *
  47 + * @return 返回缓存的资料,未找到返回nil
  48 + */
  49 +- (TIMUserProfile *)querySelfProfile;
  50 +
  51 +/**
  52 + * 获取指定用户资料
  53 + *
  54 + * @param identifiers 用户id,非好友的用户也可以
  55 + * @prarm forceUpdate 强制从后台拉取
  56 + * @param succ 成功回调
  57 + * @param fail 失败回调
  58 + *
  59 + * @return 0 发送请求成功
  60 + */
  61 +- (int)getUsersProfile:(NSArray<NSString *> *)identifiers forceUpdate:(BOOL)forceUpdate succ:(TIMUserProfileArraySucc)succ fail:(TIMFail)fail;
  62 +
  63 +/**
  64 + * 在缓存中查询用户的资料
  65 + *
  66 + * @praram identifier 用户id,非好友的用户也可以
  67 + *
  68 + * @return 返回缓存的资料,未找到返回nil
  69 + */
  70 +- (TIMUserProfile *)queryUserProfile:(NSString *)identifier;
  71 +
  72 +/**
  73 + * 获取好友列表
  74 + *
  75 + * @param succ 成功回调,返回好友(TIMFriend)列表
  76 + * @param fail 失败回调
  77 + *
  78 + * @return 0 发送请求成功
  79 + */
  80 +-(int)getFriendList:(TIMFriendArraySucc)succ fail:(TIMFail)fail;
  81 +
  82 +
  83 +/**
  84 + * 在缓存中查询用户的关系链数据
  85 + *
  86 + * @praram identifier 用户id
  87 + *
  88 + * @return 返回缓存的关系链数据,未找到返回nil
  89 + * @note 缓存数据来自于上一次调用getFriendList,请确保已调用了获取好友列表方法
  90 + */
  91 +- (TIMFriend *)queryFriend:(NSString *)identifier;
  92 +
  93 +/**
  94 + * 获取缓存中的关系链列表
  95 + *
  96 + * @return 返回缓存的关系链数据
  97 + * @note 缓存数据来自于上一次调用getFriendList,请确保已调用了获取好友列表方法
  98 + */
  99 +- (NSArray<TIMFriend *> *)queryFriendList;
  100 +
  101 +/**
  102 + * 检查指定用户的好友关系
  103 + *
  104 + * @param checkInfo 好友检查信息
  105 + * @param succ 成功回调,返回检查结果
  106 + * @param fail 失败回调
  107 + *
  108 + * @return 0 发送成功
  109 + */
  110 +- (int)checkFriends:(TIMFriendCheckInfo *)checkInfo succ:(TIMCheckFriendResultArraySucc)succ fail:(TIMFail)fail;
  111 +
  112 +/**
  113 + * 添加好友
  114 + *
  115 + * @param request 添加好友请求
  116 + * @param succ 成功回调(TIMFriendResult)
  117 + * @param fail 失败回调
  118 + *
  119 + * @return 0 发送请求成功
  120 + */
  121 +- (int)addFriend:(TIMFriendRequest *)request succ:(TIMFriendResultSucc)succ fail:(TIMFail)fail;
  122 +
  123 +/**
  124 + * 响应对方好友邀请
  125 + *
  126 + * @param response 响应请求
  127 + * @param succ 成功回调
  128 + * @param fail 失败回调
  129 + *
  130 + * @return 0 发送请求成功
  131 + */
  132 +- (int)doResponse:(TIMFriendResponse *)response succ:(TIMFriendResultSucc)succ fail:(TIMFail)fail;
  133 +
  134 +/**
  135 + * 删除好友
  136 + *
  137 + * @param identifiers 好友id
  138 + * @param delType 删除类型(单向好友、双向好友)
  139 + * @param succ 成功回调([TIMFriendResult])
  140 + * @param fail 失败回调
  141 + *
  142 + * @return 0 发送请求成功
  143 + */
  144 +- (int)deleteFriends:(NSArray *)identifiers delType:(TIMDelFriendType)delType succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail;
  145 +
  146 +/**
  147 + * 修改好友
  148 + *
  149 + * @param identifier 好友id
  150 + * @param values 需要更新的属性,可一次更新多个字段. 参见 TIMFriendshipDefine.h 的 TIMFriendTypeKey_XXX
  151 + * @param succ 成功回调
  152 + * @param fail 失败回调
  153 + *
  154 + * @return 0 发送请求成功
  155 + */
  156 +- (int)modifyFriend:(NSString *)identifier values:(NSDictionary<NSString *, id> *)values succ:(TIMSucc)succ fail:(TIMFail)fail;
  157 +
  158 +/**
  159 + * 获取未决列表
  160 + *
  161 + * @param pendencyRequest 请求信息,详细参考TIMFriendPendencyRequest
  162 + * @param succ 成功回调
  163 + * @param fail 失败回调
  164 + *
  165 + * @return 0 发送请求成功
  166 + */
  167 +- (int)getPendencyList:(TIMFriendPendencyRequest *)pendencyRequest succ:(TIMGetFriendPendencyListSucc)succ fail:(TIMFail)fail;
  168 +
  169 +/**
  170 + * 未决删除
  171 + *
  172 + * @param type 未决好友类型
  173 + * @param identifiers 要删除的未决列表
  174 + * @param succ 成功回调
  175 + * @param fail 失败回调
  176 + *
  177 + * @return 0 发送请求成功
  178 + */
  179 +- (int)deletePendency:(TIMPendencyType)type users:(NSArray *)identifiers succ:(TIMSucc)succ fail:(TIMFail)fail;
  180 +
  181 +/**
  182 + * 未决已读上报
  183 + *
  184 + * @param timestamp 已读时间戳,此时间戳以前的消息都将置为已读
  185 + * @param succ 成功回调
  186 + * @param fail 失败回调
  187 + *
  188 + * @return 0 发送请求成功
  189 + */
  190 +- (int)pendencyReport:(uint64_t)timestamp succ:(TIMSucc)succ fail:(TIMFail)fail;
  191 +
  192 +/**
  193 + * 获取黑名单列表
  194 + *
  195 + * @param succ 成功回调,返回NSString*列表
  196 + * @param fail 失败回调
  197 + *
  198 + * @return 0 发送请求成功
  199 + */
  200 +- (int)getBlackList:(TIMFriendArraySucc)succ fail:(TIMFail)fail;
  201 +
  202 +/**
  203 + * 添加用户到黑名单
  204 + *
  205 + * @param identifiers 用户列表
  206 + * @param succ 成功回调
  207 + * @param fail 失败回调
  208 + *
  209 + * @return 0 发送请求成功
  210 + */
  211 +- (int)addBlackList:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail;
  212 +
  213 +/**
  214 + * 把用户从黑名单中删除
  215 + *
  216 + * @param identifiers 用户列表
  217 + * @param succ 成功回调
  218 + * @param fail 失败回调
  219 + *
  220 + * @return 0 发送请求成功
  221 + */
  222 +- (int)deleteBlackList:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail;
  223 +
  224 +/**
  225 + * 新建好友分组
  226 + *
  227 + * @param groupNames 分组名称列表,必须是当前不存在的分组
  228 + * @param identifiers 要添加到分组中的好友
  229 + * @param succ 成功回调
  230 + * @param fail 失败回调
  231 + *
  232 + * @return 0 发送请求成功
  233 + */
  234 +- (int)createFriendGroup:(NSArray *)groupNames users:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail;
  235 +
  236 +/**
  237 + * 获取指定的好友分组信息
  238 + *
  239 + * @param groupNames 要获取信息的好友分组名称列表,传入nil获得所有分组信息
  240 + * @param succ 成功回调,返回 TIMFriendGroup* 列表
  241 + * @param fail 失败回调
  242 + *
  243 + * @return 0 发送请求成功
  244 + */
  245 +- (int)getFriendGroups:(NSArray *)groupNames succ:(TIMFriendGroupArraySucc)succ fail:(TIMFail)fail;
  246 +
  247 +/**
  248 + * 删除好友分组
  249 + *
  250 + * @param groupNames 要删除的好友分组名称列表
  251 + * @param succ 成功回调
  252 + * @param fail 失败回调
  253 + *
  254 + * @return 0 发送请求成功
  255 + */
  256 +- (int)deleteFriendGroup:(NSArray *)groupNames succ:(TIMSucc)succ fail:(TIMFail)fail;
  257 +
  258 +/**
  259 + * 修改好友分组的名称
  260 + *
  261 + * @param oldName 原来的分组名称
  262 + * @param newName 新的分组名称
  263 + * @param succ 成功回调
  264 + * @param fail 失败回调
  265 + *
  266 + * @return 0 发送请求成功
  267 + */
  268 +- (int)renameFriendGroup:(NSString*)oldName newName:(NSString*)newName succ:(TIMSucc)succ fail:(TIMFail)fail;
  269 +
  270 +/**
  271 + * 添加好友到一个好友分组
  272 + *
  273 + * @param groupName 好友分组名称
  274 + * @param identifiers 要添加到分组中的好友
  275 + * @param succ 成功回调
  276 + * @param fail 失败回调
  277 + *
  278 + * @return 0 发送请求成功
  279 + */
  280 +- (int)addFriendsToFriendGroup:(NSString *)groupName users:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail;
  281 +
  282 +/**
  283 + * 从好友分组中删除好友
  284 + *
  285 + * @param groupName 好友分组名称
  286 + * @param identifiers 要移出分组的好友
  287 + * @param succ 成功回调
  288 + * @param fail 失败回调
  289 + *
  290 + * @return 0 发送请求成功
  291 + */
  292 +- (int)deleteFriendsFromFriendGroup:(NSString *)groupName users:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail;
  293 +@end
  294 +
  295 +#endif /* TIMFriendshipManager_h */