Showing
22 changed files
with
924 additions
and
2170 deletions
Too many changes to show.
To preserve performance only 22 of 22+ files are displayed.
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | #ifndef ImSDK_h | 9 | #ifndef ImSDK_h |
| 10 | #define ImSDK_h | 10 | #define ImSDK_h |
| 11 | 11 | ||
| 12 | +#import "ImSDK.h" | ||
| 12 | #import "TIMConversation+MsgExt.h" | 13 | #import "TIMConversation+MsgExt.h" |
| 13 | #import "TIMMessage+MsgExt.h" | 14 | #import "TIMMessage+MsgExt.h" |
| 14 | #import "TIMComm+MsgExt.h" | 15 | #import "TIMComm+MsgExt.h" |
| @@ -15,10 +15,8 @@ | @@ -15,10 +15,8 @@ | ||
| 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 | -#import "IMSdkComm.h" | ||
| 20 | -#import "TIMErrorCode.h" | ||
| 21 | -#import "IMGroupExt.h" | ||
| 22 | -#import "IMMessageExt.h" | 18 | +//#import "TIMFriendshipManager.h" |
| 19 | + | ||
| 20 | +//#import "IMSdkInt.h" | ||
| 23 | 21 | ||
| 24 | #endif | 22 | #endif |
| @@ -14,8 +14,6 @@ | @@ -14,8 +14,6 @@ | ||
| 14 | @class TIMMessage; | 14 | @class TIMMessage; |
| 15 | @class TIMGroupTipsElem; | 15 | @class TIMGroupTipsElem; |
| 16 | @class TIMGroupInfo; | 16 | @class TIMGroupInfo; |
| 17 | -@class TIMSNSChangeInfo; | ||
| 18 | -@class TIMFriendPendencyInfo; | ||
| 19 | 17 | ||
| 20 | /** | 18 | /** |
| 21 | * 连接通知回调 | 19 | * 连接通知回调 |
| @@ -169,40 +167,90 @@ | @@ -169,40 +167,90 @@ | ||
| 169 | - (void)onGroupTipsEvent:(TIMGroupTipsElem*)elem; | 167 | - (void)onGroupTipsEvent:(TIMGroupTipsElem*)elem; |
| 170 | @end | 168 | @end |
| 171 | 169 | ||
| 172 | -/** | ||
| 173 | - * 好友代理事件回调 | ||
| 174 | - */ | ||
| 175 | -@protocol TIMFriendshipListener <NSObject> | ||
| 176 | -@optional | ||
| 177 | - | ||
| 178 | -/** | ||
| 179 | - * 添加好友通知 | ||
| 180 | - * | ||
| 181 | - * @param users 好友列表(NSString*) | ||
| 182 | - */ | ||
| 183 | -- (void)onAddFriends:(NSArray*)users; | ||
| 184 | - | ||
| 185 | -/** | ||
| 186 | - * 删除好友通知 | ||
| 187 | - * | ||
| 188 | - * @param identifiers 用户id列表(NSString*) | ||
| 189 | - */ | ||
| 190 | -- (void)onDelFriends:(NSArray*)identifiers; | ||
| 191 | - | ||
| 192 | -/** | ||
| 193 | - * 好友资料更新通知 | ||
| 194 | - * | ||
| 195 | - * @param profiles 资料列表(TIMSNSChangeInfo *) | ||
| 196 | - */ | ||
| 197 | -- (void)onFriendProfileUpdate:(NSArray<TIMSNSChangeInfo *> *)profiles; | ||
| 198 | - | ||
| 199 | -/** | ||
| 200 | - * 好友申请通知 | ||
| 201 | - * | ||
| 202 | - * @param reqs 好友申请者id列表(TIMFriendPendencyInfo *) | ||
| 203 | - */ | ||
| 204 | -- (void)onAddFriendReqs:(NSArray<TIMFriendPendencyInfo *> *)reqs; | 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 | ||
| 205 | 205 | ||
| 206 | -@end | 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 | ||
| 207 | 255 | ||
| 208 | #endif | 256 | #endif |
| @@ -9,7 +9,7 @@ | @@ -9,7 +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 "TIMComm.h" | 12 | +#import "ImSDK.h" |
| 13 | 13 | ||
| 14 | @class TIMGroupPendencyMeta; | 14 | @class TIMGroupPendencyMeta; |
| 15 | 15 | ||
| @@ -221,14 +221,14 @@ typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleResult) { | @@ -221,14 +221,14 @@ typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleResult) { | ||
| 221 | /** | 221 | /** |
| 222 | * 群成员列表回调 | 222 | * 群成员列表回调 |
| 223 | * | 223 | * |
| 224 | - * @param members 群成员列表,成员类型 TIMGroupMemberInfo | 224 | + * @param members 群成员列表 |
| 225 | */ | 225 | */ |
| 226 | typedef void (^TIMGroupMemberSucc)(NSArray * members); | 226 | typedef void (^TIMGroupMemberSucc)(NSArray * members); |
| 227 | 227 | ||
| 228 | /** | 228 | /** |
| 229 | * 群列表回调 | 229 | * 群列表回调 |
| 230 | * | 230 | * |
| 231 | - * @param arr 群列表,成员类型 TIMGroupInfo | 231 | + * @param arr 群列表 |
| 232 | */ | 232 | */ |
| 233 | typedef void (^TIMGroupListSucc)(NSArray * arr); | 233 | typedef void (^TIMGroupListSucc)(NSArray * arr); |
| 234 | 234 |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | #define TIMComm_MsgExt_h | 10 | #define TIMComm_MsgExt_h |
| 11 | 11 | ||
| 12 | #import <Foundation/Foundation.h> | 12 | #import <Foundation/Foundation.h> |
| 13 | -#import "TIMComm.h" | 13 | +#import "ImSDK.h" |
| 14 | 14 | ||
| 15 | @class TIMSendToUsersDetailInfo; | 15 | @class TIMSendToUsersDetailInfo; |
| 16 | 16 |
| @@ -21,18 +21,16 @@ | @@ -21,18 +21,16 @@ | ||
| 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; | ||
| 32 | @class TIMGroupInfoOption; | 31 | @class TIMGroupInfoOption; |
| 33 | @class TIMGroupMemberInfoOption; | 32 | @class TIMGroupMemberInfoOption; |
| 34 | @class TIMFriendProfileOption; | 33 | @class TIMFriendProfileOption; |
| 35 | -@class TIMFriendResult; | ||
| 36 | 34 | ||
| 37 | #pragma mark - 枚举类型 | 35 | #pragma mark - 枚举类型 |
| 38 | 36 | ||
| @@ -55,25 +53,10 @@ typedef NS_ENUM(NSInteger, TIMNetworkStatus) { | @@ -55,25 +53,10 @@ typedef NS_ENUM(NSInteger, TIMNetworkStatus) { | ||
| 55 | * 日志级别 | 53 | * 日志级别 |
| 56 | */ | 54 | */ |
| 57 | typedef NS_ENUM(NSInteger, TIMLogLevel) { | 55 | typedef NS_ENUM(NSInteger, TIMLogLevel) { |
| 58 | - /** | ||
| 59 | - * 不输出任何 sdk log | ||
| 60 | - */ | ||
| 61 | TIM_LOG_NONE = 0, | 56 | TIM_LOG_NONE = 0, |
| 62 | - /** | ||
| 63 | - * 输出 DEBUG,INFO,WARNING,ERROR 级别的 log | ||
| 64 | - */ | ||
| 65 | TIM_LOG_DEBUG = 3, | 57 | TIM_LOG_DEBUG = 3, |
| 66 | - /** | ||
| 67 | - * 输出 INFO,WARNING,ERROR 级别的 log | ||
| 68 | - */ | ||
| 69 | TIM_LOG_INFO = 4, | 58 | TIM_LOG_INFO = 4, |
| 70 | - /** | ||
| 71 | - * 输出 WARNING,ERROR 级别的 log | ||
| 72 | - */ | ||
| 73 | TIM_LOG_WARN = 5, | 59 | TIM_LOG_WARN = 5, |
| 74 | - /** | ||
| 75 | - * 输出 ERROR 级别的 log | ||
| 76 | - */ | ||
| 77 | TIM_LOG_ERROR = 6, | 60 | TIM_LOG_ERROR = 6, |
| 78 | }; | 61 | }; |
| 79 | 62 | ||
| @@ -192,19 +175,19 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_TYPE){ | @@ -192,19 +175,19 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_TYPE){ | ||
| 192 | */ | 175 | */ |
| 193 | typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ | 176 | typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ |
| 194 | /** | 177 | /** |
| 195 | - * JPG 格式 | 178 | + * JPG格式 |
| 196 | */ | 179 | */ |
| 197 | TIM_IMAGE_FORMAT_JPG = 0x1, | 180 | TIM_IMAGE_FORMAT_JPG = 0x1, |
| 198 | /** | 181 | /** |
| 199 | - * GIF 格式 | 182 | + * GIF格式 |
| 200 | */ | 183 | */ |
| 201 | TIM_IMAGE_FORMAT_GIF = 0x2, | 184 | TIM_IMAGE_FORMAT_GIF = 0x2, |
| 202 | /** | 185 | /** |
| 203 | - * PNG 格式 | 186 | + * PNG格式 |
| 204 | */ | 187 | */ |
| 205 | TIM_IMAGE_FORMAT_PNG = 0x3, | 188 | TIM_IMAGE_FORMAT_PNG = 0x3, |
| 206 | /** | 189 | /** |
| 207 | - * BMP 格式 | 190 | + * BMP格式 |
| 208 | */ | 191 | */ |
| 209 | TIM_IMAGE_FORMAT_BMP = 0x4, | 192 | TIM_IMAGE_FORMAT_BMP = 0x4, |
| 210 | /** | 193 | /** |
| @@ -213,9 +196,6 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ | @@ -213,9 +196,6 @@ typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ | ||
| 213 | TIM_IMAGE_FORMAT_UNKNOWN = 0xff, | 196 | TIM_IMAGE_FORMAT_UNKNOWN = 0xff, |
| 214 | }; | 197 | }; |
| 215 | 198 | ||
| 216 | -/** | ||
| 217 | - * 登录状态 | ||
| 218 | - */ | ||
| 219 | typedef NS_ENUM(NSInteger, TIMLoginStatus) { | 199 | typedef NS_ENUM(NSInteger, TIMLoginStatus) { |
| 220 | /** | 200 | /** |
| 221 | * 已登陆 | 201 | * 已登陆 |
| @@ -233,9 +213,6 @@ typedef NS_ENUM(NSInteger, TIMLoginStatus) { | @@ -233,9 +213,6 @@ typedef NS_ENUM(NSInteger, TIMLoginStatus) { | ||
| 233 | TIM_STATUS_LOGOUT = 3, | 213 | TIM_STATUS_LOGOUT = 3, |
| 234 | }; | 214 | }; |
| 235 | 215 | ||
| 236 | -/** | ||
| 237 | - * 群组成员是否可见 | ||
| 238 | - */ | ||
| 239 | typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { | 216 | typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { |
| 240 | /** | 217 | /** |
| 241 | * 未知 | 218 | * 未知 |
| @@ -251,9 +228,6 @@ typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { | @@ -251,9 +228,6 @@ typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { | ||
| 251 | TIM_GROUP_MEMBER_VISIBLE_YES = 0x02, | 228 | TIM_GROUP_MEMBER_VISIBLE_YES = 0x02, |
| 252 | }; | 229 | }; |
| 253 | 230 | ||
| 254 | -/** | ||
| 255 | - * 群组是否能被搜到 | ||
| 256 | - */ | ||
| 257 | typedef NS_ENUM(NSInteger, TIMGroupSearchableType) { | 231 | typedef NS_ENUM(NSInteger, TIMGroupSearchableType) { |
| 258 | /** | 232 | /** |
| 259 | * 未知 | 233 | * 未知 |
| @@ -328,13 +302,13 @@ typedef NS_ENUM(NSInteger, TIMGroupReceiveMessageOpt) { | @@ -328,13 +302,13 @@ typedef NS_ENUM(NSInteger, TIMGroupReceiveMessageOpt) { | ||
| 328 | */ | 302 | */ |
| 329 | TIM_GROUP_NOT_RECEIVE_MESSAGE = 1, | 303 | TIM_GROUP_NOT_RECEIVE_MESSAGE = 1, |
| 330 | /** | 304 | /** |
| 331 | - * 接受消息,不进行 iOS APNs 推送 | 305 | + * 接受消息,不进行iOS APNs 推送 |
| 332 | */ | 306 | */ |
| 333 | TIM_GROUP_RECEIVE_NOT_NOTIFY_MESSAGE = 2, | 307 | TIM_GROUP_RECEIVE_NOT_NOTIFY_MESSAGE = 2, |
| 334 | }; | 308 | }; |
| 335 | 309 | ||
| 336 | /** | 310 | /** |
| 337 | - * 群 Tips 类型 | 311 | + * 群Tips类型 |
| 338 | */ | 312 | */ |
| 339 | typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ | 313 | typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ |
| 340 | /** | 314 | /** |
| @@ -368,7 +342,7 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ | @@ -368,7 +342,7 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ | ||
| 368 | }; | 342 | }; |
| 369 | 343 | ||
| 370 | /** | 344 | /** |
| 371 | - * 群变更信息 Tips 类型 | 345 | + * 群Tips类型 |
| 372 | */ | 346 | */ |
| 373 | typedef NS_ENUM(NSInteger, TIM_GROUP_INFO_CHANGE_TYPE){ | 347 | typedef NS_ENUM(NSInteger, TIM_GROUP_INFO_CHANGE_TYPE){ |
| 374 | /** | 348 | /** |
| @@ -459,9 +433,6 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_SYSTEM_TYPE){ | @@ -459,9 +433,6 @@ typedef NS_ENUM(NSInteger, TIM_GROUP_SYSTEM_TYPE){ | ||
| 459 | TIM_GROUP_SYSTEM_CUSTOM_INFO = 0xff, | 433 | TIM_GROUP_SYSTEM_CUSTOM_INFO = 0xff, |
| 460 | }; | 434 | }; |
| 461 | 435 | ||
| 462 | -/** | ||
| 463 | - * 推送规则 | ||
| 464 | - */ | ||
| 465 | typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) { | 436 | typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) { |
| 466 | /** | 437 | /** |
| 467 | * 按照默认规则进行推送 | 438 | * 按照默认规则进行推送 |
| @@ -473,9 +444,6 @@ typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) { | @@ -473,9 +444,6 @@ typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) { | ||
| 473 | TIM_OFFLINE_PUSH_NO_PUSH = 1, | 444 | TIM_OFFLINE_PUSH_NO_PUSH = 1, |
| 474 | }; | 445 | }; |
| 475 | 446 | ||
| 476 | -/** | ||
| 477 | - * 安卓离线推送模式 | ||
| 478 | - */ | ||
| 479 | typedef NS_ENUM(NSInteger, TIMAndroidOfflinePushNotifyMode) { | 447 | typedef NS_ENUM(NSInteger, TIMAndroidOfflinePushNotifyMode) { |
| 480 | /** | 448 | /** |
| 481 | * 通知栏消息 | 449 | * 通知栏消息 |
| @@ -512,9 +480,6 @@ typedef NS_ENUM(NSInteger, TIMGroupMemberRole) { | @@ -512,9 +480,6 @@ typedef NS_ENUM(NSInteger, TIMGroupMemberRole) { | ||
| 512 | TIM_GROUP_MEMBER_ROLE_SUPER = 400, | 480 | TIM_GROUP_MEMBER_ROLE_SUPER = 400, |
| 513 | }; | 481 | }; |
| 514 | 482 | ||
| 515 | -/** | ||
| 516 | - * 好友验证方式 | ||
| 517 | - */ | ||
| 518 | typedef NS_ENUM(NSInteger, TIMFriendAllowType) { | 483 | typedef NS_ENUM(NSInteger, TIMFriendAllowType) { |
| 519 | /** | 484 | /** |
| 520 | * 同意任何用户加好友 | 485 | * 同意任何用户加好友 |
| @@ -532,9 +497,6 @@ typedef NS_ENUM(NSInteger, TIMFriendAllowType) { | @@ -532,9 +497,6 @@ typedef NS_ENUM(NSInteger, TIMFriendAllowType) { | ||
| 532 | TIM_FRIEND_DENY_ANY = 2, | 497 | TIM_FRIEND_DENY_ANY = 2, |
| 533 | }; | 498 | }; |
| 534 | 499 | ||
| 535 | -/** | ||
| 536 | - * 性别 | ||
| 537 | - */ | ||
| 538 | typedef NS_ENUM(NSInteger, TIMGender) { | 500 | typedef NS_ENUM(NSInteger, TIMGender) { |
| 539 | /** | 501 | /** |
| 540 | * 未知性别 | 502 | * 未知性别 |
| @@ -551,8 +513,61 @@ typedef NS_ENUM(NSInteger, TIMGender) { | @@ -551,8 +513,61 @@ typedef NS_ENUM(NSInteger, TIMGender) { | ||
| 551 | 513 | ||
| 552 | }; | 514 | }; |
| 553 | 515 | ||
| 516 | +/** | ||
| 517 | + * 基本资料标志位 | ||
| 518 | + */ | ||
| 519 | +typedef NS_ENUM(NSInteger, TIMProfileFlag) { | ||
| 520 | + /** | ||
| 521 | + * 昵称 | ||
| 522 | + */ | ||
| 523 | + TIM_PROFILE_FLAG_NICK = 0x01, | ||
| 524 | + /** | ||
| 525 | + * 好友验证方式 | ||
| 526 | + */ | ||
| 527 | + TIM_PROFILE_FLAG_ALLOW_TYPE = (0x01 << 1), | ||
| 528 | + /** | ||
| 529 | + * 头像 | ||
| 530 | + */ | ||
| 531 | + TIM_PROFILE_FLAG_FACE_URL = (0x01 << 2), | ||
| 532 | + /** | ||
| 533 | + * 好友备注 | ||
| 534 | + */ | ||
| 535 | + TIM_PROFILE_FLAG_REMARK = (0x01 << 3), | ||
| 536 | + /** | ||
| 537 | + * 好友分组 | ||
| 538 | + */ | ||
| 539 | + TIM_PROFILE_FLAG_GROUP = (0x01 << 4), | ||
| 540 | + /** | ||
| 541 | + * 用户签名 | ||
| 542 | + */ | ||
| 543 | + TIM_PROFILE_FLAG_SELFSIGNATURE = (0x01 << 5), | ||
| 544 | + /** | ||
| 545 | + * 用户性别 | ||
| 546 | + */ | ||
| 547 | + TIM_PROFILE_FLAG_GENDER = (0x01 << 6), | ||
| 548 | + /** | ||
| 549 | + * 用户生日 | ||
| 550 | + */ | ||
| 551 | + TIM_PROFILE_FLAG_BIRTHDAY = (0x01 << 7), | ||
| 552 | + /** | ||
| 553 | + * 用户区域 | ||
| 554 | + */ | ||
| 555 | + TIM_PROFILE_FLAG_LOCATION = (0x01 << 8), | ||
| 556 | + /** | ||
| 557 | + * 用户语言 | ||
| 558 | + */ | ||
| 559 | + TIM_PROFILE_FLAG_LANGUAGE = (0x01 << 9), | ||
| 560 | + /** | ||
| 561 | + * 用户等级 | ||
| 562 | + */ | ||
| 563 | + TIM_PROFILE_FLAG_LEVEL = (0x01 << 10), | ||
| 564 | + /** | ||
| 565 | + * 用户角色 | ||
| 566 | + */ | ||
| 567 | + TIM_PROFILE_FLAG_ROLE = (0x01 << 11), | ||
| 568 | +}; | ||
| 554 | 569 | ||
| 555 | -#pragma mark - block 回调 | 570 | +#pragma mark - block回调 |
| 556 | 571 | ||
| 557 | /** | 572 | /** |
| 558 | * 获取消息回调 | 573 | * 获取消息回调 |
| @@ -605,12 +620,12 @@ typedef void (^TIMLogFunc)(TIMLogLevel lvl, NSString * msg); | @@ -605,12 +620,12 @@ typedef void (^TIMLogFunc)(TIMLogLevel lvl, NSString * msg); | ||
| 605 | /** | 620 | /** |
| 606 | * 上传图片成功回调 | 621 | * 上传图片成功回调 |
| 607 | * | 622 | * |
| 608 | - * @param elem 上传图片成功后 elem | 623 | + * @param elem 上传图片成功后elem |
| 609 | */ | 624 | */ |
| 610 | typedef void (^TIMUploadImageSucc)(TIMImageElem * elem); | 625 | typedef void (^TIMUploadImageSucc)(TIMImageElem * elem); |
| 611 | 626 | ||
| 612 | /** | 627 | /** |
| 613 | - * APNs 推送配置更新成功回调 | 628 | + * APNs推送配置更新成功回调 |
| 614 | * | 629 | * |
| 615 | * @param config 配置 | 630 | * @param config 配置 |
| 616 | */ | 631 | */ |
| @@ -619,7 +634,7 @@ typedef void (^TIMAPNSConfigSucc)(TIMAPNSConfig* config); | @@ -619,7 +634,7 @@ typedef void (^TIMAPNSConfigSucc)(TIMAPNSConfig* config); | ||
| 619 | /** | 634 | /** |
| 620 | * 群创建成功 | 635 | * 群创建成功 |
| 621 | * | 636 | * |
| 622 | - * @param groupId 群组 Id | 637 | + * @param groupId 群组Id |
| 623 | */ | 638 | */ |
| 624 | typedef void (^TIMCreateGroupSucc)(NSString * groupId); | 639 | typedef void (^TIMCreateGroupSucc)(NSString * groupId); |
| 625 | 640 | ||
| @@ -628,7 +643,7 @@ typedef void (^TIMCreateGroupSucc)(NSString * groupId); | @@ -628,7 +643,7 @@ typedef void (^TIMCreateGroupSucc)(NSString * groupId); | ||
| 628 | * | 643 | * |
| 629 | * @param friends 好友列表 | 644 | * @param friends 好友列表 |
| 630 | */ | 645 | */ |
| 631 | -typedef void (^TIMFriendArraySucc)(NSArray<TIMFriend *> *friends); | 646 | +typedef void (^TIMFriendSucc)(NSArray * friends); |
| 632 | 647 | ||
| 633 | /** | 648 | /** |
| 634 | * 获取资料回调 | 649 | * 获取资料回调 |
| @@ -637,477 +652,635 @@ typedef void (^TIMFriendArraySucc)(NSArray<TIMFriend *> *friends); | @@ -637,477 +652,635 @@ typedef void (^TIMFriendArraySucc)(NSArray<TIMFriend *> *friends); | ||
| 637 | */ | 652 | */ |
| 638 | typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile); | 653 | typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile); |
| 639 | 654 | ||
| 640 | -/** | ||
| 641 | - * 获取资料回调 | ||
| 642 | - * | ||
| 643 | - * @param profiles 资料 | ||
| 644 | - */ | ||
| 645 | -typedef void (^TIMUserProfileArraySucc)(NSArray<TIMUserProfile *> *profiles); | ||
| 646 | - | ||
| 647 | -/** | ||
| 648 | - * 好友操作回调 | ||
| 649 | - * | ||
| 650 | - * @param result 资料 | ||
| 651 | - */ | ||
| 652 | -typedef void (^TIMFriendResultSucc)(TIMFriendResult *result); | ||
| 653 | - | ||
| 654 | -/** | ||
| 655 | - * 好友操作回调 | ||
| 656 | - * | ||
| 657 | - * @param results 资料 | ||
| 658 | - */ | ||
| 659 | -typedef void (^TIMFriendResultArraySucc)(NSArray<TIMFriendResult *> *results); | ||
| 660 | - | ||
| 661 | #pragma mark - 基本类型 | 655 | #pragma mark - 基本类型 |
| 662 | 656 | ||
| 663 | -/// 实现 NSCoding 协议 | ||
| 664 | @interface TIMCodingModel : NSObject <NSCoding> | 657 | @interface TIMCodingModel : NSObject <NSCoding> |
| 665 | 658 | ||
| 666 | -///读取实例变量,并把这些数据写到 coder 中去,序列化数据 | ||
| 667 | - (void)encodeWithCoder:(NSCoder *)encoder; | 659 | - (void)encodeWithCoder:(NSCoder *)encoder; |
| 668 | - | ||
| 669 | -///从 coder 中读取数据,保存到相应的变量中,即反序列化数据 | ||
| 670 | - (id)initWithCoder:(NSCoder *)decoder; | 660 | - (id)initWithCoder:(NSCoder *)decoder; |
| 671 | 661 | ||
| 672 | @end | 662 | @end |
| 673 | 663 | ||
| 674 | -/// 初始化 SDK 配置信息 | ||
| 675 | @interface TIMSdkConfig : NSObject | 664 | @interface TIMSdkConfig : NSObject |
| 676 | 665 | ||
| 677 | -///用户标识接入 SDK 的应用 ID,必填 | 666 | +/** |
| 667 | + * 用户标识接入SDK的应用ID,必填 | ||
| 668 | + */ | ||
| 678 | @property(nonatomic,assign) int sdkAppId; | 669 | @property(nonatomic,assign) int sdkAppId; |
| 679 | 670 | ||
| 680 | -///用户的账号类型,必填 | 671 | +/** |
| 672 | + * 用户的账号类型,必填 | ||
| 673 | + */ | ||
| 681 | @property(nonatomic,strong) NSString * accountType; | 674 | @property(nonatomic,strong) NSString * accountType; |
| 682 | 675 | ||
| 683 | -///禁用 crash 上报,默认上报 (方法已废弃,客户需要自己集成 Crash 上报逻辑) | ||
| 684 | -@property(nonatomic,assign) BOOL disableCrashReport DEPRECATED_ATTRIBUTE; | 676 | +/** |
| 677 | + * 禁用crash上报,默认上报 | ||
| 678 | + */ | ||
| 679 | +@property(nonatomic,assign) BOOL disableCrashReport; | ||
| 685 | 680 | ||
| 686 | -///禁止在控制台打印 log | 681 | +/** |
| 682 | + * 禁止在控制台打印log | ||
| 683 | + */ | ||
| 687 | @property(nonatomic,assign) BOOL disableLogPrint; | 684 | @property(nonatomic,assign) BOOL disableLogPrint; |
| 688 | 685 | ||
| 689 | -///本地写 log 文件的等级,默认 DEBUG 等级 | 686 | +/** |
| 687 | + * 本地写log文件的等级,默认DEBUG等级 | ||
| 688 | + */ | ||
| 690 | @property(nonatomic,assign) TIMLogLevel logLevel; | 689 | @property(nonatomic,assign) TIMLogLevel logLevel; |
| 691 | 690 | ||
| 692 | -///log 文件路径,不设置时为默认路径 | 691 | +/** |
| 692 | + * log文件路径,不设置时为默认路径 | ||
| 693 | + */ | ||
| 693 | @property(nonatomic,strong) NSString * logPath; | 694 | @property(nonatomic,strong) NSString * logPath; |
| 694 | 695 | ||
| 695 | -///回调给 log 函数的 log 等级,默认 DEBUG 等级 | 696 | +/** |
| 697 | + * 回调给log函数的log等级,默认DEBUG等级 | ||
| 698 | + */ | ||
| 696 | @property(nonatomic,assign) TIMLogLevel logFuncLevel; | 699 | @property(nonatomic,assign) TIMLogLevel logFuncLevel; |
| 697 | 700 | ||
| 698 | -///log 监听函数 | 701 | +/** |
| 702 | + * log监听函数 | ||
| 703 | + */ | ||
| 699 | @property(nonatomic,copy) TIMLogFunc logFunc; | 704 | @property(nonatomic,copy) TIMLogFunc logFunc; |
| 700 | 705 | ||
| 701 | -///消息数据库路径,不设置时为默认路径 | 706 | +/** |
| 707 | + * 消息数据库路径,不设置时为默认路径 | ||
| 708 | + */ | ||
| 702 | @property(nonatomic,strong) NSString * dbPath; | 709 | @property(nonatomic,strong) NSString * dbPath; |
| 703 | 710 | ||
| 704 | -///网络监听器 | 711 | +/** |
| 712 | + * 网络监听器 | ||
| 713 | + */ | ||
| 705 | @property(nonatomic,strong) id<TIMConnListener> connListener; | 714 | @property(nonatomic,strong) id<TIMConnListener> connListener; |
| 706 | 715 | ||
| 707 | @end | 716 | @end |
| 708 | 717 | ||
| 709 | -/// 设置用户配置信息 | 718 | + |
| 710 | @interface TIMUserConfig : NSObject | 719 | @interface TIMUserConfig : NSObject |
| 711 | 720 | ||
| 712 | -///禁用本地存储(暂未实现) | ||
| 713 | -//@property(nonatomic,assign) BOOL disableStorage; | 721 | +/** |
| 722 | + * 禁用本地存储(加载消息扩展包有效) | ||
| 723 | + */ | ||
| 724 | +@property(nonatomic,assign) BOOL disableStorage; | ||
| 714 | 725 | ||
| 715 | -///禁止消息已读自动上报,一旦禁用自动上报,需要开发者显式调用 setReadMessage ,详情请参考官网文档 [未读消息计数](https://cloud.tencent.com/document/product/269/9151) | 726 | +/** |
| 727 | + * 禁止自动上报(加载消息扩展包有效) | ||
| 728 | + */ | ||
| 716 | @property(nonatomic,assign) BOOL disableAutoReport; | 729 | @property(nonatomic,assign) BOOL disableAutoReport; |
| 717 | 730 | ||
| 718 | -///开启 C2C 已读回执,只针对 C2C 消息生效,用户开启已读回执功能后,对方调用 setReadMessage 时会同步已读信息到本客户端,您可以在 TIMMessageReceiptListener 监听消息已读回执 | 731 | +/** |
| 732 | + * 开启C2C已读回执(加载消息扩展包有效) | ||
| 733 | + */ | ||
| 719 | @property(nonatomic,assign) BOOL enableReadReceipt; | 734 | @property(nonatomic,assign) BOOL enableReadReceipt; |
| 720 | 735 | ||
| 721 | -///不开启最近联系人(暂未实现) | ||
| 722 | -//@property(nonatomic,assign) BOOL disableRecnetContact; | 736 | +/** |
| 737 | + * 不开启最近联系人(加载消息扩展包有效) | ||
| 738 | + */ | ||
| 739 | +@property(nonatomic,assign) BOOL disableRecnetContact; | ||
| 740 | + | ||
| 741 | +/** | ||
| 742 | + * 不通过onNewMessage:抛出最近联系人的最后一条消息(加载消息扩展包有效) | ||
| 743 | + */ | ||
| 744 | +@property(nonatomic,assign) BOOL disableRecentContactNotify; | ||
| 745 | + | ||
| 746 | +///** | ||
| 747 | +// * 开启关系链数据本地缓存功能(加载好友扩展包有效) | ||
| 748 | +// */ | ||
| 749 | +//@property(nonatomic,assign) BOOL enableFriendshipProxy; | ||
| 723 | 750 | ||
| 724 | -///不通过 onNewMessage: 抛出最近联系人的最后一条消息(暂未实现) | ||
| 725 | -//@property(nonatomic,assign) BOOL disableRecentContactNotify; | 751 | +///** |
| 752 | +// * 开启群组数据本地缓存功能(加载群组扩展包有效) | ||
| 753 | +// */ | ||
| 754 | +//@property(nonatomic,assign) BOOL enableGroupAssistant; | ||
| 726 | 755 | ||
| 727 | -///设置默认拉取的群组资料 | 756 | +/** |
| 757 | + * 设置默认拉取的群组资料 | ||
| 758 | + */ | ||
| 728 | @property(nonatomic,strong) TIMGroupInfoOption * groupInfoOpt; | 759 | @property(nonatomic,strong) TIMGroupInfoOption * groupInfoOpt; |
| 729 | 760 | ||
| 730 | -///设置默认拉取的群成员资料 | 761 | +/** |
| 762 | + * 设置默认拉取的群成员资料 | ||
| 763 | + */ | ||
| 731 | @property(nonatomic,strong) TIMGroupMemberInfoOption * groupMemberInfoOpt; | 764 | @property(nonatomic,strong) TIMGroupMemberInfoOption * groupMemberInfoOpt; |
| 732 | 765 | ||
| 733 | -///关系链参数 | 766 | +/** |
| 767 | + * 设置默认拉取的好友资料 | ||
| 768 | + */ | ||
| 734 | @property(nonatomic,strong) TIMFriendProfileOption * friendProfileOpt; | 769 | @property(nonatomic,strong) TIMFriendProfileOption * friendProfileOpt; |
| 735 | 770 | ||
| 736 | -///用户登录状态监听器 | 771 | +/** |
| 772 | + * 用户登录状态监听器 | ||
| 773 | + */ | ||
| 737 | @property(nonatomic,strong) id<TIMUserStatusListener> userStatusListener; | 774 | @property(nonatomic,strong) id<TIMUserStatusListener> userStatusListener; |
| 738 | 775 | ||
| 739 | -///会话刷新监听器(未读计数、已读同步) | 776 | +/** |
| 777 | + * 会话刷新监听器(未读计数、已读同步)(加载消息扩展包有效) | ||
| 778 | + */ | ||
| 740 | @property(nonatomic,strong) id<TIMRefreshListener> refreshListener; | 779 | @property(nonatomic,strong) id<TIMRefreshListener> refreshListener; |
| 741 | 780 | ||
| 742 | -///消息已读回执监听器 | 781 | +/** |
| 782 | + * 消息已读回执监听器(加载消息扩展包有效) | ||
| 783 | + */ | ||
| 743 | @property(nonatomic,strong) id<TIMMessageReceiptListener> messageReceiptListener; | 784 | @property(nonatomic,strong) id<TIMMessageReceiptListener> messageReceiptListener; |
| 744 | 785 | ||
| 745 | -///消息 svr 重写监听器 | 786 | +/** |
| 787 | + * 消息svr重写监听器(加载消息扩展包有效) | ||
| 788 | + */ | ||
| 746 | @property(nonatomic,strong) id<TIMMessageUpdateListener> messageUpdateListener; | 789 | @property(nonatomic,strong) id<TIMMessageUpdateListener> messageUpdateListener; |
| 747 | 790 | ||
| 748 | -///消息撤回监听器 | 791 | +/** |
| 792 | + * 消息撤回监听器(加载消息扩展包有效) | ||
| 793 | + */ | ||
| 749 | @property(nonatomic,strong) id<TIMMessageRevokeListener> messageRevokeListener; | 794 | @property(nonatomic,strong) id<TIMMessageRevokeListener> messageRevokeListener; |
| 750 | 795 | ||
| 751 | -///文件上传进度监听器 | 796 | +/** |
| 797 | + * 文件上传进度监听器 | ||
| 798 | + */ | ||
| 752 | @property(nonatomic,strong) id<TIMUploadProgressListener> uploadProgressListener; | 799 | @property(nonatomic,strong) id<TIMUploadProgressListener> uploadProgressListener; |
| 753 | 800 | ||
| 754 | -///群组事件通知监听器 | 801 | +/** |
| 802 | + * 群组事件通知监听器 | ||
| 803 | + */ | ||
| 755 | @property(nonatomic,strong) id<TIMGroupEventListener> groupEventListener; | 804 | @property(nonatomic,strong) id<TIMGroupEventListener> groupEventListener; |
| 756 | 805 | ||
| 757 | -///关系链数据本地缓存监听器 | ||
| 758 | -@property(nonatomic,strong) id<TIMFriendshipListener> friendshipListener; | 806 | +///** |
| 807 | +// * 关系链数据本地缓存监听器(加载好友扩展包、enableFriendshipProxy有效) | ||
| 808 | +// */ | ||
| 809 | +//@property(nonatomic,strong) id<TIMFriendshipListener> friendshipListener; | ||
| 810 | + | ||
| 811 | +///** | ||
| 812 | +// * 群组据本地缓存监听器(加载群组扩展包、enableGroupAssistant有效) | ||
| 813 | +// */ | ||
| 814 | +//@property(nonatomic,strong) id<TIMGroupListener> groupListener; | ||
| 759 | 815 | ||
| 760 | @end | 816 | @end |
| 761 | 817 | ||
| 762 | -/// 登陆参数 | 818 | +/** |
| 819 | + * 登陆信息 | ||
| 820 | + */ | ||
| 821 | + | ||
| 763 | @interface TIMLoginParam : NSObject | 822 | @interface TIMLoginParam : NSObject |
| 764 | 823 | ||
| 765 | -///用户名 | 824 | +/** |
| 825 | + * 用户名 | ||
| 826 | + */ | ||
| 766 | @property(nonatomic,strong) NSString* identifier; | 827 | @property(nonatomic,strong) NSString* identifier; |
| 767 | 828 | ||
| 768 | -///鉴权 Token | 829 | +/** |
| 830 | + * 鉴权Token | ||
| 831 | + */ | ||
| 769 | @property(nonatomic,strong) NSString* userSig; | 832 | @property(nonatomic,strong) NSString* userSig; |
| 770 | 833 | ||
| 771 | -///App 用户使用 OAuth 授权体系分配的 Appid | 834 | +/** |
| 835 | + * App用户使用OAuth授权体系分配的Appid | ||
| 836 | + */ | ||
| 772 | @property(nonatomic,strong) NSString* appidAt3rd; | 837 | @property(nonatomic,strong) NSString* appidAt3rd; |
| 773 | 838 | ||
| 774 | 839 | ||
| 775 | @end | 840 | @end |
| 776 | 841 | ||
| 777 | -/// APNs 配置 | 842 | +/** |
| 843 | + * APNs 配置 | ||
| 844 | + */ | ||
| 778 | @interface TIMAPNSConfig : NSObject | 845 | @interface TIMAPNSConfig : NSObject |
| 779 | - | ||
| 780 | -///是否开启推送:0-不进行设置 1-开启推送 2-关闭推送 | 846 | +/** |
| 847 | + * 是否开启推送:0-不进行设置 1-开启推送 2-关闭推送 | ||
| 848 | + */ | ||
| 781 | @property(nonatomic,assign) uint32_t openPush; | 849 | @property(nonatomic,assign) uint32_t openPush; |
| 782 | - | ||
| 783 | -///C2C 消息声音,不设置传入 nil | 850 | +/** |
| 851 | + * C2C消息声音,不设置传入nil | ||
| 852 | + */ | ||
| 784 | @property(nonatomic,strong) NSString * c2cSound; | 853 | @property(nonatomic,strong) NSString * c2cSound; |
| 785 | 854 | ||
| 786 | -///Group 消息声音,不设置传入 nil | 855 | +/** |
| 856 | + * Group消息声音,不设置传入nil | ||
| 857 | + */ | ||
| 787 | @property(nonatomic,strong) NSString * groupSound; | 858 | @property(nonatomic,strong) NSString * groupSound; |
| 788 | 859 | ||
| 789 | -///Video 音视频邀请声音,不设置传入 nil | 860 | +/** |
| 861 | + * Video声音,不设置传入nil | ||
| 862 | + */ | ||
| 790 | @property(nonatomic,strong) NSString * videoSound; | 863 | @property(nonatomic,strong) NSString * videoSound; |
| 791 | 864 | ||
| 792 | @end | 865 | @end |
| 793 | 866 | ||
| 794 | -/// SetToken 参数 | 867 | +/** |
| 868 | + * SetToken 参数 | ||
| 869 | + */ | ||
| 795 | @interface TIMTokenParam : NSObject | 870 | @interface TIMTokenParam : NSObject |
| 796 | - | ||
| 797 | -///获取的客户端 Token 信息 | 871 | +/** |
| 872 | + * 获取的客户端Token信息 | ||
| 873 | + */ | ||
| 798 | @property(nonatomic,strong) NSData* token; | 874 | @property(nonatomic,strong) NSData* token; |
| 799 | - | ||
| 800 | -///业务 ID,传递证书时分配 | 875 | +/** |
| 876 | + * 业务ID,传递证书时分配 | ||
| 877 | + */ | ||
| 801 | @property(nonatomic,assign) uint32_t busiId; | 878 | @property(nonatomic,assign) uint32_t busiId; |
| 802 | 879 | ||
| 803 | @end | 880 | @end |
| 804 | 881 | ||
| 805 | -/// 切后台参数 | 882 | + |
| 883 | +/** | ||
| 884 | + * 切后台参数 | ||
| 885 | + */ | ||
| 806 | @interface TIMBackgroundParam : NSObject | 886 | @interface TIMBackgroundParam : NSObject |
| 807 | 887 | ||
| 808 | -///C2C 未读计数 | 888 | +/** |
| 889 | + * C2C 未读计数 | ||
| 890 | + */ | ||
| 809 | @property(nonatomic,assign) int c2cUnread; | 891 | @property(nonatomic,assign) int c2cUnread; |
| 810 | 892 | ||
| 811 | -///群未读计数 | 893 | +/** |
| 894 | + * 群 未读计数 | ||
| 895 | + */ | ||
| 812 | @property(nonatomic,assign) int groupUnread; | 896 | @property(nonatomic,assign) int groupUnread; |
| 813 | 897 | ||
| 814 | @end | 898 | @end |
| 815 | 899 | ||
| 816 | -/// 消息定位 | ||
| 817 | @interface TIMMessageLocator : NSObject | 900 | @interface TIMMessageLocator : NSObject |
| 818 | - | ||
| 819 | -///所属会话的 id | 901 | +/** |
| 902 | + * 所属会话的id | ||
| 903 | + */ | ||
| 820 | @property(nonatomic,strong) NSString * sessId; | 904 | @property(nonatomic,strong) NSString * sessId; |
| 821 | - | ||
| 822 | -///所属会话的类型 | 905 | +/** |
| 906 | + * 所属会话的类型 | ||
| 907 | + */ | ||
| 823 | @property(nonatomic,assign) TIMConversationType sessType; | 908 | @property(nonatomic,assign) TIMConversationType sessType; |
| 824 | - | ||
| 825 | -///消息序列号 | 909 | +/** |
| 910 | + * 消息序列号 | ||
| 911 | + */ | ||
| 826 | @property(nonatomic,assign) uint64_t seq; | 912 | @property(nonatomic,assign) uint64_t seq; |
| 827 | - | ||
| 828 | -///消息随机码 | 913 | +/** |
| 914 | + * 消息随机码 | ||
| 915 | + */ | ||
| 829 | @property(nonatomic,assign) uint64_t rand; | 916 | @property(nonatomic,assign) uint64_t rand; |
| 830 | - | ||
| 831 | -///消息时间戳 | 917 | +/** |
| 918 | + * 消息时间戳 | ||
| 919 | + */ | ||
| 832 | @property(nonatomic,assign) time_t time; | 920 | @property(nonatomic,assign) time_t time; |
| 833 | - | ||
| 834 | -///是否本人消息 | 921 | +/** |
| 922 | + * 是否本人消息 | ||
| 923 | + */ | ||
| 835 | @property(nonatomic,assign) BOOL isSelf; | 924 | @property(nonatomic,assign) BOOL isSelf; |
| 836 | 925 | ||
| 837 | -///是否来自撤销通知 | 926 | +/** |
| 927 | + * 是否来自撤销通知 | ||
| 928 | + */ | ||
| 838 | @property(nonatomic,assign) BOOL isFromRevokeNotify; | 929 | @property(nonatomic,assign) BOOL isFromRevokeNotify; |
| 839 | 930 | ||
| 840 | @end | 931 | @end |
| 841 | 932 | ||
| 842 | -/// 已读回执 | 933 | +/** |
| 934 | + * 已读回执 | ||
| 935 | + */ | ||
| 843 | @interface TIMMessageReceipt : NSObject | 936 | @interface TIMMessageReceipt : NSObject |
| 844 | - | ||
| 845 | -///已读回执对应的会话(目前只支持 C2C 会话) | 937 | +/** |
| 938 | + * 已读回执对应的会话(目前只支持C2C会话) | ||
| 939 | + */ | ||
| 846 | @property(nonatomic,strong) TIMConversation * conversation; | 940 | @property(nonatomic,strong) TIMConversation * conversation; |
| 847 | - | ||
| 848 | -///收到已读回执时,这个时间戳之前的消息都已读 | 941 | +/** |
| 942 | + * 收到已读回执时,这个时间戳之前的消息都已读 | ||
| 943 | + */ | ||
| 849 | @property(nonatomic,assign) time_t timestamp; | 944 | @property(nonatomic,assign) time_t timestamp; |
| 850 | @end | 945 | @end |
| 851 | 946 | ||
| 852 | -/// Android 离线推送配置 | ||
| 853 | @interface TIMAndroidOfflinePushConfig : NSObject | 947 | @interface TIMAndroidOfflinePushConfig : NSObject |
| 854 | - | ||
| 855 | -///离线推送时展示标签 | 948 | +/** |
| 949 | + * 离线推送时展示标签 | ||
| 950 | + */ | ||
| 856 | @property(nonatomic,strong) NSString * title; | 951 | @property(nonatomic,strong) NSString * title; |
| 857 | - | ||
| 858 | -///Android 离线 Push 时声音字段信息 | 952 | +/** |
| 953 | + * Android离线Push时声音字段信息 | ||
| 954 | + */ | ||
| 859 | @property(nonatomic,strong) NSString * sound; | 955 | @property(nonatomic,strong) NSString * sound; |
| 860 | - | ||
| 861 | -///离线推送时通知形式 | 956 | +/** |
| 957 | + * 离线推送时通知形式 | ||
| 958 | + */ | ||
| 862 | @property(nonatomic,assign) TIMAndroidOfflinePushNotifyMode notifyMode; | 959 | @property(nonatomic,assign) TIMAndroidOfflinePushNotifyMode notifyMode; |
| 863 | 960 | ||
| 864 | @end | 961 | @end |
| 865 | 962 | ||
| 866 | -/// iOS 离线推送配置 | ||
| 867 | @interface TIMIOSOfflinePushConfig : NSObject | 963 | @interface TIMIOSOfflinePushConfig : NSObject |
| 868 | - | ||
| 869 | -///离线 Push 时声音字段信息 | 964 | +/** |
| 965 | + * 离线Push时声音字段信息 | ||
| 966 | + */ | ||
| 870 | @property(nonatomic,strong) NSString * sound; | 967 | @property(nonatomic,strong) NSString * sound; |
| 871 | - | ||
| 872 | -///忽略 badge 计数 | 968 | +/** |
| 969 | + * 忽略badge计数 | ||
| 970 | + */ | ||
| 873 | @property(nonatomic,assign) BOOL ignoreBadge; | 971 | @property(nonatomic,assign) BOOL ignoreBadge; |
| 874 | 972 | ||
| 875 | @end | 973 | @end |
| 876 | 974 | ||
| 877 | -/// 群组内的本人信息 | 975 | +/** |
| 976 | + * 群组内的本人信息 | ||
| 977 | + */ | ||
| 878 | @interface TIMGroupSelfInfo : NSObject | 978 | @interface TIMGroupSelfInfo : NSObject |
| 879 | 979 | ||
| 880 | -///加入群组时间 | 980 | +/** |
| 981 | + * 加入群组时间 | ||
| 982 | + */ | ||
| 881 | @property(nonatomic,assign) uint32_t joinTime; | 983 | @property(nonatomic,assign) uint32_t joinTime; |
| 882 | 984 | ||
| 883 | -///群组中的角色 | 985 | +/** |
| 986 | + * 群组中的角色 | ||
| 987 | + */ | ||
| 884 | @property(nonatomic,assign) TIMGroupMemberRole role; | 988 | @property(nonatomic,assign) TIMGroupMemberRole role; |
| 885 | 989 | ||
| 886 | -///群组消息接收选项 | 990 | +/** |
| 991 | + * 群组消息接收选项 | ||
| 992 | + */ | ||
| 887 | @property(nonatomic,assign) TIMGroupReceiveMessageOpt recvOpt; | 993 | @property(nonatomic,assign) TIMGroupReceiveMessageOpt recvOpt; |
| 888 | 994 | ||
| 889 | -///群组中的未读消息数 | 995 | +/** |
| 996 | + * 群组中的未读消息数 | ||
| 997 | + */ | ||
| 890 | @property(nonatomic,assign) uint32_t unReadMessageNum; | 998 | @property(nonatomic,assign) uint32_t unReadMessageNum; |
| 891 | 999 | ||
| 892 | @end | 1000 | @end |
| 893 | 1001 | ||
| 894 | -/// 群资料信息 | 1002 | +/** |
| 1003 | + * 群资料信息 | ||
| 1004 | + */ | ||
| 895 | @interface TIMGroupInfo : TIMCodingModel | 1005 | @interface TIMGroupInfo : TIMCodingModel |
| 896 | 1006 | ||
| 897 | -///群组 Id | 1007 | +/** |
| 1008 | + * 群组Id | ||
| 1009 | + */ | ||
| 898 | @property(nonatomic,strong) NSString* group; | 1010 | @property(nonatomic,strong) NSString* group; |
| 899 | - | ||
| 900 | -///群名 | 1011 | +/** |
| 1012 | + * 群名 | ||
| 1013 | + */ | ||
| 901 | @property(nonatomic,strong) NSString* groupName; | 1014 | @property(nonatomic,strong) NSString* groupName; |
| 902 | - | ||
| 903 | -///群创建人/管理员 | 1015 | +/** |
| 1016 | + * 群创建人/管理员 | ||
| 1017 | + */ | ||
| 904 | @property(nonatomic,strong) NSString * owner; | 1018 | @property(nonatomic,strong) NSString * owner; |
| 905 | - | ||
| 906 | -///群类型:Private,Public,ChatRoom | 1019 | +/** |
| 1020 | + * 群类型:Private,Public,ChatRoom | ||
| 1021 | + */ | ||
| 907 | @property(nonatomic,strong) NSString* groupType; | 1022 | @property(nonatomic,strong) NSString* groupType; |
| 908 | - | ||
| 909 | -///群创建时间 | 1023 | +/** |
| 1024 | + * 群创建时间 | ||
| 1025 | + */ | ||
| 910 | @property(nonatomic,assign) uint32_t createTime; | 1026 | @property(nonatomic,assign) uint32_t createTime; |
| 911 | - | ||
| 912 | -///最近一次群资料修改时间 | 1027 | +/** |
| 1028 | + * 最近一次群资料修改时间 | ||
| 1029 | + */ | ||
| 913 | @property(nonatomic,assign) uint32_t lastInfoTime; | 1030 | @property(nonatomic,assign) uint32_t lastInfoTime; |
| 914 | - | ||
| 915 | -///最近一次发消息时间 | 1031 | +/** |
| 1032 | + * 最近一次发消息时间 | ||
| 1033 | + */ | ||
| 916 | @property(nonatomic,assign) uint32_t lastMsgTime; | 1034 | @property(nonatomic,assign) uint32_t lastMsgTime; |
| 917 | - | ||
| 918 | -///最大成员数 | 1035 | +/** |
| 1036 | + * 最大成员数 | ||
| 1037 | + */ | ||
| 919 | @property(nonatomic,assign) uint32_t maxMemberNum; | 1038 | @property(nonatomic,assign) uint32_t maxMemberNum; |
| 920 | - | ||
| 921 | -///群成员数量 | 1039 | +/** |
| 1040 | + * 群成员数量 | ||
| 1041 | + */ | ||
| 922 | @property(nonatomic,assign) uint32_t memberNum; | 1042 | @property(nonatomic,assign) uint32_t memberNum; |
| 923 | 1043 | ||
| 924 | -///入群类型 | 1044 | +/** |
| 1045 | + * 入群类型 | ||
| 1046 | + */ | ||
| 925 | @property(nonatomic,assign) TIMGroupAddOpt addOpt; | 1047 | @property(nonatomic,assign) TIMGroupAddOpt addOpt; |
| 926 | 1048 | ||
| 927 | -///群公告 | 1049 | +/** |
| 1050 | + * 群公告 | ||
| 1051 | + */ | ||
| 928 | @property(nonatomic,strong) NSString* notification; | 1052 | @property(nonatomic,strong) NSString* notification; |
| 929 | 1053 | ||
| 930 | -///群简介 | 1054 | +/** |
| 1055 | + * 群简介 | ||
| 1056 | + */ | ||
| 931 | @property(nonatomic,strong) NSString* introduction; | 1057 | @property(nonatomic,strong) NSString* introduction; |
| 932 | 1058 | ||
| 933 | -///群头像 | 1059 | +/** |
| 1060 | + * 群头像 | ||
| 1061 | + */ | ||
| 934 | @property(nonatomic,strong) NSString* faceURL; | 1062 | @property(nonatomic,strong) NSString* faceURL; |
| 935 | 1063 | ||
| 936 | -///最后一条消息 | 1064 | +/** |
| 1065 | + * 最后一条消息 | ||
| 1066 | + */ | ||
| 937 | @property(nonatomic,strong) TIMMessage* lastMsg; | 1067 | @property(nonatomic,strong) TIMMessage* lastMsg; |
| 938 | 1068 | ||
| 939 | -///在线成员数量 | 1069 | +/** |
| 1070 | + * 在线成员数量 | ||
| 1071 | + */ | ||
| 940 | @property(nonatomic,assign) uint32_t onlineMemberNum; | 1072 | @property(nonatomic,assign) uint32_t onlineMemberNum; |
| 941 | 1073 | ||
| 942 | -///群组是否被搜索类型 | 1074 | +/** |
| 1075 | + * 群组是否被搜索类型 | ||
| 1076 | + */ | ||
| 943 | @property(nonatomic,assign) TIMGroupSearchableType isSearchable; | 1077 | @property(nonatomic,assign) TIMGroupSearchableType isSearchable; |
| 944 | 1078 | ||
| 945 | -///群组成员可见类型 | 1079 | +/** |
| 1080 | + * 群组成员可见类型 | ||
| 1081 | + */ | ||
| 946 | @property(nonatomic,assign) TIMGroupMemberVisibleType isMemberVisible; | 1082 | @property(nonatomic,assign) TIMGroupMemberVisibleType isMemberVisible; |
| 947 | 1083 | ||
| 948 | -///是否全员禁言 | 1084 | +/** |
| 1085 | + 是否全员禁言 | ||
| 1086 | + */ | ||
| 949 | @property(nonatomic,assign) BOOL allShutup; | 1087 | @property(nonatomic,assign) BOOL allShutup; |
| 950 | 1088 | ||
| 951 | -///群组中的本人信息 | 1089 | +/** |
| 1090 | + * 群组中的本人信息 | ||
| 1091 | + */ | ||
| 952 | @property(nonatomic,strong) TIMGroupSelfInfo* selfInfo; | 1092 | @property(nonatomic,strong) TIMGroupSelfInfo* selfInfo; |
| 953 | 1093 | ||
| 954 | -///自定义字段集合,key 是 NSString* 类型,value 是 NSData* 类型 | 1094 | +/** |
| 1095 | + * 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 1096 | + */ | ||
| 955 | @property(nonatomic,strong) NSDictionary* customInfo; | 1097 | @property(nonatomic,strong) NSDictionary* customInfo; |
| 956 | 1098 | ||
| 957 | @end | 1099 | @end |
| 958 | 1100 | ||
| 959 | -/// 事件上报信息 | 1101 | +/** |
| 1102 | + * 事件上报信息 | ||
| 1103 | + */ | ||
| 960 | @interface TIMEventReportItem : NSObject | 1104 | @interface TIMEventReportItem : NSObject |
| 961 | - | ||
| 962 | -///事件 id | 1105 | +/** |
| 1106 | + * 事件id | ||
| 1107 | + */ | ||
| 963 | @property(nonatomic,assign) uint32_t event; | 1108 | @property(nonatomic,assign) uint32_t event; |
| 964 | - | ||
| 965 | -///错误码 | 1109 | +/** |
| 1110 | + * 错误码 | ||
| 1111 | + */ | ||
| 966 | @property(nonatomic,assign) uint32_t code; | 1112 | @property(nonatomic,assign) uint32_t code; |
| 967 | - | ||
| 968 | -///错误描述 | 1113 | +/** |
| 1114 | + * 错误描述 | ||
| 1115 | + */ | ||
| 969 | @property(nonatomic,strong) NSString * desc; | 1116 | @property(nonatomic,strong) NSString * desc; |
| 970 | - | ||
| 971 | -///事件延迟(单位 ms) | 1117 | +/** |
| 1118 | + * 事件延迟(单位ms) | ||
| 1119 | + */ | ||
| 972 | @property(nonatomic,assign) uint32_t delay; | 1120 | @property(nonatomic,assign) uint32_t delay; |
| 973 | 1121 | ||
| 974 | @end | 1122 | @end |
| 975 | 1123 | ||
| 976 | -/// 获取某个群组资料 | ||
| 977 | @interface TIMGroupInfoOption : NSObject | 1124 | @interface TIMGroupInfoOption : NSObject |
| 978 | 1125 | ||
| 979 | -///需要获取的群组信息标志(TIMGetGroupBaseInfoFlag),默认为0xffffff | 1126 | +/** |
| 1127 | + * 需要获取的群组信息标志(TIMGetGroupBaseInfoFlag),默认为0xffffff | ||
| 1128 | + */ | ||
| 980 | @property(nonatomic,assign) uint64_t groupFlags; | 1129 | @property(nonatomic,assign) uint64_t groupFlags; |
| 981 | 1130 | ||
| 982 | -///需要获取群组资料的自定义信息(NSString*)列表 | 1131 | +/** |
| 1132 | + * 需要获取群组资料的自定义信息(NSString*)列表 | ||
| 1133 | + */ | ||
| 983 | @property(nonatomic,strong) NSArray * groupCustom; | 1134 | @property(nonatomic,strong) NSArray * groupCustom; |
| 984 | 1135 | ||
| 985 | @end | 1136 | @end |
| 986 | 1137 | ||
| 987 | -/// 需要某个群成员资料 | ||
| 988 | @interface TIMGroupMemberInfoOption : NSObject | 1138 | @interface TIMGroupMemberInfoOption : NSObject |
| 989 | 1139 | ||
| 990 | -///需要获取的群成员标志(TIMGetGroupMemInfoFlag),默认为0xffffff | 1140 | +/** |
| 1141 | + * 需要获取的群成员标志(TIMGetGroupMemInfoFlag),默认为0xffffff | ||
| 1142 | + */ | ||
| 991 | @property(nonatomic,assign) uint64_t memberFlags; | 1143 | @property(nonatomic,assign) uint64_t memberFlags; |
| 992 | 1144 | ||
| 993 | -///需要获取群成员资料的自定义信息(NSString*)列表 | 1145 | +/** |
| 1146 | + * 需要获取群成员资料的自定义信息(NSString*)列表 | ||
| 1147 | + */ | ||
| 994 | @property(nonatomic,strong) NSArray * memberCustom; | 1148 | @property(nonatomic,strong) NSArray * memberCustom; |
| 995 | 1149 | ||
| 996 | @end | 1150 | @end |
| 997 | 1151 | ||
| 998 | -/// 群成员资料 | 1152 | +/** |
| 1153 | + * 成员操作返回值 | ||
| 1154 | + */ | ||
| 999 | @interface TIMGroupMemberInfo : TIMCodingModel | 1155 | @interface TIMGroupMemberInfo : TIMCodingModel |
| 1000 | 1156 | ||
| 1001 | -///成员 | 1157 | +/** |
| 1158 | + * 被操作成员 | ||
| 1159 | + */ | ||
| 1002 | @property(nonatomic,strong) NSString* member; | 1160 | @property(nonatomic,strong) NSString* member; |
| 1003 | 1161 | ||
| 1004 | -///群名片 | 1162 | +/** |
| 1163 | + * 群名片 | ||
| 1164 | + */ | ||
| 1005 | @property(nonatomic,strong) NSString* nameCard; | 1165 | @property(nonatomic,strong) NSString* nameCard; |
| 1006 | 1166 | ||
| 1007 | -///加入群组时间 | 1167 | +/** |
| 1168 | + * 加入群组时间 | ||
| 1169 | + */ | ||
| 1008 | @property(nonatomic,assign) time_t joinTime; | 1170 | @property(nonatomic,assign) time_t joinTime; |
| 1009 | 1171 | ||
| 1010 | -///成员类型 | 1172 | +/** |
| 1173 | + * 成员类型 | ||
| 1174 | + */ | ||
| 1011 | @property(nonatomic,assign) TIMGroupMemberRole role; | 1175 | @property(nonatomic,assign) TIMGroupMemberRole role; |
| 1012 | 1176 | ||
| 1013 | -///禁言结束时间(时间戳) | 1177 | +/** |
| 1178 | + * 禁言结束时间(时间戳) | ||
| 1179 | + */ | ||
| 1014 | @property(nonatomic,assign) uint32_t silentUntil; | 1180 | @property(nonatomic,assign) uint32_t silentUntil; |
| 1015 | 1181 | ||
| 1016 | -///自定义字段集合,key 是 NSString*类型,value 是 NSData*类型 | 1182 | +/** |
| 1183 | + * 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 1184 | + */ | ||
| 1017 | @property(nonatomic,strong) NSDictionary* customInfo; | 1185 | @property(nonatomic,strong) NSDictionary* customInfo; |
| 1018 | 1186 | ||
| 1019 | @end | 1187 | @end |
| 1020 | 1188 | ||
| 1021 | -///资料与关系链 | ||
| 1022 | @interface TIMFriendProfileOption : NSObject | 1189 | @interface TIMFriendProfileOption : NSObject |
| 1023 | 1190 | ||
| 1024 | -///关系链最大缓存时间(默认缓存一天;获取资料和关系链超过缓存时间,将自动向服务器发起请求) | ||
| 1025 | -@property NSInteger expiredSeconds; | 1191 | +/** |
| 1192 | + * 需要获取的好友信息标志(TIMProfileFlag),默认为0xffffff | ||
| 1193 | + */ | ||
| 1194 | +@property(nonatomic,assign) uint64_t friendFlags; | ||
| 1195 | + | ||
| 1196 | +/** | ||
| 1197 | + * 需要获取的好友自定义信息(NSString*)列表 | ||
| 1198 | + */ | ||
| 1199 | +@property(nonatomic,strong) NSArray * friendCustom; | ||
| 1200 | + | ||
| 1201 | +/** | ||
| 1202 | + * 需要获取的用户自定义信息(NSString*)列表 | ||
| 1203 | + */ | ||
| 1204 | +@property(nonatomic,strong) NSArray * userCustom; | ||
| 1026 | 1205 | ||
| 1027 | @end | 1206 | @end |
| 1028 | 1207 | ||
| 1029 | -///用户资料 | 1208 | +/** |
| 1209 | + * 好友资料 | ||
| 1210 | + */ | ||
| 1030 | @interface TIMUserProfile : TIMCodingModel | 1211 | @interface TIMUserProfile : TIMCodingModel |
| 1031 | 1212 | ||
| 1032 | -///用户 identifier | 1213 | +/** |
| 1214 | + * 用户identifier | ||
| 1215 | + */ | ||
| 1033 | @property(nonatomic,strong) NSString* identifier; | 1216 | @property(nonatomic,strong) NSString* identifier; |
| 1034 | 1217 | ||
| 1035 | -///用户昵称 | 1218 | +/** |
| 1219 | + * 用户昵称 | ||
| 1220 | + */ | ||
| 1036 | @property(nonatomic,strong) NSString* nickname; | 1221 | @property(nonatomic,strong) NSString* nickname; |
| 1037 | 1222 | ||
| 1038 | -///好友验证方式 | 1223 | +/** |
| 1224 | + * 用户备注(最大96字节,获取自己资料时,该字段为空) | ||
| 1225 | + */ | ||
| 1226 | +@property(nonatomic,strong) NSString* remark; | ||
| 1227 | + | ||
| 1228 | +/** | ||
| 1229 | + * 好友验证方式 | ||
| 1230 | + */ | ||
| 1039 | @property(nonatomic,assign) TIMFriendAllowType allowType; | 1231 | @property(nonatomic,assign) TIMFriendAllowType allowType; |
| 1040 | 1232 | ||
| 1041 | -///用户头像 | 1233 | +/** |
| 1234 | + * 用户头像 | ||
| 1235 | + */ | ||
| 1042 | @property(nonatomic,strong) NSString* faceURL; | 1236 | @property(nonatomic,strong) NSString* faceURL; |
| 1043 | 1237 | ||
| 1044 | -///用户签名 | 1238 | +/** |
| 1239 | + * 用户签名 | ||
| 1240 | + */ | ||
| 1045 | @property(nonatomic,strong) NSData* selfSignature; | 1241 | @property(nonatomic,strong) NSData* selfSignature; |
| 1046 | 1242 | ||
| 1047 | -///用户性别 | 1243 | +/** |
| 1244 | + * 好友性别 | ||
| 1245 | + */ | ||
| 1048 | @property(nonatomic,assign) TIMGender gender; | 1246 | @property(nonatomic,assign) TIMGender gender; |
| 1049 | 1247 | ||
| 1050 | -///用户生日 | ||
| 1051 | -@property(nonatomic,assign) uint32_t birthday; | ||
| 1052 | - | ||
| 1053 | -///用户区域 | ||
| 1054 | -@property(nonatomic,strong) NSData* location; | ||
| 1055 | - | ||
| 1056 | -///用户语言 | ||
| 1057 | -@property(nonatomic,assign) uint32_t language; | ||
| 1058 | - | ||
| 1059 | -///等级 | ||
| 1060 | -@property(nonatomic,assign) uint32_t level; | ||
| 1061 | - | ||
| 1062 | -///角色 | ||
| 1063 | -@property(nonatomic,assign) uint32_t role; | ||
| 1064 | - | ||
| 1065 | -///自定义字段集合,key 是 NSString 类型,value 是 NSData 类型或者 NSNumber 类型(key 值按照后台配置的字符串传入) | ||
| 1066 | -@property(nonatomic,strong) NSDictionary* customInfo; | ||
| 1067 | - | ||
| 1068 | -@end | ||
| 1069 | - | ||
| 1070 | /** | 1248 | /** |
| 1071 | - * 好友 | 1249 | + * 好友生日 |
| 1072 | */ | 1250 | */ |
| 1073 | -@interface TIMFriend : TIMCodingModel | 1251 | +@property(nonatomic,assign) uint32_t birthday; |
| 1074 | 1252 | ||
| 1075 | /** | 1253 | /** |
| 1076 | - * 好友identifier | 1254 | + * 好友区域 |
| 1077 | */ | 1255 | */ |
| 1078 | -@property(nonatomic,strong) NSString *identifier; | 1256 | +@property(nonatomic,strong) NSData* location; |
| 1079 | 1257 | ||
| 1080 | /** | 1258 | /** |
| 1081 | - * 好友备注(最大96字节,获取自己资料时,该字段为空) | 1259 | + * 好友语言 |
| 1082 | */ | 1260 | */ |
| 1083 | -@property(nonatomic,strong) NSString *remark; | 1261 | +@property(nonatomic,assign) uint32_t language; |
| 1084 | 1262 | ||
| 1085 | /** | 1263 | /** |
| 1086 | - * 分组名称 NSString* 列表 | 1264 | + * 等级 |
| 1087 | */ | 1265 | */ |
| 1088 | -@property(nonatomic,strong) NSArray *groups; | 1266 | +@property(nonatomic,assign) uint32_t level; |
| 1089 | 1267 | ||
| 1090 | /** | 1268 | /** |
| 1091 | - * 申请时的添加理由 | 1269 | + * 角色 |
| 1092 | */ | 1270 | */ |
| 1093 | -@property(nonatomic,strong) NSString *addWording; | 1271 | +@property(nonatomic,assign) uint32_t role; |
| 1094 | 1272 | ||
| 1095 | /** | 1273 | /** |
| 1096 | - * 申请时的添加来源 | 1274 | + * 好友分组名称 NSString* 列表 |
| 1097 | */ | 1275 | */ |
| 1098 | -@property(nonatomic,strong) NSString *addSource; | 1276 | +@property(nonatomic,strong) NSArray* friendGroups; |
| 1099 | 1277 | ||
| 1100 | /** | 1278 | /** |
| 1101 | - * 添加时间 | 1279 | + * 自定义字段集合,key是NSString类型,value是NSData类型或者NSNumber类型 |
| 1280 | + * (key值按照后台配置的字符串传入) | ||
| 1102 | */ | 1281 | */ |
| 1103 | -@property(nonatomic,assign) uint64_t addTime; | ||
| 1104 | - | ||
| 1105 | -///自定义字段集合,key 是 NSString 类型,value 是 NSData 类型或者 NSNumber 类型(key 值按照后台配置的字符串传入) | ||
| 1106 | @property(nonatomic,strong) NSDictionary* customInfo; | 1282 | @property(nonatomic,strong) NSDictionary* customInfo; |
| 1107 | 1283 | ||
| 1108 | -///好友资料 | ||
| 1109 | -@property(nonatomic,strong) TIMUserProfile *profile; | ||
| 1110 | - | ||
| 1111 | @end | 1284 | @end |
| 1112 | 1285 | ||
| 1113 | #endif | 1286 | #endif |
| @@ -9,101 +9,84 @@ | @@ -9,101 +9,84 @@ | ||
| 9 | #ifndef TIMConversation_h | 9 | #ifndef TIMConversation_h |
| 10 | #define TIMConversation_h | 10 | #define TIMConversation_h |
| 11 | 11 | ||
| 12 | -#import "TIMConversation.h" | 12 | +#import "ImSDK.h" |
| 13 | #import "TIMMessage+MsgExt.h" | 13 | #import "TIMMessage+MsgExt.h" |
| 14 | 14 | ||
| 15 | @interface TIMConversation (MsgExt) | 15 | @interface TIMConversation (MsgExt) |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | - * 保存会话消息 | ||
| 19 | - * | ||
| 20 | - * 保存消息到消息列表,这里只保存在本地。 | 18 | + * 保存消息到消息列表,这里只保存在本地 |
| 21 | * | 19 | * |
| 22 | * @param msg 消息体 | 20 | * @param msg 消息体 |
| 23 | * @param sender 发送方 | 21 | * @param sender 发送方 |
| 24 | * @param isReaded 是否已读,如果发送方是自己,默认已读 | 22 | * @param isReaded 是否已读,如果发送方是自己,默认已读 |
| 25 | * | 23 | * |
| 26 | - * @return 0:成功;1:失败 | 24 | + * @return 0 成功 |
| 27 | */ | 25 | */ |
| 28 | - (int)saveMessage:(TIMMessage*)msg sender:(NSString*)sender isReaded:(BOOL)isReaded; | 26 | - (int)saveMessage:(TIMMessage*)msg sender:(NSString*)sender isReaded:(BOOL)isReaded; |
| 29 | 27 | ||
| 30 | /** | 28 | /** |
| 31 | - * 获取会话漫游消息 | ||
| 32 | - * | ||
| 33 | - * 1. 登录后可以获取漫游消息,单聊和群聊消息免费漫游7天,用户有额外消息漫游需求时,可前往 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 消息 ->消息漫游时长 购买,具体资费请参考 [价格说明](https://cloud.tencent.com/document/product/269/11673)。 | ||
| 34 | - * 2. 如果本地消息全部都是连续的,则不会通过网络获取,如果本地消息不连续,会通过网络获取断层消息。 | ||
| 35 | - * 3. 对于图片、语音等资源类消息,消息体只会包含描述信息,需要通过额外的接口下载数据,详情请参考 [消息收发](https://cloud.tencent.com/document/product/269/9150)中的 "消息解析" 部分文档。 | 29 | + * 获取会话消息 |
| 36 | * | 30 | * |
| 37 | * @param count 获取数量 | 31 | * @param count 获取数量 |
| 38 | - * @param last 上次最后一条消息,如果 last 为 nil,从最新的消息开始读取 | 32 | + * @param last 上次最后一条消息 |
| 39 | * @param succ 成功时回调 | 33 | * @param succ 成功时回调 |
| 40 | * @param fail 失败时回调 | 34 | * @param fail 失败时回调 |
| 41 | * | 35 | * |
| 42 | - * @return 0:本次操作成功;1:本次操作失败 | 36 | + * @return 0 本次操作成功 |
| 43 | */ | 37 | */ |
| 44 | - (int)getMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | 38 | - (int)getMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; |
| 45 | 39 | ||
| 46 | /** | 40 | /** |
| 47 | - * 向前获取会话漫游消息 | ||
| 48 | - * | ||
| 49 | - * 调用方式和 getMessage 一样,区别是 getMessage 获取的是时间更老的消息,主要用于下拉 Tableview 刷新消息数据,getMessageForward 获取的是时间更新的消息,主要用于上拉 Tableview 刷新消息数据。 | 41 | + * 向前获取会话消息 |
| 50 | * | 42 | * |
| 51 | * @param count 获取数量 | 43 | * @param count 获取数量 |
| 52 | - * @param last 上次最后一条消息,如果 last 为 nil,从最新的消息开始读取 | 44 | + * @param last 上次最后一条消息 |
| 53 | * @param succ 成功时回调 | 45 | * @param succ 成功时回调 |
| 54 | * @param fail 失败时回调 | 46 | * @param fail 失败时回调 |
| 55 | * | 47 | * |
| 56 | - * @return 0:本次操作成功;1:本次操作失败 | 48 | + * @return 0 本次操作成功 |
| 57 | */ | 49 | */ |
| 58 | - (int)getMessageForward:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | 50 | - (int)getMessageForward:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; |
| 59 | 51 | ||
| 60 | /** | 52 | /** |
| 61 | * 获取本地会话消息 | 53 | * 获取本地会话消息 |
| 62 | * | 54 | * |
| 63 | - * 1. 对于单聊,登录后可以获取本地缓存消息 | ||
| 64 | - * 2. 对于群组,开启最近联系人漫游(登录之后 SDK 默认开启,可以通过 TIMUserConfig 里面的 disableRecnetContact 关闭)的情况下,登录后只能获取最近一条消息,可通过 getMessage 获取漫游消息 | ||
| 65 | - * | ||
| 66 | * @param count 获取数量 | 55 | * @param count 获取数量 |
| 67 | * @param last 上次最后一条消息 | 56 | * @param last 上次最后一条消息 |
| 68 | * @param succ 成功时回调 | 57 | * @param succ 成功时回调 |
| 69 | * @param fail 失败时回调 | 58 | * @param fail 失败时回调 |
| 70 | * | 59 | * |
| 71 | - * @return 0:本次操作成功;1:本次操作失败 | 60 | + * @return 0 本次操作成功 |
| 72 | */ | 61 | */ |
| 73 | - (int)getLocalMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | 62 | - (int)getLocalMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; |
| 74 | 63 | ||
| 75 | /** | 64 | /** |
| 76 | - * 获取指定会话消息 | 65 | + * 获取会话消息 |
| 77 | * | 66 | * |
| 78 | * @param locators 消息定位符(TIMMessageLocator)数组 | 67 | * @param locators 消息定位符(TIMMessageLocator)数组 |
| 79 | * @param succ 成功时回调 | 68 | * @param succ 成功时回调 |
| 80 | * @param fail 失败时回调 | 69 | * @param fail 失败时回调 |
| 81 | * | 70 | * |
| 82 | - * @return 0:本次操作成功;1:本次操作失败 | 71 | + * @return 0 本次操作成功 |
| 83 | */ | 72 | */ |
| 84 | - (int)findMessages:(NSArray*)locators succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | 73 | - (int)findMessages:(NSArray*)locators succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; |
| 85 | 74 | ||
| 86 | /** | 75 | /** |
| 87 | - * 撤回消息 | ||
| 88 | - * | ||
| 89 | - * 1. 仅 C2C 和 GROUP 会话有效、onlineMessage 无效、AVChatRoom 和 BChatRoom 无效。 | ||
| 90 | - * 2. 可以在 TIMUserConfig 设置的 TIMMessageRevokeListener 监听 onRevokeMessage 消息撤回回调。 | ||
| 91 | - * 3. 遍历本地消息列表,如果消息的 respondsToLocator 函数返回 YES,则是对应的消息,您可以在 UI 上执行删除操作,具体可以参考 TMessageController.h 里面的 onRevokeMessage 回调的实现。 | 76 | + * 撤回消息(仅C2C和GROUP会话有效、onlineMessage无效、AVChatRoom和BChatRoom无效) |
| 92 | * | 77 | * |
| 93 | * @param msg 被撤回的消息 | 78 | * @param msg 被撤回的消息 |
| 94 | * @param succ 成功时回调 | 79 | * @param succ 成功时回调 |
| 95 | * @param fail 失败时回调 | 80 | * @param fail 失败时回调 |
| 96 | * | 81 | * |
| 97 | - * @return 0:本次操作成功;1:本次操作失败 | 82 | + * @return 0 本次操作成功 |
| 98 | */ | 83 | */ |
| 99 | - (int)revokeMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | 84 | - (int)revokeMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 100 | 85 | ||
| 101 | /** | 86 | /** |
| 102 | - * 同步群的消息撤回通知 | 87 | + * 同步本会话的消息撤回通知(仅GROUP会话有效) |
| 103 | * | 88 | * |
| 104 | - * 针对群组,断线重连后,如果用户处于群组聊天界面,需要业务端主动同步该群组会话的消息撤回通知。其他场景不需要主动同步消息撤回通知。 | ||
| 105 | - * | ||
| 106 | - * @param succ 成功时回调,同步的通知会通过 TIMMessageRevokeListener 抛出 | 89 | + * @param succ 成功时回调,同步的通知会通过TIMMessageRevokeListener抛出 |
| 107 | * @param fail 失败时回调 | 90 | * @param fail 失败时回调 |
| 108 | * | 91 | * |
| 109 | * @return 0 本次操作成功 | 92 | * @return 0 本次操作成功 |
| @@ -113,8 +96,6 @@ | @@ -113,8 +96,6 @@ | ||
| 113 | /** | 96 | /** |
| 114 | * 删除本地会话消息 | 97 | * 删除本地会话消息 |
| 115 | * | 98 | * |
| 116 | - * 可以在保留会话同时删除本地的会话消息。 | ||
| 117 | - * | ||
| 118 | * @param succ 成功时回调 | 99 | * @param succ 成功时回调 |
| 119 | * @param fail 失败时回调 | 100 | * @param fail 失败时回调 |
| 120 | * | 101 | * |
| @@ -125,11 +106,7 @@ | @@ -125,11 +106,7 @@ | ||
| 125 | /** | 106 | /** |
| 126 | * 设置已读消息 | 107 | * 设置已读消息 |
| 127 | * | 108 | * |
| 128 | - * 1. 如果在 TIMUserConfig 关闭了自动已读上报(设置 disableAutoReport 为 YES),这里需要显示调用 setReadMessage ,消息的已读状态才会改变。 | ||
| 129 | - * 2. 如果在 TIMUserConfig 开启了消息回执(设置 enableReadReceipt 为 YES),收消息的用户需要显示调用 setReadMessage ,发消息的用户才能通过 TIMMessageReceiptListener 监听到消息的已读回执。 | ||
| 130 | - * 3. 如果您需要设置单条消息的已读状态,请使用 TIMMessage+MsgExt.h 中的 setCustomInt 自定义字段接口设置,通过 customInt 获取,需要注意的是,这个接口设置的字段只在本地保存,如果切换了终端,或则 APP 被卸载,这个值都会失效。 | ||
| 131 | - * | ||
| 132 | - * @param readed 会话内最近一条已读的消息,nil 表示上报最新消息 | 109 | + * @param readed 会话内最近一条已读的消息,nil表示上报最新消息 |
| 133 | * | 110 | * |
| 134 | * @param succ 成功时回调 | 111 | * @param succ 成功时回调 |
| 135 | * @param fail 失败时回调 | 112 | * @param fail 失败时回调 |
| @@ -139,10 +116,7 @@ | @@ -139,10 +116,7 @@ | ||
| 139 | - (int)setReadMessage:(TIMMessage*)readed succ:(TIMSucc)succ fail:(TIMFail)fail; | 116 | - (int)setReadMessage:(TIMMessage*)readed succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 140 | 117 | ||
| 141 | /** | 118 | /** |
| 142 | - * 获取会话的未读计数 | ||
| 143 | - * | ||
| 144 | - * 1. 单终端,未卸载 APP 的情况下,您可以通过当前接口获取准确的未读计数。 | ||
| 145 | - * 2. 如果需要在多终端或则程序 APP 卸载重装后未读计数依然准确,请设置 TIMUserConfig 的 disableAutoReport 为 YES,然后显示调用 setReadMessage。详情请参考 [未读消息计数](https://cloud.tencent.com/document/product/269/9151) | 119 | + * 获取该会话的未读计数 |
| 146 | * | 120 | * |
| 147 | * @return 返回未读计数 | 121 | * @return 返回未读计数 |
| 148 | */ | 122 | */ |
| @@ -160,33 +134,29 @@ | @@ -160,33 +134,29 @@ | ||
| 160 | * | 134 | * |
| 161 | * @param msgs 消息(TIMMessage*)列表 | 135 | * @param msgs 消息(TIMMessage*)列表 |
| 162 | * | 136 | * |
| 163 | - * @return 0:成功;1:失败 | 137 | + * @return 0 成功 |
| 164 | */ | 138 | */ |
| 165 | - (int)importMessages:(NSArray*)msgs; | 139 | - (int)importMessages:(NSArray*)msgs; |
| 166 | 140 | ||
| 167 | /** | 141 | /** |
| 168 | * 设置会话草稿 | 142 | * 设置会话草稿 |
| 169 | * | 143 | * |
| 170 | - * UI 展示最近联系人列表时,时常会展示用户的草稿内容,ImSDK 提供了设置和获取草稿的接口,用户可以通过此接口设置会话的草稿信息。草稿信息会存本地数据库,重新登录后依然可以获取。 | 144 | + * @param draft 草稿内容 |
| 171 | * | 145 | * |
| 172 | - * @param draft 草稿内容,详情请参考 TIMMessage+MsgExt.h 里面的 TIMMessageDraft 定义 | ||
| 173 | - * | ||
| 174 | - * @return 0:成功;1:失败 | 146 | + * @return 0 成功 |
| 175 | */ | 147 | */ |
| 176 | - (int)setDraft:(TIMMessageDraft*)draft; | 148 | - (int)setDraft:(TIMMessageDraft*)draft; |
| 177 | 149 | ||
| 178 | /** | 150 | /** |
| 179 | * 获取会话草稿 | 151 | * 获取会话草稿 |
| 180 | * | 152 | * |
| 181 | - * @return 草稿内容,没有草稿返回 nil | 153 | + * @return 草稿内容,没有草稿返回nil |
| 182 | */ | 154 | */ |
| 183 | - (TIMMessageDraft*)getDraft; | 155 | - (TIMMessageDraft*)getDraft; |
| 184 | 156 | ||
| 185 | /** | 157 | /** |
| 186 | - * 禁用本会话的存储(暂未实现) | ||
| 187 | - * | ||
| 188 | - * 1. 需要 initSdk 之后调用 | ||
| 189 | - * 2. 只对当前初始化有效,重启后需要重新设置 | 158 | + * 禁用本会话的存储,只对当前初始化有效,重启后需要重新设置 |
| 159 | + * 需要 initSdk 之后调用 | ||
| 190 | */ | 160 | */ |
| 191 | - (void)disableStorage; | 161 | - (void)disableStorage; |
| 192 | 162 |
| @@ -22,45 +22,34 @@ | @@ -22,45 +22,34 @@ | ||
| 22 | /** | 22 | /** |
| 23 | * 发送消息 | 23 | * 发送消息 |
| 24 | * | 24 | * |
| 25 | - * TIMMessage 由多个 TIMElem 组成,每个 TIMElem 可以是文本和图片,也就是说每一条消息可包含多个文本和多张图片。详情请参考官网文档 [消息收发](https://cloud.tencent.com/document/product/269/9150) | ||
| 26 | - * | ||
| 27 | * @param msg 消息体 | 25 | * @param msg 消息体 |
| 28 | * @param succ 发送成功时回调 | 26 | * @param succ 发送成功时回调 |
| 29 | * @param fail 发送失败时回调 | 27 | * @param fail 发送失败时回调 |
| 30 | * | 28 | * |
| 31 | - * @return 0:操作成功;1:操作失败 | 29 | + * @return 0 本次操作成功 |
| 32 | */ | 30 | */ |
| 33 | - (int)sendMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | 31 | - (int)sendMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 34 | 32 | ||
| 35 | /** | 33 | /** |
| 36 | * 发送在线消息(服务器不保存消息) | 34 | * 发送在线消息(服务器不保存消息) |
| 37 | * | 35 | * |
| 38 | - * 1. 对于某些场景,需要发送在线消息,即用户在线时收到消息,如果用户不在线,下次登录也不会看到消息,可用于通知类消息,这种消息不会进行存储,也不会计入未读计数。发送接口与 sendMessage 类似。 | ||
| 39 | - * 2. 暂不支持 AVChatRoom 和 BChatRoom 类型。 | ||
| 40 | - * | ||
| 41 | * @param msg 消息体 | 36 | * @param msg 消息体 |
| 42 | * @param succ 成功回调 | 37 | * @param succ 成功回调 |
| 43 | * @param fail 失败回调 | 38 | * @param fail 失败回调 |
| 44 | * | 39 | * |
| 45 | - * @return 0:操作成功;1:操作失败 | 40 | + * @return 0 成功 |
| 46 | */ | 41 | */ |
| 47 | - (int)sendOnlineMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | 42 | - (int)sendOnlineMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 48 | 43 | ||
| 49 | /** | 44 | /** |
| 50 | - * 获取会话人 | ||
| 51 | - * | ||
| 52 | - * C2C:对方账号;Group:群组Id。 | ||
| 53 | - * | ||
| 54 | - * 对同一个 C2C 会话或则群聊会话,getReceiver 获取的会话人都是固定的,C2C 获取的是对方账号,Group 获取的是群组 Id。 | 45 | + * 获取会话人,单聊为对方账号,群聊为群组Id |
| 55 | * | 46 | * |
| 56 | * @return 会话人 | 47 | * @return 会话人 |
| 57 | */ | 48 | */ |
| 58 | - (NSString*)getReceiver; | 49 | - (NSString*)getReceiver; |
| 59 | 50 | ||
| 60 | /** | 51 | /** |
| 61 | - * 获取群名称 | ||
| 62 | - * | ||
| 63 | - * 获取群名称,只有群会话有效。 | 52 | + * 获取群名称(只有群会话有效) |
| 64 | * | 53 | * |
| 65 | * @return 群名称 | 54 | * @return 群名称 |
| 66 | */ | 55 | */ |
| @@ -74,9 +63,9 @@ | @@ -74,9 +63,9 @@ | ||
| 74 | - (TIMConversationType)getType; | 63 | - (TIMConversationType)getType; |
| 75 | 64 | ||
| 76 | /** | 65 | /** |
| 77 | - * 获取自己的 id | 66 | + * 获取该会话所属用户的id |
| 78 | * | 67 | * |
| 79 | - * @return 用户 id | 68 | + * @return 用户id |
| 80 | */ | 69 | */ |
| 81 | - (NSString*)getSelfIdentifier; | 70 | - (NSString*)getSelfIdentifier; |
| 82 | 71 |
| 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 | - ERR_SUCC = 0, | ||
| 14 | - ERR_PARSE_RESPONSE_FAILED = 6001, //解析响应失败 | ||
| 15 | - ERR_SERIALIZE_REQ_FAILED = 6002, //序列化请求失败 | ||
| 16 | - ERR_NO_SUCC_RESULT = 6003, //批量操作无成功结果 | ||
| 17 | - ERR_INVALID_CONVERSATION = 6004, //IM: 无效会话 | ||
| 18 | - ERR_LOADMSG_FAILED = 6005, //IM: 加载本地消息存储失败 | ||
| 19 | - ERR_FILE_TRANS_AUTH_FAILED = 6006, //IM: 文件传输 - 鉴权失败 | ||
| 20 | - ERR_FILE_TRANS_NO_SERVER = 6007, //IM: 文件传输 - 获取svr失败 | ||
| 21 | - ERR_FILE_TRANS_UPLOAD_FAILED = 6008, //IM: 文件传输 - 上传失败 | ||
| 22 | - ERR_FILE_TRANS_DOWNLOAD_FAILED = 6009, //IM: 文件传输 - 下载失败 | ||
| 23 | - ERR_HTTP_REQ_FAILED = 6010, //HTTP请求失败 | ||
| 24 | - ERR_TO_USER_INVALID = 6011, //IM: 无效接收方 | ||
| 25 | - ERR_REQUEST_TIMEOUT = 6012, //请求超时 | ||
| 26 | - ERR_SDK_NOT_INITIALIZED = 6013, //SDK未初始化 | ||
| 27 | - ERR_SDK_NOT_LOGGED_IN = 6014, //SDK未登录 | ||
| 28 | - ERR_IN_PROGESS = 6015, //执行中 | ||
| 29 | - ERR_INVALID_MSG_ELEM = 6016, //IM: 无效消息elem | ||
| 30 | - ERR_INVALID_PARAMETERS = 6017, //API参数无效 | ||
| 31 | - ERR_INIT_CORE_FAIL = 6018, //INIT CORE模块失败 | ||
| 32 | - ERR_DATABASE_OPERATE_FAILED = 6019, //本地数据库操作失败 | ||
| 33 | - ERR_EXPIRED_SESSION_NODE = 6020, //SessionNode为null | ||
| 34 | - ERR_INVALID_SDK_OBJECT = 6021, //无效的imsdk对象,例如用户自己生成TIMImage,或内部赋值错误导致的sdk对象无效 | ||
| 35 | - ERR_IO_OPERATION_FAILED = 6022, //本地IO操作失败 | ||
| 36 | - ERR_LOGGED_OUT_BEFORE_LOGIN_FINISHED = 6023, //在登录完成前进行了登出(在登录时返回) | ||
| 37 | - ERR_TLSSDK_NOT_INITIALIZED = 6024, //tlssdk未初始化 | ||
| 38 | - ERR_TLSSDK_USER_NOT_FOUND = 6025, //TLSSDK没有找到相应的用户信息 | ||
| 39 | - ERR_NO_PREVIOUS_LOGIN = 6026, //自动登陆时并没有登陆过该用户 | ||
| 40 | - | ||
| 41 | - ERR_BIND_FAIL_UNKNOWN = 6100, //QALSDK未知原因BIND失败 | ||
| 42 | - ERR_BIND_FAIL_NO_SSOTICKET = 6101, //缺少SSO票据 | ||
| 43 | - ERR_BIND_FAIL_REPEATD_BIND = 6102, //重复BIND | ||
| 44 | - ERR_BIND_FAIL_TINYID_NULL = 6103, //tiny为空 | ||
| 45 | - ERR_BIND_FAIL_GUID_NULL = 6104, //guid为空 | ||
| 46 | - ERR_BIND_FAIL_UNPACK_REGPACK_FAILED = 6105, //解注册包失败 | ||
| 47 | - ERR_BIND_FAIL_REG_TIMEOUT = 6106, //注册超时 | ||
| 48 | - ERR_BIND_FAIL_ISBINDING = 6107, //正在bind操作中 | ||
| 49 | - | ||
| 50 | - ERR_PACKET_FAIL_UNKNOWN = 6120, //发包未知错误 | ||
| 51 | - ERR_PACKET_FAIL_REQ_NO_NET = 6121, //发送请求包时没有网络,处理时转换成ERR_REQ_NO_NET_ON_REQ | ||
| 52 | - ERR_PACKET_FAIL_RESP_NO_NET = 6122, //发送回复包时没有网络,处理时转换成ERR_REQ_NO_NET_ON_RSP | ||
| 53 | - ERR_PACKET_FAIL_REQ_NO_AUTH = 6123, //发送请求包时没有权限 | ||
| 54 | - ERR_PACKET_FAIL_SSO_ERR = 6124, //SSO错误 | ||
| 55 | - ERR_PACKET_FAIL_REQ_TIMEOUT = 6125, //请求超时,处理时转化成ERR_REQUEST_TIMEOUT | ||
| 56 | - ERR_PACKET_FAIL_RESP_TIMEOUT = 6126, //回复超时,处理时转化成ERR_REQUEST_TIMEOUT | ||
| 57 | - ERR_PACKET_FAIL_REQ_ON_RESEND = 6127, // | ||
| 58 | - ERR_PACKET_FAIL_RESP_NO_RESEND = 6128, // | ||
| 59 | - ERR_PACKET_FAIL_FLOW_SAVE_FILTERED = 6129, // | ||
| 60 | - ERR_PACKET_FAIL_REQ_OVER_LOAD = 6130, // | ||
| 61 | - ERR_PACKET_FAIL_LOGIC_ERR = 6131, | ||
| 62 | - | ||
| 63 | - ERR_FRIENDSHIP_PROXY_NOT_SYNCED = 6150, // proxy_manager没有完成svr数据同步 | ||
| 64 | - ERR_FRIENDSHIP_PROXY_SYNCING = 6151, // proxy_manager正在进行svr数据同步 | ||
| 65 | - ERR_FRIENDSHIP_PROXY_SYNCED_FAIL = 6152, // proxy_manager同步失败 | ||
| 66 | - ERR_FRIENDSHIP_PROXY_LOCAL_CHECK_ERR = 6153, // proxy_manager请求参数,在本地检查不合法 | ||
| 67 | - | ||
| 68 | - ERR_GROUP_INVALID_FIELD = 6160, // group assistant请求字段中包含非预设字段 | ||
| 69 | - ERR_GROUP_STORAGE_DISABLED = 6161, // group assistant群资料本地存储没有开启 | ||
| 70 | - ERR_LOADGRPINFO_FAILED = 6162, // failed to load groupinfo from storage | ||
| 71 | - | ||
| 72 | - ERR_REQ_NO_NET_ON_REQ = 6200, // 请求的时候没有网络 | ||
| 73 | - ERR_REQ_NO_NET_ON_RSP = 6201, // 响应的时候没有网络 | ||
| 74 | - ERR_SERIVCE_NOT_READY = 6205, // QALSDK服务未就绪 | ||
| 75 | - ERR_USER_SIG_EXPIRED = 6206, // 票据过期 | ||
| 76 | - ERR_LOGIN_AUTH_FAILED = 6207, // 账号认证失败(tinyid转换失败) | ||
| 77 | - ERR_LOGIN_KICKED_OFF_BY_OTHER = 6208, // 账号被踢 | ||
| 78 | - ERR_NEVER_CONNECT_AFTER_LAUNCH = 6209, // 在应用启动后没有尝试联网 | ||
| 79 | - | ||
| 80 | - ERR_REQ_FAILED = 6210, // QAL执行失败 | ||
| 81 | - ERR_REQ_INVALID_REQ = 6211, // 请求非法,toMsgService非法 | ||
| 82 | - ERR_REQ_OVERLOADED = 6212, // 请求队列満 | ||
| 83 | - ERR_REQ_KICK_OFF = 6213, // 已经被其他终端踢了 | ||
| 84 | - ERR_REQ_SERVICE_SUSPEND = 6214, // 服务被暂停 | ||
| 85 | - ERR_REQ_INVALID_SIGN = 6215, // SSO签名错误 | ||
| 86 | - ERR_REQ_INVALID_COOKIE = 6216, // SSO cookie无效 | ||
| 87 | - ERR_LOGIN_TLS_RSP_PARSE_FAILED = 6217, // 登录时TLS回包校验,包体长度错误 | ||
| 88 | - ERR_LOGIN_OPENMSG_TIMEOUT = 6218, // 登录时OPENSTATSVC向OPENMSG上报状态超时 | ||
| 89 | - ERR_LOGIN_OPENMSG_RSP_PARSE_FAILED = 6219, // 登录时OPENSTATSVC向OPENMSG上报状态时解析回包失败 | ||
| 90 | - ERR_LOGIN_TLS_DECRYPT_FAILED = 6220, // 登录时TLS解密失败 | ||
| 91 | - ERR_WIFI_NEED_AUTH = 6221, // wifi需要认证 | ||
| 92 | - | ||
| 93 | - ERR_USER_CANCELED = 6222, // 用户已取消 | ||
| 94 | - | ||
| 95 | - ERR_REVOKE_TIME_LIMIT_EXCEED = 6223, //消息撤回超过了时间限制(默认2分钟) | ||
| 96 | - ERR_LACK_UGC_EXT = 6224, // 缺少UGC扩展包 | ||
| 97 | - ERR_AUTOLOGIN_NEED_USERSIG = 6226, //自动登录,本地票据过期,需要userSig手动登录 | ||
| 98 | - | ||
| 99 | - | ||
| 100 | - ERR_REQ_CONTENT_ATTACK = 80001, // 消息内容安全打击 | ||
| 101 | - | ||
| 102 | - ERR_LOGIN_SIG_EXPIRE = 70001, // 登陆返回,票据过期 | ||
| 103 | - | ||
| 104 | - ERR_SDK_HAD_INITIALIZED = 90001, // SDK 已经初始化无需重复初始化 | ||
| 105 | - ERR_OPENBDH_BASE = 115000, // openbdh 错误码基 | ||
| 106 | -}; | ||
| 107 | - | ||
| 108 | -#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 TIMFriendMetaInfo; | ||
| 15 | -@class TIMFriendPendencyResponse; | ||
| 16 | -@class TIMFriendPendencyItem; | ||
| 17 | -@class TIMFriendFutureMeta; | ||
| 18 | -@class TIMFriendGroup; | ||
| 19 | - | ||
| 20 | -#pragma mark - 枚举类型 | ||
| 21 | - | ||
| 22 | -/** | ||
| 23 | - * 好友操作状态 | ||
| 24 | - */ | ||
| 25 | -typedef NS_ENUM(NSInteger, TIMFriendStatus) { | ||
| 26 | - /** | ||
| 27 | - * 操作成功 | ||
| 28 | - */ | ||
| 29 | - TIM_FRIEND_STATUS_SUCC = 0, | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 加好友、响应好友时有效:自己的好友数已达系统上限 | ||
| 33 | - */ | ||
| 34 | - TIM_ADD_FRIEND_STATUS_SELF_FRIEND_FULL = 30010, | ||
| 35 | - | ||
| 36 | - /** | ||
| 37 | - * 更新好友分组时有效:分组已达系统上限 | ||
| 38 | - */ | ||
| 39 | - TIM_UPDATE_FRIEND_GROUP_STATUS_MAX_GROUPS_EXCEED = 30011, | ||
| 40 | - | ||
| 41 | - /** | ||
| 42 | - * 加好友、响应好友时有效:对方的好友数已达系统上限 | ||
| 43 | - */ | ||
| 44 | - TIM_ADD_FRIEND_STATUS_THEIR_FRIEND_FULL = 30014, | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 加好友时有效:被加好友在自己的黑名单中 | ||
| 48 | - */ | ||
| 49 | - TIM_ADD_FRIEND_STATUS_IN_SELF_BLACK_LIST = 30515, | ||
| 50 | - | ||
| 51 | - /** | ||
| 52 | - * 加好友时有效:被加好友设置为禁止加好友 | ||
| 53 | - */ | ||
| 54 | - TIM_ADD_FRIEND_STATUS_FRIEND_SIDE_FORBID_ADD = 30516, | ||
| 55 | - | ||
| 56 | - /** | ||
| 57 | - * 加好友时有效:已被被添加好友设置为黑名单 | ||
| 58 | - */ | ||
| 59 | - TIM_ADD_FRIEND_STATUS_IN_OTHER_SIDE_BLACK_LIST = 30525, | ||
| 60 | - | ||
| 61 | - /** | ||
| 62 | - * 加好友时有效:对方好友列表已满 | ||
| 63 | - */ | ||
| 64 | - TIM_ADD_FRIEND_STATUS_OTHER_SIDE_FRIEND_LIST_FULL = 30535, | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * 加好友时有效:等待好友审核同意 | ||
| 68 | - */ | ||
| 69 | - TIM_ADD_FRIEND_STATUS_PENDING = 30539, | ||
| 70 | - | ||
| 71 | - /** | ||
| 72 | - * 删除好友时有效:删除好友时对方不是好友 | ||
| 73 | - */ | ||
| 74 | - TIM_DEL_FRIEND_STATUS_NO_FRIEND = 31704, | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | - * 响应好友申请时有效:对方没有申请过好友 | ||
| 78 | - */ | ||
| 79 | - TIM_RESPONSE_FRIEND_STATUS_NO_REQ = 30614, | ||
| 80 | - | ||
| 81 | - /** | ||
| 82 | - * 添加黑名单有效:已经在黑名单了 | ||
| 83 | - */ | ||
| 84 | - TIM_ADD_BLACKLIST_FRIEND_STATUS_IN_BLACK_LIST = 31307, | ||
| 85 | - | ||
| 86 | - /** | ||
| 87 | - * 删除黑名单有效:用户不在黑名单里 | ||
| 88 | - */ | ||
| 89 | - TIM_DEL_BLACKLIST_FRIEND_STATUS_NOT_IN_BLACK_LIST = 31503, | ||
| 90 | - | ||
| 91 | - /** | ||
| 92 | - * 创建好友分组时有效:没有拉到SDKAppId | ||
| 93 | - */ | ||
| 94 | - TIM_ADD_FRIEND_GROUP_STATUS_GET_SDKAPPID_FAILED = 32207, | ||
| 95 | - | ||
| 96 | - /** | ||
| 97 | - * 创建好友分组时有效:要加入到好友分组中的用户不是好友 | ||
| 98 | - */ | ||
| 99 | - TIM_ADD_FRIEND_GROUP_STATUS_NOT_FRIEND = 32216, | ||
| 100 | - | ||
| 101 | - /** | ||
| 102 | - * 更新好友分组时有效:没有拉到SDKAppId | ||
| 103 | - */ | ||
| 104 | - TIM_UPDATE_FRIEND_GROUP_STATUS_GET_SDKAPPID_FAILED = 32511, | ||
| 105 | - | ||
| 106 | - /** | ||
| 107 | - * 更新好友分组时有效:要加入到好友分组中的用户不是好友 | ||
| 108 | - */ | ||
| 109 | - TIM_UPDATE_FRIEND_GROUP_STATUS_ADD_NOT_FRIEND = 32518, | ||
| 110 | - | ||
| 111 | - /** | ||
| 112 | - * 更新好友分组时有效:要加入到好友分组中的好友已经在分组中 | ||
| 113 | - */ | ||
| 114 | - TIM_UPDATE_FRIEND_GROUP_STATUS_ADD_ALREADY_IN_GROUP = 32519, | ||
| 115 | - | ||
| 116 | - /** | ||
| 117 | - * 更新好友分组时有效:要从好友分组中删除的好友不在好友分组中 | ||
| 118 | - */ | ||
| 119 | - TIM_UPDATE_FRIEND_GROUP_STATUS_DEL_NOT_IN_GROUP = 32520, | ||
| 120 | - | ||
| 121 | - | ||
| 122 | -}; | ||
| 123 | - | ||
| 124 | -typedef NS_ENUM(NSInteger, TIMDelFriendType) { | ||
| 125 | - /** | ||
| 126 | - * 删除单向好友 | ||
| 127 | - */ | ||
| 128 | - TIM_FRIEND_DEL_SINGLE = 1, | ||
| 129 | - | ||
| 130 | - /** | ||
| 131 | - * 删除双向好友 | ||
| 132 | - */ | ||
| 133 | - TIM_FRIEND_DEL_BOTH = 2, | ||
| 134 | -}; | ||
| 135 | - | ||
| 136 | -typedef NS_ENUM(NSInteger, TIMPendencyType) { | ||
| 137 | - /** | ||
| 138 | - * 别人发给我的 | ||
| 139 | - */ | ||
| 140 | - TIM_PENDENCY_COME_IN = 1, | ||
| 141 | - | ||
| 142 | - /** | ||
| 143 | - * 我发给别人的 | ||
| 144 | - */ | ||
| 145 | - TIM_PENDENCY_SEND_OUT = 2, | ||
| 146 | - | ||
| 147 | - /** | ||
| 148 | - * 别人发给我的 和 我发给别人的。仅拉取时有效 | ||
| 149 | - */ | ||
| 150 | - TIM_PENDENCY_BOTH = 3, | ||
| 151 | -}; | ||
| 152 | - | ||
| 153 | -/** | ||
| 154 | - * 推荐好友类型 | ||
| 155 | - */ | ||
| 156 | -typedef NS_ENUM(NSInteger, TIMFutureFriendType) { | ||
| 157 | - /** | ||
| 158 | - * 收到的未决请求 | ||
| 159 | - */ | ||
| 160 | - TIM_FUTURE_FRIEND_PENDENCY_IN_TYPE = 0x1, | ||
| 161 | - | ||
| 162 | - /** | ||
| 163 | - * 发出去的未决请求 | ||
| 164 | - */ | ||
| 165 | - TIM_FUTURE_FRIEND_PENDENCY_OUT_TYPE = 0x2, | ||
| 166 | - | ||
| 167 | - /** | ||
| 168 | - * 推荐好友 | ||
| 169 | - */ | ||
| 170 | - TIM_FUTURE_FRIEND_RECOMMEND_TYPE = 0x4, | ||
| 171 | - | ||
| 172 | - /** | ||
| 173 | - * 已决好友 | ||
| 174 | - */ | ||
| 175 | - TIM_FUTURE_FRIEND_DECIDE_TYPE = 0x8, | ||
| 176 | -}; | ||
| 177 | - | ||
| 178 | -/** | ||
| 179 | - * 翻页选项 | ||
| 180 | - */ | ||
| 181 | -typedef NS_ENUM(NSInteger, TIMPageDirectionType) { | ||
| 182 | - /** | ||
| 183 | - * 向上翻页 | ||
| 184 | - */ | ||
| 185 | - TIM_PAGE_DIRECTION_UP_TYPE = 1, | ||
| 186 | - | ||
| 187 | - /** | ||
| 188 | - * 向下翻页 | ||
| 189 | - */ | ||
| 190 | - TIM_PAGE_DIRECTION_DOWN_TYPE = 2, | ||
| 191 | -}; | ||
| 192 | - | ||
| 193 | -/** | ||
| 194 | - * 好友检查类型 | ||
| 195 | - */ | ||
| 196 | -typedef NS_ENUM(NSInteger,TIMFriendCheckType) { | ||
| 197 | - /** | ||
| 198 | - * 单向好友 | ||
| 199 | - */ | ||
| 200 | - TIM_FRIEND_CHECK_TYPE_UNIDIRECTION = 0x1, | ||
| 201 | - /** | ||
| 202 | - * 互为好友 | ||
| 203 | - */ | ||
| 204 | - TIM_FRIEND_CHECK_TYPE_BIDIRECTION = 0x2, | ||
| 205 | -}; | ||
| 206 | - | ||
| 207 | -/** | ||
| 208 | - * 好友关系类型 | ||
| 209 | - */ | ||
| 210 | -typedef NS_ENUM(NSInteger,TIMFriendRelationType) { | ||
| 211 | - /** | ||
| 212 | - * 不是好友 | ||
| 213 | - */ | ||
| 214 | - TIM_FRIEND_RELATION_TYPE_NONE = 0x0, | ||
| 215 | - /** | ||
| 216 | - * 对方在我的好友列表中 | ||
| 217 | - */ | ||
| 218 | - TIM_FRIEND_RELATION_TYPE_MY_UNI = 0x1, | ||
| 219 | - /** | ||
| 220 | - * 我在对方的好友列表中 | ||
| 221 | - */ | ||
| 222 | - TIM_FRIEND_RELATION_TYPE_OTHER_UNI = 0x2, | ||
| 223 | - /** | ||
| 224 | - * 互为好友 | ||
| 225 | - */ | ||
| 226 | - TIM_FRIEND_RELATION_TYPE_BOTH = 0x3, | ||
| 227 | -}; | ||
| 228 | - | ||
| 229 | -typedef NS_ENUM(NSInteger, TIMFriendResponseType) { | ||
| 230 | - /** | ||
| 231 | - * 同意加好友(建立单向好友) | ||
| 232 | - */ | ||
| 233 | - TIM_FRIEND_RESPONSE_AGREE = 0, | ||
| 234 | - | ||
| 235 | - /** | ||
| 236 | - * 同意加好友并加对方为好友(建立双向好友) | ||
| 237 | - */ | ||
| 238 | - TIM_FRIEND_RESPONSE_AGREE_AND_ADD = 1, | ||
| 239 | - | ||
| 240 | - /** | ||
| 241 | - * 拒绝对方好友请求 | ||
| 242 | - */ | ||
| 243 | - TIM_FRIEND_RESPONSE_REJECT = 2, | ||
| 244 | -}; | ||
| 245 | - | ||
| 246 | -#pragma mark - block回调 | ||
| 247 | - | ||
| 248 | -/** | ||
| 249 | - * 获取好友列表回调 | ||
| 250 | - * | ||
| 251 | - * @param meta 好友元信息 | ||
| 252 | - * @param friends 好友列表 TIMUserProfile* 数组,只包含需要的字段 | ||
| 253 | - */ | ||
| 254 | -typedef void (^TIMGetFriendListByPageSucc)(TIMFriendMetaInfo * meta, NSArray * friends); | ||
| 255 | - | ||
| 256 | -/** | ||
| 257 | - * 获取未决请求列表成功 | ||
| 258 | - * | ||
| 259 | - * @param pendencyResponse 未决请求元信息 | ||
| 260 | - */ | ||
| 261 | -typedef void (^TIMGetFriendPendencyListSucc)(TIMFriendPendencyResponse *pendencyResponse); | ||
| 262 | - | ||
| 263 | -/** | ||
| 264 | - * 群搜索回调 | ||
| 265 | - * | ||
| 266 | - * @param totalNum 搜索结果的总数 | ||
| 267 | - * @param users 请求的用户列表片段 | ||
| 268 | - */ | ||
| 269 | -typedef void (^TIMUserSearchSucc)(uint64_t totalNum, NSArray * users); | ||
| 270 | - | ||
| 271 | -/** | ||
| 272 | - * 好友分组列表 | ||
| 273 | - * | ||
| 274 | - * @param groups 好友分组(TIMFriendGroup*)列表 | ||
| 275 | - */ | ||
| 276 | -typedef void (^TIMFriendGroupArraySucc)(NSArray<TIMFriendGroup *> * groups); | ||
| 277 | - | ||
| 278 | -/** | ||
| 279 | - * 好友关系检查回调 | ||
| 280 | - * | ||
| 281 | - * @param results TIMCheckFriendResult列表 | ||
| 282 | - */ | ||
| 283 | -typedef void (^TIMFriendCheckSucc)(NSArray* results); | ||
| 284 | - | ||
| 285 | -#pragma mark - 基本类型 | ||
| 286 | - | ||
| 287 | -/** | ||
| 288 | - * 加好友请求 | ||
| 289 | - */ | ||
| 290 | -@interface TIMFriendRequest : TIMCodingModel | ||
| 291 | - | ||
| 292 | -/** | ||
| 293 | - * 用户identifier(必填) | ||
| 294 | - */ | ||
| 295 | -@property (nonatomic,strong) NSString* identifier; | ||
| 296 | - | ||
| 297 | -/** | ||
| 298 | - * 备注(备注最大96字节) | ||
| 299 | - */ | ||
| 300 | -@property (nonatomic,strong) NSString* remark; | ||
| 301 | - | ||
| 302 | -/** | ||
| 303 | - * 请求说明(最大120字节) | ||
| 304 | - */ | ||
| 305 | -@property (nonatomic,strong) NSString* addWording; | ||
| 306 | - | ||
| 307 | -/** | ||
| 308 | - * 添加来源 | ||
| 309 | - * 来源需要添加“AddSource_Type_”前缀 | ||
| 310 | - */ | ||
| 311 | -@property (nonatomic,strong) NSString* addSource; | ||
| 312 | - | ||
| 313 | -/** | ||
| 314 | - * 分组 | ||
| 315 | - */ | ||
| 316 | -@property (nonatomic,strong) NSString* group; | ||
| 317 | - | ||
| 318 | -@end | ||
| 319 | - | ||
| 320 | -/** | ||
| 321 | - * 未决请求 | ||
| 322 | - */ | ||
| 323 | -@interface TIMFriendPendencyItem : TIMCodingModel | ||
| 324 | - | ||
| 325 | -/** | ||
| 326 | - * 用户标识 | ||
| 327 | - */ | ||
| 328 | -@property(nonatomic,strong) NSString* identifier; | ||
| 329 | -/** | ||
| 330 | - * 增加时间 | ||
| 331 | - */ | ||
| 332 | -@property(nonatomic,assign) uint64_t addTime; | ||
| 333 | -/** | ||
| 334 | - * 来源 | ||
| 335 | - */ | ||
| 336 | -@property(nonatomic,strong) NSString* addSource; | ||
| 337 | -/** | ||
| 338 | - * 加好友附言 | ||
| 339 | - */ | ||
| 340 | -@property(nonatomic,strong) NSString* addWording; | ||
| 341 | - | ||
| 342 | -/** | ||
| 343 | - * 加好友昵称 | ||
| 344 | - */ | ||
| 345 | -@property(nonatomic,strong) NSString* nickname; | ||
| 346 | - | ||
| 347 | -/** | ||
| 348 | - * 未决请求类型 | ||
| 349 | - */ | ||
| 350 | -@property(nonatomic,assign) TIMPendencyType type; | ||
| 351 | - | ||
| 352 | -@end | ||
| 353 | - | ||
| 354 | -/** | ||
| 355 | - * 未决推送 | ||
| 356 | - */ | ||
| 357 | -@interface TIMFriendPendencyInfo : TIMCodingModel | ||
| 358 | -/** | ||
| 359 | - * 用户标识 | ||
| 360 | - */ | ||
| 361 | -@property(nonatomic,strong) NSString* identifier; | ||
| 362 | -/** | ||
| 363 | - * 来源 | ||
| 364 | - */ | ||
| 365 | -@property(nonatomic,strong) NSString* addSource; | ||
| 366 | -/** | ||
| 367 | - * 加好友附言 | ||
| 368 | - */ | ||
| 369 | -@property(nonatomic,strong) NSString* addWording; | ||
| 370 | - | ||
| 371 | -/** | ||
| 372 | - * 加好友昵称 | ||
| 373 | - */ | ||
| 374 | -@property(nonatomic,strong) NSString* nickname; | ||
| 375 | -@end | ||
| 376 | - | ||
| 377 | -/** | ||
| 378 | - * 未决请求信息 | ||
| 379 | - */ | ||
| 380 | -@interface TIMFriendPendencyRequest : TIMCodingModel | ||
| 381 | - | ||
| 382 | -/** | ||
| 383 | - * 序列号,未决列表序列号 | ||
| 384 | - * 建议客户端保存seq和未决列表,请求时填入server返回的seq | ||
| 385 | - * 如果seq是server最新的,则不返回数据 | ||
| 386 | - */ | ||
| 387 | -@property(nonatomic,assign) uint64_t seq; | ||
| 388 | - | ||
| 389 | -/** | ||
| 390 | - * 翻页时间戳,只用来翻页,server返回0时表示没有更多数据,第一次请求填0 | ||
| 391 | - * 特别注意的是,如果server返回的seq跟填入的seq不同,翻页过程中,需要使用客户端原始seq请求,直到数据请求完毕,才能更新本地seq | ||
| 392 | - */ | ||
| 393 | -@property(nonatomic,assign) uint64_t timestamp; | ||
| 394 | - | ||
| 395 | -/** | ||
| 396 | - * 每页的数量,即本次请求最多返回都个数据 | ||
| 397 | - */ | ||
| 398 | -@property(nonatomic,assign) uint64_t numPerPage; | ||
| 399 | - | ||
| 400 | -/** | ||
| 401 | - * 未决请求拉取类型 | ||
| 402 | - */ | ||
| 403 | -@property(nonatomic,assign) TIMPendencyType type; | ||
| 404 | - | ||
| 405 | -@end | ||
| 406 | - | ||
| 407 | -/** | ||
| 408 | - * 未决返回信息 | ||
| 409 | - */ | ||
| 410 | -@interface TIMFriendPendencyResponse : TIMCodingModel | ||
| 411 | - | ||
| 412 | -/** | ||
| 413 | - * 本次请求的未决列表序列号 | ||
| 414 | - */ | ||
| 415 | -@property(nonatomic,assign) uint64_t seq; | ||
| 416 | - | ||
| 417 | -/** | ||
| 418 | - * 本次请求的翻页时间戳 | ||
| 419 | - */ | ||
| 420 | -@property(nonatomic,assign) uint64_t timestamp; | ||
| 421 | - | ||
| 422 | -/** | ||
| 423 | - * 未决请求未读数量 | ||
| 424 | - */ | ||
| 425 | -@property(nonatomic,assign) uint64_t unreadCnt; | ||
| 426 | - | ||
| 427 | -/** | ||
| 428 | - * 未决数据 | ||
| 429 | - */ | ||
| 430 | -@property NSArray<TIMFriendPendencyItem *> * pendencies; | ||
| 431 | - | ||
| 432 | -@end | ||
| 433 | - | ||
| 434 | - | ||
| 435 | - | ||
| 436 | -/** | ||
| 437 | - * 好友元信息 | ||
| 438 | - */ | ||
| 439 | -@interface TIMFriendMetaInfo : TIMCodingModel | ||
| 440 | - | ||
| 441 | -/** | ||
| 442 | - * 时间戳,需要保存,下次拉取时传入,增量更新使用 | ||
| 443 | - */ | ||
| 444 | -@property(nonatomic,assign) uint64_t timestamp; | ||
| 445 | -/** | ||
| 446 | - * 序列号,需要保存,下次拉取时传入,增量更新使用 | ||
| 447 | - */ | ||
| 448 | -@property(nonatomic,assign) uint64_t infoSeq; | ||
| 449 | -/** | ||
| 450 | - * 分页信息,无需保存,返回为0时结束,非0时传入再次拉取,第一次拉取时传0 | ||
| 451 | - */ | ||
| 452 | -@property(nonatomic,assign) uint64_t nextSeq; | ||
| 453 | -/** | ||
| 454 | - * 覆盖:为TRUE时需要重设timestamp, infoSeq, nextSeq为0,清除客户端存储,重新拉取资料 | ||
| 455 | - */ | ||
| 456 | -@property(nonatomic,assign) BOOL recover; | ||
| 457 | - | ||
| 458 | -@end | ||
| 459 | - | ||
| 460 | -/** | ||
| 461 | - * 好友分组信息 | ||
| 462 | - */ | ||
| 463 | -@interface TIMFriendGroup : TIMCodingModel | ||
| 464 | -/** | ||
| 465 | - * 好友分组名称 | ||
| 466 | - */ | ||
| 467 | -@property(nonatomic,strong) NSString* name; | ||
| 468 | - | ||
| 469 | -/** | ||
| 470 | - * 分组成员数量 | ||
| 471 | - */ | ||
| 472 | -@property(nonatomic,assign) uint64_t userCnt; | ||
| 473 | - | ||
| 474 | -/** | ||
| 475 | - * 分组成员identifier列表 | ||
| 476 | - */ | ||
| 477 | -@property(nonatomic,strong) NSArray* friends; | ||
| 478 | - | ||
| 479 | -@end | ||
| 480 | - | ||
| 481 | -/** | ||
| 482 | - * 好友关系检查 | ||
| 483 | - */ | ||
| 484 | -@interface TIMFriendCheckInfo : NSObject | ||
| 485 | -/** | ||
| 486 | - * 检查用户的id列表(NSString*) | ||
| 487 | - */ | ||
| 488 | -@property(nonatomic,strong) NSArray* users; | ||
| 489 | - | ||
| 490 | -/** | ||
| 491 | - * 检查类型 | ||
| 492 | - */ | ||
| 493 | -@property(nonatomic,assign) TIMFriendCheckType checkType; | ||
| 494 | - | ||
| 495 | -@end | ||
| 496 | - | ||
| 497 | -@interface TIMCheckFriendResult : NSObject | ||
| 498 | -/** | ||
| 499 | - * 用户id | ||
| 500 | - */ | ||
| 501 | -@property(nonatomic,strong) NSString* identifier; | ||
| 502 | -/** | ||
| 503 | - * 返回状态 | ||
| 504 | - */ | ||
| 505 | -@property(nonatomic,assign) TIMFriendStatus status; | ||
| 506 | -/** | ||
| 507 | - * 检查结果 | ||
| 508 | - */ | ||
| 509 | -@property(nonatomic,assign) TIMFriendRelationType resultType; | ||
| 510 | - | ||
| 511 | -@end | ||
| 512 | - | ||
| 513 | -@interface TIMFriendResult : NSObject | ||
| 514 | - | ||
| 515 | -/** | ||
| 516 | - * 用户Id | ||
| 517 | - */ | ||
| 518 | -@property NSString* identifier; | ||
| 519 | - | ||
| 520 | -/** | ||
| 521 | - * 返回码 | ||
| 522 | - */ | ||
| 523 | -@property NSInteger result_code; | ||
| 524 | - | ||
| 525 | -/** | ||
| 526 | - * 返回信息 | ||
| 527 | - */ | ||
| 528 | -@property NSString *result_info; | ||
| 529 | - | ||
| 530 | -@end | ||
| 531 | - | ||
| 532 | -/** | ||
| 533 | - * 响应好友请求 | ||
| 534 | - */ | ||
| 535 | -@interface TIMFriendResponse : NSObject | ||
| 536 | - | ||
| 537 | -/** | ||
| 538 | - * 响应类型 | ||
| 539 | - */ | ||
| 540 | -@property(nonatomic,assign) TIMFriendResponseType responseType; | ||
| 541 | - | ||
| 542 | -/** | ||
| 543 | - * 用户identifier | ||
| 544 | - */ | ||
| 545 | -@property(nonatomic,strong) NSString* identifier; | ||
| 546 | - | ||
| 547 | -/** | ||
| 548 | - * 备注好友(可选,如果要加对方为好友)。备注最大96字节 | ||
| 549 | - */ | ||
| 550 | -@property(nonatomic,strong) NSString* remark; | ||
| 551 | - | ||
| 552 | -@end | ||
| 553 | - | ||
| 554 | - | ||
| 555 | -/** | ||
| 556 | - * 好友分组信息扩展 | ||
| 557 | - */ | ||
| 558 | -@interface TIMFriendGroupWithProfiles : TIMFriendGroup | ||
| 559 | -/** | ||
| 560 | - * 好友资料(TIMUserProfile*)列表 | ||
| 561 | - */ | ||
| 562 | -@property(nonatomic,strong) NSArray* profiles; | ||
| 563 | -@end | ||
| 564 | - | ||
| 565 | -// 用户资料KEY | ||
| 566 | - | ||
| 567 | -/** | ||
| 568 | - * 昵称 | ||
| 569 | - * 值类型: NSString | ||
| 570 | - */ | ||
| 571 | -extern NSString *const TIMProfileTypeKey_Nick; | ||
| 572 | -/** | ||
| 573 | - * 头像 | ||
| 574 | - * 值类型: NSString | ||
| 575 | - */ | ||
| 576 | -extern NSString *const TIMProfileTypeKey_FaceUrl; | ||
| 577 | -/** | ||
| 578 | - * 好友申请 | ||
| 579 | - * 值类型: NSNumber [TIM_FRIEND_ALLOW_ANY,TIM_FRIEND_NEED_CONFIRM,TIM_FRIEND_DENY_ANY] | ||
| 580 | - */ | ||
| 581 | -extern NSString *const TIMProfileTypeKey_AllowType; | ||
| 582 | -/** | ||
| 583 | - * 性别 | ||
| 584 | - * 值类型: NSNumber [TIM_GENDER_UNKNOWN,TIM_GENDER_MALE,TIM_GENDER_FEMALE] | ||
| 585 | - */ | ||
| 586 | -extern NSString *const TIMProfileTypeKey_Gender; | ||
| 587 | -/** | ||
| 588 | - * 生日 | ||
| 589 | - * 值类型: NSNumber | ||
| 590 | - */ | ||
| 591 | -extern NSString *const TIMProfileTypeKey_Birthday; | ||
| 592 | -/** | ||
| 593 | - * 位置 | ||
| 594 | - * 值类型: NSString | ||
| 595 | - */ | ||
| 596 | -extern NSString *const TIMProfileTypeKey_Location; | ||
| 597 | -/** | ||
| 598 | - * 语言 | ||
| 599 | - * 值类型: NSNumber | ||
| 600 | - */ | ||
| 601 | -extern NSString *const TIMProfileTypeKey_Language; | ||
| 602 | -/** | ||
| 603 | - * 等级 | ||
| 604 | - * 值类型: NSNumber | ||
| 605 | - */ | ||
| 606 | -extern NSString *const TIMProfileTypeKey_Level; | ||
| 607 | -/** | ||
| 608 | - * 角色 | ||
| 609 | - * 值类型: NSNumber | ||
| 610 | - */ | ||
| 611 | -extern NSString *const TIMProfileTypeKey_Role; | ||
| 612 | -/** | ||
| 613 | - * 签名 | ||
| 614 | - * 值类型: NSString | ||
| 615 | - */ | ||
| 616 | -extern NSString *const TIMProfileTypeKey_SelfSignature; | ||
| 617 | -/** | ||
| 618 | - * 自定义字段前缀 | ||
| 619 | - * 值类型: [NSString,NSData|NSNumber] | ||
| 620 | - * @note 当设置自定义字的值NSString对象时,后台会将其转为UTF8保存在数据库中。由于部分用户迁移资料时可能不是UTF8类型,所以在获取资料时,统一返回NSData类型。 | ||
| 621 | - */ | ||
| 622 | -extern NSString *const TIMProfileTypeKey_Custom_Prefix; | ||
| 623 | - | ||
| 624 | -// 好友资料KEY | ||
| 625 | - | ||
| 626 | -/** | ||
| 627 | - * 备注 | ||
| 628 | - * 值类型: NSString | ||
| 629 | - */ | ||
| 630 | -extern NSString *const TIMFriendTypeKey_Remark; | ||
| 631 | -/** | ||
| 632 | - * 分组 | ||
| 633 | - * 值类型: [NSArray] | ||
| 634 | - */ | ||
| 635 | -extern NSString *const TIMFriendTypeKey_Group; | ||
| 636 | -/** | ||
| 637 | - * 自定义字段前缀 | ||
| 638 | - * 值类型: [NSString,NSData|NSNumber] | ||
| 639 | - */ | ||
| 640 | -extern NSString *const TIMFriendTypeKey_Custom_Prefix; | ||
| 641 | -#endif /* TIMFriendshipDefine_h */ | ||
| 642 | - |
| 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 | - * @param identifiers 用户id,非好友的用户也可以 | ||
| 48 | - * @prarm forceUpdate 强制从后台拉取 | ||
| 49 | - * @param succ 成功回调 | ||
| 50 | - * @param fail 失败回调 | ||
| 51 | - * | ||
| 52 | - * @return 0 发送请求成功 | ||
| 53 | - */ | ||
| 54 | -- (int)getUsersProfile:(NSArray<NSString *> *)identifiers forceUpdate:(BOOL)forceUpdate succ:(TIMUserProfileArraySucc)succ fail:(TIMFail)fail; | ||
| 55 | - | ||
| 56 | -/** | ||
| 57 | - * 获取好友列表 | ||
| 58 | - * | ||
| 59 | - * @param succ 成功回调,返回好友(TIMFriend)列表 | ||
| 60 | - * @param fail 失败回调 | ||
| 61 | - * | ||
| 62 | - * @return 0 发送请求成功 | ||
| 63 | - */ | ||
| 64 | --(int)getFriendList:(TIMFriendArraySucc)succ fail:(TIMFail)fail; | ||
| 65 | - | ||
| 66 | - | ||
| 67 | -/** | ||
| 68 | - * 添加好友 | ||
| 69 | - * | ||
| 70 | - * @param request 添加好友请求 | ||
| 71 | - * @param succ 成功回调(TIMFriendResult) | ||
| 72 | - * @param fail 失败回调 | ||
| 73 | - * | ||
| 74 | - * @return 0 发送请求成功 | ||
| 75 | - */ | ||
| 76 | -- (int)addFriend:(TIMFriendRequest *)request succ:(TIMFriendResultSucc)succ fail:(TIMFail)fail; | ||
| 77 | - | ||
| 78 | -/** | ||
| 79 | - * 响应对方好友邀请 | ||
| 80 | - * | ||
| 81 | - * @param response 响应请求 | ||
| 82 | - * @param succ 成功回调 | ||
| 83 | - * @param fail 失败回调 | ||
| 84 | - * | ||
| 85 | - * @return 0 发送请求成功 | ||
| 86 | - */ | ||
| 87 | -- (int)doResponse:(TIMFriendResponse *)response succ:(TIMFriendResultSucc)succ fail:(TIMFail)fail; | ||
| 88 | - | ||
| 89 | -/** | ||
| 90 | - * 删除好友 | ||
| 91 | - * | ||
| 92 | - * @param identifiers 好友id | ||
| 93 | - * @param delType 删除类型(单向好友、双向好友) | ||
| 94 | - * @param succ 成功回调([TIMFriendResult]) | ||
| 95 | - * @param fail 失败回调 | ||
| 96 | - * | ||
| 97 | - * @return 0 发送请求成功 | ||
| 98 | - */ | ||
| 99 | -- (int)deleteFriends:(NSArray *)identifiers delType:(TIMDelFriendType)delType succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail; | ||
| 100 | - | ||
| 101 | -/** | ||
| 102 | - * 修改好友 | ||
| 103 | - * | ||
| 104 | - * @param identifier 好友id | ||
| 105 | - * @param values 需要更新的属性,可一次更新多个字段. 参见 TIMFriendshipDefine.h 的 TIMFriendTypeKey_XXX | ||
| 106 | - * @param succ 成功回调 | ||
| 107 | - * @param fail 失败回调 | ||
| 108 | - * | ||
| 109 | - * @return 0 发送请求成功 | ||
| 110 | - */ | ||
| 111 | -- (int)modifyFriend:(NSString *)identifier values:(NSDictionary<NSString *, id> *)values succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 112 | - | ||
| 113 | -/** | ||
| 114 | - * 未决列表请求 | ||
| 115 | - * | ||
| 116 | - * @param pendencyRequest 请求信息,详细参考TIMFriendPendencyRequest | ||
| 117 | - * @param succ 成功回调 | ||
| 118 | - * @param fail 失败回调 | ||
| 119 | - * | ||
| 120 | - * @return 0 发送请求成功 | ||
| 121 | - */ | ||
| 122 | -- (int)getPendencyList:(TIMFriendPendencyRequest *)pendencyRequest succ:(TIMGetFriendPendencyListSucc)succ fail:(TIMFail)fail; | ||
| 123 | - | ||
| 124 | -/** | ||
| 125 | - * 未决删除 | ||
| 126 | - * | ||
| 127 | - * @param type 未决好友类型 | ||
| 128 | - * @param identifiers 要删除的未决列表 | ||
| 129 | - * @param succ 成功回调 | ||
| 130 | - * @param fail 失败回调 | ||
| 131 | - * | ||
| 132 | - * @return 0 发送请求成功 | ||
| 133 | - */ | ||
| 134 | -- (int)deletePendency:(TIMPendencyType)type users:(NSArray *)identifiers succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 135 | - | ||
| 136 | -/** | ||
| 137 | - * 未决已读上报 | ||
| 138 | - * | ||
| 139 | - * @param timestamp 已读时间戳,此时间戳以前的消息都将置为已读 | ||
| 140 | - * @param succ 成功回调 | ||
| 141 | - * @param fail 失败回调 | ||
| 142 | - * | ||
| 143 | - * @return 0 发送请求成功 | ||
| 144 | - */ | ||
| 145 | -- (int)pendencyReport:(uint64_t)timestamp succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 146 | - | ||
| 147 | -/** | ||
| 148 | - * 获取黑名单列表 | ||
| 149 | - * | ||
| 150 | - * @param succ 成功回调,返回NSString*列表 | ||
| 151 | - * @param fail 失败回调 | ||
| 152 | - * | ||
| 153 | - * @return 0 发送请求成功 | ||
| 154 | - */ | ||
| 155 | -- (int)getBlackList:(TIMFriendArraySucc)succ fail:(TIMFail)fail; | ||
| 156 | - | ||
| 157 | -/** | ||
| 158 | - * 添加用户到黑名单 | ||
| 159 | - * | ||
| 160 | - * @param identifiers 用户列表 | ||
| 161 | - * @param succ 成功回调 | ||
| 162 | - * @param fail 失败回调 | ||
| 163 | - * | ||
| 164 | - * @return 0 发送请求成功 | ||
| 165 | - */ | ||
| 166 | -- (int)addBlackList:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail; | ||
| 167 | - | ||
| 168 | -/** | ||
| 169 | - * 把用户从黑名单中删除 | ||
| 170 | - * | ||
| 171 | - * @param identifiers 用户列表 | ||
| 172 | - * @param succ 成功回调 | ||
| 173 | - * @param fail 失败回调 | ||
| 174 | - * | ||
| 175 | - * @return 0 发送请求成功 | ||
| 176 | - */ | ||
| 177 | -- (int)deleteBlackList:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail; | ||
| 178 | - | ||
| 179 | -/** | ||
| 180 | - * 新建好友分组 | ||
| 181 | - * | ||
| 182 | - * @param groupNames 分组名称列表,必须是当前不存在的分组 | ||
| 183 | - * @param identifiers 要添加到分组中的好友 | ||
| 184 | - * @param succ 成功回调 | ||
| 185 | - * @param fail 失败回调 | ||
| 186 | - * | ||
| 187 | - * @return 0 发送请求成功 | ||
| 188 | - */ | ||
| 189 | -- (int)createFriendGroup:(NSArray *)groupNames users:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail; | ||
| 190 | - | ||
| 191 | -/** | ||
| 192 | - * 获取指定的好友分组信息 | ||
| 193 | - * | ||
| 194 | - * @param groupNames 要获取信息的好友分组名称列表,传入nil获得所有分组信息 | ||
| 195 | - * @param succ 成功回调,返回 TIMFriendGroup* 列表 | ||
| 196 | - * @param fail 失败回调 | ||
| 197 | - * | ||
| 198 | - * @return 0 发送请求成功 | ||
| 199 | - */ | ||
| 200 | -- (int)getFriendGroups:(NSArray *)groupNames succ:(TIMFriendGroupArraySucc)succ fail:(TIMFail)fail; | ||
| 201 | - | ||
| 202 | -/** | ||
| 203 | - * 删除好友分组 | ||
| 204 | - * | ||
| 205 | - * @param groupNames 要删除的好友分组名称列表 | ||
| 206 | - * @param succ 成功回调 | ||
| 207 | - * @param fail 失败回调 | ||
| 208 | - * | ||
| 209 | - * @return 0 发送请求成功 | ||
| 210 | - */ | ||
| 211 | -- (int)deleteFriendGroup:(NSArray *)groupNames succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 212 | - | ||
| 213 | -/** | ||
| 214 | - * 修改好友分组的名称 | ||
| 215 | - * | ||
| 216 | - * @param oldName 原来的分组名称 | ||
| 217 | - * @param newName 新的分组名称 | ||
| 218 | - * @param succ 成功回调 | ||
| 219 | - * @param fail 失败回调 | ||
| 220 | - * | ||
| 221 | - * @return 0 发送请求成功 | ||
| 222 | - */ | ||
| 223 | -- (int)renameFriendGroup:(NSString*)oldName newName:(NSString*)newName succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 224 | - | ||
| 225 | -/** | ||
| 226 | - * 添加好友到一个好友分组 | ||
| 227 | - * | ||
| 228 | - * @param groupName 好友分组名称 | ||
| 229 | - * @param identifiers 要添加到分组中的好友 | ||
| 230 | - * @param succ 成功回调 | ||
| 231 | - * @param fail 失败回调 | ||
| 232 | - * | ||
| 233 | - * @return 0 发送请求成功 | ||
| 234 | - */ | ||
| 235 | -- (int)addFriendsToFriendGroup:(NSString *)groupName users:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail; | ||
| 236 | - | ||
| 237 | -/** | ||
| 238 | - * 从好友分组中删除好友 | ||
| 239 | - * | ||
| 240 | - * @param groupName 好友分组名称 | ||
| 241 | - * @param identifiers 要移出分组的好友 | ||
| 242 | - * @param succ 成功回调 | ||
| 243 | - * @param fail 失败回调 | ||
| 244 | - * | ||
| 245 | - * @return 0 发送请求成功 | ||
| 246 | - */ | ||
| 247 | -- (int)deleteFriendsFromFriendGroup:(NSString *)groupName users:(NSArray *)identifiers succ:(TIMFriendResultArraySucc)succ fail:(TIMFail)fail; | ||
| 248 | -@end | ||
| 249 | - | ||
| 250 | -#endif /* TIMFriendshipManager_h */ |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | #ifndef TIMGroupManager_Ext_h | 9 | #ifndef TIMGroupManager_Ext_h |
| 10 | #define TIMGroupManager_Ext_h | 10 | #define TIMGroupManager_Ext_h |
| 11 | 11 | ||
| 12 | -#import "TIMGroupManager.h" | 12 | +#import "ImSDK.h" |
| 13 | #import "TIMComm+Group.h" | 13 | #import "TIMComm+Group.h" |
| 14 | 14 | ||
| 15 | @interface TIMGroupManager (Ext) | 15 | @interface TIMGroupManager (Ext) |
| @@ -17,153 +17,124 @@ | @@ -17,153 +17,124 @@ | ||
| 17 | /** | 17 | /** |
| 18 | * 创建私有群 | 18 | * 创建私有群 |
| 19 | * | 19 | * |
| 20 | - * 创建者默认加入群组,无需显式指定,群组类型形态请参考官网文档 [群组形态介绍](https://cloud.tencent.com/document/product/269/1502#.E7.BE.A4.E7.BB.84.E5.BD.A2.E6.80.81.E4.BB.8B.E7.BB.8D) | ||
| 21 | - * | ||
| 22 | * @param members 群成员,NSString* 数组 | 20 | * @param members 群成员,NSString* 数组 |
| 23 | * @param groupName 群名 | 21 | * @param groupName 群名 |
| 24 | - * @param succ 成功回调 groupId | 22 | + * @param succ 成功回调 |
| 25 | * @param fail 失败回调 | 23 | * @param fail 失败回调 |
| 26 | * | 24 | * |
| 27 | - * @return 0:成功;1:失败 | 25 | + * @return 0 成功 |
| 28 | */ | 26 | */ |
| 29 | - (int)createPrivateGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | 27 | - (int)createPrivateGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; |
| 30 | 28 | ||
| 31 | /** | 29 | /** |
| 32 | * 创建公开群 | 30 | * 创建公开群 |
| 33 | * | 31 | * |
| 34 | - * 创建者默认加入群组,无需显式指定,群组类型形态请参考官网文档 [群组形态介绍](https://cloud.tencent.com/document/product/269/1502#.E7.BE.A4.E7.BB.84.E5.BD.A2.E6.80.81.E4.BB.8B.E7.BB.8D) | ||
| 35 | - *get | ||
| 36 | * @param members 群成员,NSString* 数组 | 32 | * @param members 群成员,NSString* 数组 |
| 37 | * @param groupName 群名 | 33 | * @param groupName 群名 |
| 38 | - * @param succ 成功回调 groupId | 34 | + * @param succ 成功回调 |
| 39 | * @param fail 失败回调 | 35 | * @param fail 失败回调 |
| 40 | * | 36 | * |
| 41 | - * @return 0:成功;1:失败 | 37 | + * @return 0 成功 |
| 42 | */ | 38 | */ |
| 43 | - (int)createPublicGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | 39 | - (int)createPublicGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; |
| 44 | 40 | ||
| 45 | /** | 41 | /** |
| 46 | * 创建聊天室 | 42 | * 创建聊天室 |
| 47 | * | 43 | * |
| 48 | - * 创建者默认加入群组,无需显式指定,群组类型形态请参考官网文档 [群组形态介绍](https://cloud.tencent.com/document/product/269/1502#.E7.BE.A4.E7.BB.84.E5.BD.A2.E6.80.81.E4.BB.8B.E7.BB.8D) | ||
| 49 | - * | ||
| 50 | * @param members 群成员,NSString* 数组 | 44 | * @param members 群成员,NSString* 数组 |
| 51 | * @param groupName 群名 | 45 | * @param groupName 群名 |
| 52 | - * @param succ 成功回调 groupId | 46 | + * @param succ 成功回调 |
| 53 | * @param fail 失败回调 | 47 | * @param fail 失败回调 |
| 54 | * | 48 | * |
| 55 | - * @return 0:成功;1:失败 | 49 | + * @return 0 成功 |
| 56 | */ | 50 | */ |
| 57 | - (int)createChatRoomGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | 51 | - (int)createChatRoomGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; |
| 58 | 52 | ||
| 59 | /** | 53 | /** |
| 60 | * 创建音视频聊天室(可支持超大群,详情可参考wiki文档) | 54 | * 创建音视频聊天室(可支持超大群,详情可参考wiki文档) |
| 61 | * | 55 | * |
| 62 | - * 创建者默认加入群组,无需显式指定,群组类型形态请参考官网文档 [群组形态介绍](https://cloud.tencent.com/document/product/269/1502#.E7.BE.A4.E7.BB.84.E5.BD.A2.E6.80.81.E4.BB.8B.E7.BB.8D) | ||
| 63 | - * | ||
| 64 | * @param groupName 群名 | 56 | * @param groupName 群名 |
| 65 | - * @param succ 成功回调 groupId | 57 | + * @param succ 成功回调 |
| 66 | * @param fail 失败回调 | 58 | * @param fail 失败回调 |
| 67 | * | 59 | * |
| 68 | - * @return 0:成功;1:失败 | 60 | + * @return 0 成功 |
| 69 | */ | 61 | */ |
| 70 | - (int)createAVChatRoomGroup:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | 62 | - (int)createAVChatRoomGroup:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; |
| 71 | 63 | ||
| 72 | /** | 64 | /** |
| 73 | - * 创建自定义群组 | ||
| 74 | - * | ||
| 75 | - * 在创建群组时,除了设置默认的成员以及群名外,还可以设置如群公告、群简介等字段。 | 65 | + * 创建群组 |
| 76 | * | 66 | * |
| 77 | - * @param groupInfo 群组信息,详情请参考 TIMComm+Group.h 里面的 TIMCreateGroupInfo 定义 | ||
| 78 | - * @param succ 成功回调 groupId | 67 | + * @param groupInfo 群组信息 |
| 68 | + * @param succ 成功回调 | ||
| 79 | * @param fail 失败回调 | 69 | * @param fail 失败回调 |
| 80 | * | 70 | * |
| 81 | - * @return 0:成功;1:失败 | 71 | + * @return 0 成功 |
| 82 | */ | 72 | */ |
| 83 | - (int)createGroup:(TIMCreateGroupInfo*)groupInfo succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | 73 | - (int)createGroup:(TIMCreateGroupInfo*)groupInfo succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; |
| 84 | 74 | ||
| 85 | /** | 75 | /** |
| 86 | * 邀请好友入群 | 76 | * 邀请好友入群 |
| 87 | * | 77 | * |
| 88 | - * 1. 只有私有群可以拉用户入群。 | ||
| 89 | - * 2. 直播大群:不能邀请用户入群。 | ||
| 90 | - * 3. 不允许群成员邀请他人入群,但创建群时可以直接拉人入群。 | ||
| 91 | - * | ||
| 92 | * @param group 群组Id | 78 | * @param group 群组Id |
| 93 | * @param members 要加入的成员列表(NSString* 类型数组) | 79 | * @param members 要加入的成员列表(NSString* 类型数组) |
| 94 | * @param succ 成功回调 | 80 | * @param succ 成功回调 |
| 95 | * @param fail 失败回调 | 81 | * @param fail 失败回调 |
| 96 | * | 82 | * |
| 97 | - * @return 0:成功;1:失败 | 83 | + * @return 0 成功 |
| 98 | */ | 84 | */ |
| 99 | - (int)inviteGroupMember:(NSString*)group members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | 85 | - (int)inviteGroupMember:(NSString*)group members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; |
| 100 | 86 | ||
| 101 | /** | 87 | /** |
| 102 | * 删除群成员 | 88 | * 删除群成员 |
| 103 | * | 89 | * |
| 104 | - * 1. 私有群:只有创建者可删除群组成员。 | ||
| 105 | - * 2. 公开群、聊天室:只有管理员和群主可以踢人。 | ||
| 106 | - * 3. 对于直播大群:不能踢人。 | ||
| 107 | - * | ||
| 108 | * @param group 群组Id | 90 | * @param group 群组Id |
| 109 | * @param reason 删除原因 | 91 | * @param reason 删除原因 |
| 110 | * @param members 要删除的成员列表 | 92 | * @param members 要删除的成员列表 |
| 111 | * @param succ 成功回调 | 93 | * @param succ 成功回调 |
| 112 | * @param fail 失败回调 | 94 | * @param fail 失败回调 |
| 113 | * | 95 | * |
| 114 | - * @return 0:成功;1:失败 | 96 | + * @return 0 成功 |
| 115 | */ | 97 | */ |
| 116 | - (int)deleteGroupMemberWithReason:(NSString*)group reason:(NSString*)reason members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | 98 | - (int)deleteGroupMemberWithReason:(NSString*)group reason:(NSString*)reason members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; |
| 117 | 99 | ||
| 118 | /** | 100 | /** |
| 119 | - * 获取群公开信息(暂未实现) | ||
| 120 | - * | ||
| 121 | - * 任意用户可以获取群公开资料,只能获取公开信息。 | ||
| 122 | - * | 101 | + * 获取群公开信息 |
| 123 | * @param groups 群组Id | 102 | * @param groups 群组Id |
| 124 | * @param succ 成功回调 | 103 | * @param succ 成功回调 |
| 125 | * @param fail 失败回调 | 104 | * @param fail 失败回调 |
| 126 | * | 105 | * |
| 127 | - * @return 0:成功;1:失败 | 106 | + * @return 0 成功 |
| 128 | */ | 107 | */ |
| 129 | - (int)getGroupPublicInfo:(NSArray*)groups succ:(TIMGroupListSucc)succ fail:(TIMFail)fail; | 108 | - (int)getGroupPublicInfo:(NSArray*)groups succ:(TIMGroupListSucc)succ fail:(TIMFail)fail; |
| 130 | 109 | ||
| 131 | /** | 110 | /** |
| 132 | * 获取群列表 | 111 | * 获取群列表 |
| 133 | * | 112 | * |
| 134 | - * 1. 可以获取自己所加入的群列表。 | ||
| 135 | - * 2. 只能获得加入的部分直播大群的列表。 | ||
| 136 | - * | ||
| 137 | - * @param succ 成功回调,NSArray 列表为 TIMGroupInfo,结构体只包含 group\groupName\groupType\faceUrl\allShutup\selfInfo 信息 | 113 | + * @param succ 成功回调,NSArray列表为 TIMGroupInfo,结构体只包含 group\groupName\groupType\faceUrl\allShutup\selfInfo 信息 |
| 138 | * @param fail 失败回调 | 114 | * @param fail 失败回调 |
| 139 | * | 115 | * |
| 140 | - * @return 0:成功;1:失败 | 116 | + * @return 0 成功 |
| 141 | */ | 117 | */ |
| 142 | - (int)getGroupList:(TIMGroupListSucc)succ fail:(TIMFail)fail; | 118 | - (int)getGroupList:(TIMGroupListSucc)succ fail:(TIMFail)fail; |
| 143 | 119 | ||
| 144 | /** | 120 | /** |
| 145 | * 获取群信息 | 121 | * 获取群信息 |
| 146 | * | 122 | * |
| 147 | - * 1. 获取群组资料接口只能由群成员调用,非群成员无法通过此方法获取资料,需要调用 getGroupPublicInfo 获取资料。 | ||
| 148 | - * 2. 默认拉取基本资料,如果想要拉取自定义字段,首先要通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群维度自定义字段 配置相关的 key 和权限,然后在 initSDK 的时候把生成的 key 设置在 IMGroupInfoOption 里面的 groupCustom 字段。需要注意的是,只有对自定义字段 value 做了赋值或则修改,才能拉取到自定义字段。 | ||
| 149 | - * | ||
| 150 | * @param succ 成功回调,不包含 selfInfo信息 | 123 | * @param succ 成功回调,不包含 selfInfo信息 |
| 151 | * @param fail 失败回调 | 124 | * @param fail 失败回调 |
| 152 | * | 125 | * |
| 153 | - * @return 0:成功;1:失败 | 126 | + * @return 0 成功 |
| 154 | */ | 127 | */ |
| 155 | - (int)getGroupInfo:(NSArray*)groups succ:(TIMGroupListSucc)succ fail:(TIMFail)fail; | 128 | - (int)getGroupInfo:(NSArray*)groups succ:(TIMGroupListSucc)succ fail:(TIMFail)fail; |
| 156 | 129 | ||
| 157 | /** | 130 | /** |
| 158 | * 获取本人在群组内的成员信息 | 131 | * 获取本人在群组内的成员信息 |
| 159 | * | 132 | * |
| 160 | - * 默认拉取基本资料,如果想要拉取自定义字段,请参考 getGroupInfo | ||
| 161 | - * | ||
| 162 | * @param group 群组Id | 133 | * @param group 群组Id |
| 163 | * @param succ 成功回调,返回信息 | 134 | * @param succ 成功回调,返回信息 |
| 164 | * @param fail 失败回调 | 135 | * @param fail 失败回调 |
| 165 | * | 136 | * |
| 166 | - * @return 0:成功;1:失败 | 137 | + * @return 0 成功 |
| 167 | */ | 138 | */ |
| 168 | - (int)getGroupSelfInfo:(NSString*)group succ:(TIMGroupSelfSucc)succ fail:(TIMFail)fail; | 139 | - (int)getGroupSelfInfo:(NSString*)group succ:(TIMGroupSelfSucc)succ fail:(TIMFail)fail; |
| 169 | 140 | ||
| @@ -171,39 +142,33 @@ | @@ -171,39 +142,33 @@ | ||
| 171 | * 获取接受消息选项 | 142 | * 获取接受消息选项 |
| 172 | * | 143 | * |
| 173 | * @param group 群组Id | 144 | * @param group 群组Id |
| 174 | - * @param succ 成功回调, TIMGroupReceiveMessageOpt 0:接收消息;1:不接收消息,服务器不进行转发;2:接受消息,不进行 iOS APNs 推送 | 145 | + * @param succ 成功回调 |
| 175 | * @param fail 失败回调 | 146 | * @param fail 失败回调 |
| 176 | * | 147 | * |
| 177 | - * @return 0:成功;1:失败 | 148 | + * @return 0 成功 |
| 178 | */ | 149 | */ |
| 179 | - (int)getReciveMessageOpt:(NSString*)group succ:(TIMGroupReciveMessageOptSucc)succ fail:(TIMFail)fail; | 150 | - (int)getReciveMessageOpt:(NSString*)group succ:(TIMGroupReciveMessageOptSucc)succ fail:(TIMFail)fail; |
| 180 | 151 | ||
| 181 | /** | 152 | /** |
| 182 | * 获取群成员列表 | 153 | * 获取群成员列表 |
| 183 | * | 154 | * |
| 184 | - * 1. 获取群内成员列表,默认拉取内置字段,但不拉取自定义字段,如果想要拉取自定义字段,首先要通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群维度自定义字段 配置相关的 key 和权限,然后在 initSDK 的时候把生成的 key 设置在 IMGroupInfoOption 里面的 groupCustom 字段。需要注意的是,只有对自定义字段的 value 做了赋值或则修改,才能拉取到自定义字段。 | ||
| 185 | - * 2. 任何群组类型:都可以获取成员列表。 | ||
| 186 | - * 3. 直播大群:只能拉取部分成员(包括群主、管理员和部分成员)。 | ||
| 187 | - * | ||
| 188 | * @param group 群组Id | 155 | * @param group 群组Id |
| 189 | * @param succ 成功回调(TIMGroupMemberInfo列表) | 156 | * @param succ 成功回调(TIMGroupMemberInfo列表) |
| 190 | * @param fail 失败回调 | 157 | * @param fail 失败回调 |
| 191 | * | 158 | * |
| 192 | - * @return 0:成功;1:失败 | 159 | + * @return 0 成功 |
| 193 | */ | 160 | */ |
| 194 | - (int)getGroupMembers:(NSString*)group succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | 161 | - (int)getGroupMembers:(NSString*)group succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; |
| 195 | 162 | ||
| 196 | /** | 163 | /** |
| 197 | * 获取群组指定成员的信息 | 164 | * 获取群组指定成员的信息 |
| 198 | * | 165 | * |
| 199 | - * 获取群组指定成员的信息,需要设置群成员 members,其他限制参考 getGroupMembers | ||
| 200 | - * | ||
| 201 | * @param group 群组Id | 166 | * @param group 群组Id |
| 202 | * @param members 成员Id(NSString*)列表 | 167 | * @param members 成员Id(NSString*)列表 |
| 203 | * @param succ 成功回调(TIMGroupMemberInfo列表) | 168 | * @param succ 成功回调(TIMGroupMemberInfo列表) |
| 204 | * @param fail 失败回调 | 169 | * @param fail 失败回调 |
| 205 | * | 170 | * |
| 206 | - * @return 0:成功;1:失败 | 171 | + * @return 0 成功 |
| 207 | */ | 172 | */ |
| 208 | - (int)getGroupMembersInfo:(NSString*)group members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | 173 | - (int)getGroupMembersInfo:(NSString*)group members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; |
| 209 | 174 | ||
| @@ -214,151 +179,123 @@ | @@ -214,151 +179,123 @@ | ||
| 214 | * @param filter 群成员角色过滤方式 | 179 | * @param filter 群成员角色过滤方式 |
| 215 | * @param flags 拉取资料标志 | 180 | * @param flags 拉取资料标志 |
| 216 | * @param custom 要获取的自定义key(NSString*)列表 | 181 | * @param custom 要获取的自定义key(NSString*)列表 |
| 217 | - * @param nextSeq 分页拉取标志,第一次拉取填0,回调成功如果 nextSeq 不为零,需要分页,传入再次拉取,直至为0 | 182 | + * @param nextSeq 分页拉取标志,第一次拉取填0,回调成功如果不为零,需要分页,传入再次拉取,直至为0 |
| 218 | * @param succ 成功回调 | 183 | * @param succ 成功回调 |
| 219 | * @param fail 失败回调 | 184 | * @param fail 失败回调 |
| 220 | - * @return 0:成功;1:失败 | ||
| 221 | */ | 185 | */ |
| 222 | - (int)getGroupMembers:(NSString*)group ByFilter:(TIMGroupMemberFilter)filter flags:(TIMGetGroupMemInfoFlag)flags custom:(NSArray*)custom nextSeq:(uint64_t)nextSeq succ:(TIMGroupMemberSuccV2)succ fail:(TIMFail)fail; | 186 | - (int)getGroupMembers:(NSString*)group ByFilter:(TIMGroupMemberFilter)filter flags:(TIMGetGroupMemInfoFlag)flags custom:(NSArray*)custom nextSeq:(uint64_t)nextSeq succ:(TIMGroupMemberSuccV2)succ fail:(TIMFail)fail; |
| 223 | 187 | ||
| 224 | /** | 188 | /** |
| 225 | * 修改群名 | 189 | * 修改群名 |
| 226 | * | 190 | * |
| 227 | - * 1. 公开群、聊天室和直播大群:只有群主或者管理员可以修改群名。 | ||
| 228 | - * 2. 私有群:任何人可修改群名。 | ||
| 229 | - * | ||
| 230 | * @param group 群组Id | 191 | * @param group 群组Id |
| 231 | * @param groupName 新群名 | 192 | * @param groupName 新群名 |
| 232 | * @param succ 成功回调 | 193 | * @param succ 成功回调 |
| 233 | * @param fail 失败回调 | 194 | * @param fail 失败回调 |
| 234 | * | 195 | * |
| 235 | - * @return 0:成功;1:失败 | 196 | + * @return 0 成功 |
| 236 | */ | 197 | */ |
| 237 | - (int)modifyGroupName:(NSString*)group groupName:(NSString*)groupName succ:(TIMSucc)succ fail:(TIMFail)fail; | 198 | - (int)modifyGroupName:(NSString*)group groupName:(NSString*)groupName succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 238 | 199 | ||
| 239 | /** | 200 | /** |
| 240 | * 修改群简介 | 201 | * 修改群简介 |
| 241 | * | 202 | * |
| 242 | - * 1. 公开群、聊天室、直播大群:只有群主或者管理员可以修改群简介。 | ||
| 243 | - * 2. 私有群:任何人可修改群简介。 | ||
| 244 | - * | ||
| 245 | * @param group 群组Id | 203 | * @param group 群组Id |
| 246 | * @param introduction 群简介(最长120字节) | 204 | * @param introduction 群简介(最长120字节) |
| 247 | * @param succ 成功回调 | 205 | * @param succ 成功回调 |
| 248 | * @param fail 失败回调 | 206 | * @param fail 失败回调 |
| 249 | * | 207 | * |
| 250 | - * @return 0:成功;1:失败 | 208 | + * @return 0 成功 |
| 251 | */ | 209 | */ |
| 252 | - (int)modifyGroupIntroduction:(NSString*)group introduction:(NSString*)introduction succ:(TIMSucc)succ fail:(TIMFail)fail; | 210 | - (int)modifyGroupIntroduction:(NSString*)group introduction:(NSString*)introduction succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 253 | 211 | ||
| 254 | /** | 212 | /** |
| 255 | * 修改群公告 | 213 | * 修改群公告 |
| 256 | * | 214 | * |
| 257 | - * 1. 公开群、聊天室、直播大群:只有群主或者管理员可以修改群公告。 | ||
| 258 | - * 2. 私有群:任何人可修改群公告。 | ||
| 259 | - * | ||
| 260 | * @param group 群组Id | 215 | * @param group 群组Id |
| 261 | * @param notification 群公告(最长150字节) | 216 | * @param notification 群公告(最长150字节) |
| 262 | * @param succ 成功回调 | 217 | * @param succ 成功回调 |
| 263 | * @param fail 失败回调 | 218 | * @param fail 失败回调 |
| 264 | * | 219 | * |
| 265 | - * @return 0:成功;1:失败 | 220 | + * @return 0 成功 |
| 266 | */ | 221 | */ |
| 267 | - (int)modifyGroupNotification:(NSString*)group notification:(NSString*)notification succ:(TIMSucc)succ fail:(TIMFail)fail; | 222 | - (int)modifyGroupNotification:(NSString*)group notification:(NSString*)notification succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 268 | 223 | ||
| 269 | /** | 224 | /** |
| 270 | * 修改群头像 | 225 | * 修改群头像 |
| 271 | * | 226 | * |
| 272 | - * 1. 公开群、聊天室、直播大群:只有群主或者管理员可以修改群头像。 | ||
| 273 | - * 2. 私有群:任何人可修改群头像。 | ||
| 274 | - * | ||
| 275 | * @param group 群组Id | 227 | * @param group 群组Id |
| 276 | * @param url 群头像地址(最长100字节) | 228 | * @param url 群头像地址(最长100字节) |
| 277 | * @param succ 成功回调 | 229 | * @param succ 成功回调 |
| 278 | * @param fail 失败回调 | 230 | * @param fail 失败回调 |
| 279 | * | 231 | * |
| 280 | - * @return 0:成功;1:失败 | 232 | + * @return 0 成功 |
| 281 | */ | 233 | */ |
| 282 | - (int)modifyGroupFaceUrl:(NSString*)group url:(NSString*)url succ:(TIMSucc)succ fail:(TIMFail)fail; | 234 | - (int)modifyGroupFaceUrl:(NSString*)group url:(NSString*)url succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 283 | 235 | ||
| 284 | /** | 236 | /** |
| 285 | * 修改加群选项 | 237 | * 修改加群选项 |
| 286 | * | 238 | * |
| 287 | - * 1. 公开群、聊天室、直播大群:只有群主或者管理员可以修改加群选项。 | ||
| 288 | - * 2. 私有群:只能通过邀请加入群组,不能主动申请加入某个群组。 | ||
| 289 | - * | ||
| 290 | * @param group 群组Id | 239 | * @param group 群组Id |
| 291 | * @param opt 加群选项,详见 TIMGroupAddOpt | 240 | * @param opt 加群选项,详见 TIMGroupAddOpt |
| 292 | * @param succ 成功回调 | 241 | * @param succ 成功回调 |
| 293 | * @param fail 失败回调 | 242 | * @param fail 失败回调 |
| 294 | * | 243 | * |
| 295 | - * @return 0:成功;1:失败 | 244 | + * @return 0 成功 |
| 296 | */ | 245 | */ |
| 297 | - (int)modifyGroupAddOpt:(NSString*)group opt:(TIMGroupAddOpt)opt succ:(TIMSucc)succ fail:(TIMFail)fail; | 246 | - (int)modifyGroupAddOpt:(NSString*)group opt:(TIMGroupAddOpt)opt succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 298 | 247 | ||
| 299 | /** | 248 | /** |
| 300 | * 修改群自定义字段集合 | 249 | * 修改群自定义字段集合 |
| 301 | * | 250 | * |
| 302 | - * 通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群维度自定义字段 配置相关的 key 和权限。 | ||
| 303 | - * | ||
| 304 | * @param group 群组Id | 251 | * @param group 群组Id |
| 305 | - * @param customInfo 自定义字段集合,key 是 NSString* 类型,value 是 NSData* 类型 | 252 | + * @param customInfo 自定义字段集合,key是NSString*类型,value是NSData*类型 |
| 306 | * @param succ 成功回调 | 253 | * @param succ 成功回调 |
| 307 | * @param fail 失败回调 | 254 | * @param fail 失败回调 |
| 308 | * | 255 | * |
| 309 | - * @return 0:成功;1:失败 | 256 | + * @return 0 成功 |
| 310 | */ | 257 | */ |
| 311 | - (int)modifyGroupCustomInfo:(NSString*)group customInfo:(NSDictionary*)customInfo succ:(TIMSucc)succ fail:(TIMFail)fail; | 258 | - (int)modifyGroupCustomInfo:(NSString*)group customInfo:(NSDictionary*)customInfo succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 312 | 259 | ||
| 313 | /** | 260 | /** |
| 314 | * 转让群给新群主 | 261 | * 转让群给新群主 |
| 315 | * | 262 | * |
| 316 | - * 1. 只有群主才有权限进行群转让操作。 | ||
| 317 | - * 2. 直播大群不能进行群转让操作。 | ||
| 318 | - * | ||
| 319 | * @param group 群组Id | 263 | * @param group 群组Id |
| 320 | * @param identifier 新的群主Id | 264 | * @param identifier 新的群主Id |
| 321 | * @param succ 成功回调 | 265 | * @param succ 成功回调 |
| 322 | * @param fail 失败回调 | 266 | * @param fail 失败回调 |
| 323 | * | 267 | * |
| 324 | - * @return 0:成功;1:失败 | 268 | + * @return 0 成功 |
| 325 | */ | 269 | */ |
| 326 | - (int)modifyGroupOwner:(NSString*)group user:(NSString*)identifier succ:(TIMSucc)succ fail:(TIMFail)fail; | 270 | - (int)modifyGroupOwner:(NSString*)group user:(NSString*)identifier succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 327 | 271 | ||
| 328 | /** | 272 | /** |
| 329 | * 修改接受消息选项 | 273 | * 修改接受消息选项 |
| 330 | * | 274 | * |
| 331 | - * 默认情况下,公开群和私有群是接收并离线推送群消息,聊天室和直播大群是接收但不离线推送群消息。 | ||
| 332 | - * | ||
| 333 | * @param group 群组Id | 275 | * @param group 群组Id |
| 334 | * @param opt 接受消息选项,详见 TIMGroupReceiveMessageOpt | 276 | * @param opt 接受消息选项,详见 TIMGroupReceiveMessageOpt |
| 335 | * @param succ 成功回调 | 277 | * @param succ 成功回调 |
| 336 | * @param fail 失败回调 | 278 | * @param fail 失败回调 |
| 337 | * | 279 | * |
| 338 | - * @return 0:成功;1:失败 | 280 | + * @return 0 成功 |
| 339 | */ | 281 | */ |
| 340 | - (int)modifyReciveMessageOpt:(NSString*)group opt:(TIMGroupReceiveMessageOpt)opt succ:(TIMSucc)succ fail:(TIMFail)fail; | 282 | - (int)modifyReciveMessageOpt:(NSString*)group opt:(TIMGroupReceiveMessageOpt)opt succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 341 | 283 | ||
| 342 | /** | 284 | /** |
| 343 | * 修改群成员角色 | 285 | * 修改群成员角色 |
| 344 | * | 286 | * |
| 345 | - * 1. 群主、管理员:可以进行对群成员的身份进行修改。 | ||
| 346 | - * 2. 直播大群:不支持修改用户群内身份。 | ||
| 347 | - * | ||
| 348 | * @param group 群组Id | 287 | * @param group 群组Id |
| 349 | * @param identifier 被修改角色的用户identifier | 288 | * @param identifier 被修改角色的用户identifier |
| 350 | * @param role 角色(注意:不能修改为群主),详见 TIMGroupMemberRole | 289 | * @param role 角色(注意:不能修改为群主),详见 TIMGroupMemberRole |
| 351 | * @param succ 成功回调 | 290 | * @param succ 成功回调 |
| 352 | * @param fail 失败回调 | 291 | * @param fail 失败回调 |
| 353 | * | 292 | * |
| 354 | - * @return 0:成功;1:失败 | 293 | + * @return 0 成功 |
| 355 | */ | 294 | */ |
| 356 | - (int)modifyGroupMemberInfoSetRole:(NSString*)group user:(NSString*)identifier role:(TIMGroupMemberRole)role succ:(TIMSucc)succ fail:(TIMFail)fail; | 295 | - (int)modifyGroupMemberInfoSetRole:(NSString*)group user:(NSString*)identifier role:(TIMGroupMemberRole)role succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 357 | 296 | ||
| 358 | /** | 297 | /** |
| 359 | - * 禁言用户 | ||
| 360 | - * | ||
| 361 | - * 只有管理员或群主能够调用 | 298 | + * 禁言用户(只有管理员或群主能够调用) |
| 362 | * | 299 | * |
| 363 | * @param group 群组Id | 300 | * @param group 群组Id |
| 364 | * @param identifier 被禁言的用户identifier | 301 | * @param identifier 被禁言的用户identifier |
| @@ -366,14 +303,12 @@ | @@ -366,14 +303,12 @@ | ||
| 366 | * @param succ 成功回调 | 303 | * @param succ 成功回调 |
| 367 | * @param fail 失败回调 | 304 | * @param fail 失败回调 |
| 368 | * | 305 | * |
| 369 | - * @return 0:成功;1:失败 | 306 | + * @return 0 成功 |
| 370 | */ | 307 | */ |
| 371 | - (int)modifyGroupMemberInfoSetSilence:(NSString*)group user:(NSString*)identifier stime:(uint32_t)stime succ:(TIMSucc)succ fail:(TIMFail)fail; | 308 | - (int)modifyGroupMemberInfoSetSilence:(NSString*)group user:(NSString*)identifier stime:(uint32_t)stime succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 372 | 309 | ||
| 373 | /** | 310 | /** |
| 374 | - * 修改群名片 | ||
| 375 | - * | ||
| 376 | - * 只有本人、管理员或群主能够调用 | 311 | + * 修改群名片(只有本人、管理员或群主能够调用) |
| 377 | * | 312 | * |
| 378 | * @param group 群组Id | 313 | * @param group 群组Id |
| 379 | * @param identifier 被操作用户identifier | 314 | * @param identifier 被操作用户identifier |
| @@ -381,22 +316,20 @@ | @@ -381,22 +316,20 @@ | ||
| 381 | * @param succ 成功回调 | 316 | * @param succ 成功回调 |
| 382 | * @param fail 失败回调 | 317 | * @param fail 失败回调 |
| 383 | * | 318 | * |
| 384 | - * @return 0:成功;1:失败 | 319 | + * @return 0 成功 |
| 385 | */ | 320 | */ |
| 386 | - (int)modifyGroupMemberInfoSetNameCard:(NSString*)group user:(NSString*)identifier nameCard:(NSString*)nameCard succ:(TIMSucc)succ fail:(TIMFail)fail; | 321 | - (int)modifyGroupMemberInfoSetNameCard:(NSString*)group user:(NSString*)identifier nameCard:(NSString*)nameCard succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 387 | 322 | ||
| 388 | /** | 323 | /** |
| 389 | * 修改群成员自定义字段集合 | 324 | * 修改群成员自定义字段集合 |
| 390 | * | 325 | * |
| 391 | - * 通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群成员维度自定义字段 配置相关的 key 和权限。 | ||
| 392 | - * | ||
| 393 | - * @param group 群组 Id | ||
| 394 | - * @param identifier 被操作用户 identifier | ||
| 395 | - * @param customInfo 自定义字段集合,key 是 NSString* 类型,value 是 NSData* 类型 | 326 | + * @param group 群组Id |
| 327 | + * @param identifier 被操作用户identifier | ||
| 328 | + * @param customInfo 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 396 | * @param succ 成功回调 | 329 | * @param succ 成功回调 |
| 397 | * @param fail 失败回调 | 330 | * @param fail 失败回调 |
| 398 | * | 331 | * |
| 399 | - * @return 0:成功;1:失败 | 332 | + * @return 0 成功 |
| 400 | */ | 333 | */ |
| 401 | - (int)modifyGroupMemberInfoSetCustomInfo:(NSString*)group user:(NSString*)identifier customInfo:(NSDictionary*)customInfo succ:(TIMSucc)succ fail:(TIMFail)fail; | 334 | - (int)modifyGroupMemberInfoSetCustomInfo:(NSString*)group user:(NSString*)identifier customInfo:(NSDictionary*)customInfo succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 402 | 335 | ||
| @@ -408,7 +341,7 @@ | @@ -408,7 +341,7 @@ | ||
| 408 | * @param succ 成功回调 | 341 | * @param succ 成功回调 |
| 409 | * @param fail 失败回调 | 342 | * @param fail 失败回调 |
| 410 | * | 343 | * |
| 411 | - * @return 0:成功;1:失败 | 344 | + * @return 0 成功 |
| 412 | */ | 345 | */ |
| 413 | - (int)modifyGroupSearchable:(NSString*)group searchable:(BOOL)searchable succ:(TIMSucc)succ fail:(TIMFail)fail; | 346 | - (int)modifyGroupSearchable:(NSString*)group searchable:(BOOL)searchable succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 414 | 347 | ||
| @@ -420,56 +353,48 @@ | @@ -420,56 +353,48 @@ | ||
| 420 | * @param succ 成功回调 | 353 | * @param succ 成功回调 |
| 421 | * @param fail 失败回调 | 354 | * @param fail 失败回调 |
| 422 | * | 355 | * |
| 423 | - * @return 0:成功;1:失败 | 356 | + * @return 0 成功 |
| 424 | */ | 357 | */ |
| 425 | - (int)modifyGroupMemberVisible:(NSString*)group visible:(BOOL)visible succ:(TIMSucc)succ fail:(TIMFail)fail; | 358 | - (int)modifyGroupMemberVisible:(NSString*)group visible:(BOOL)visible succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 426 | 359 | ||
| 427 | /** | 360 | /** |
| 428 | * 修改群组全员禁言属性 | 361 | * 修改群组全员禁言属性 |
| 429 | * | 362 | * |
| 430 | - * 1. 群主、管理员:有权限进行全员禁言的操作。 | ||
| 431 | - * 2. 所有群组类型:都支持全员禁言的操作。 | ||
| 432 | - * | ||
| 433 | * @param group 群组Id | 363 | * @param group 群组Id |
| 434 | * @param shutup 是否禁言 | 364 | * @param shutup 是否禁言 |
| 435 | * @param succ 成功回调 | 365 | * @param succ 成功回调 |
| 436 | * @param fail 失败回调 | 366 | * @param fail 失败回调 |
| 437 | * | 367 | * |
| 438 | - * @return 0:成功;1:失败 | 368 | + * @return 0 成功 |
| 439 | */ | 369 | */ |
| 440 | - (int)modifyGroupAllShutup:(NSString*)group shutup:(BOOL)shutup succ:(TIMSucc)succ fail:(TIMFail)fail; | 370 | - (int)modifyGroupAllShutup:(NSString*)group shutup:(BOOL)shutup succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 441 | 371 | ||
| 442 | /** | 372 | /** |
| 443 | * 获取群组未决列表 | 373 | * 获取群组未决列表 |
| 444 | * | 374 | * |
| 445 | - * 1. 群未决消息泛指所有需要审批的群相关的操作(例如:加群待审批,拉人入群待审批等等)。即便审核通过或者拒绝后,该条信息也可通过此接口拉回,拉回的信息中有已决标志 | ||
| 446 | - * 2. 审批人:有权限拉取相关信息,如果 UserA 申请加入群 GroupA,则群管理员可获取此未决相关信息,UserA 因为没有审批权限,不需要拉取未决信息。如果 AdminA 拉 UserA 进去 GroupA,则 UserA 可以拉取此未决相关信息,因为该未决信息待 UserA 审批。 | ||
| 447 | - * | ||
| 448 | * @param option 未决参数配置 | 375 | * @param option 未决参数配置 |
| 449 | * @param succ 成功回调,返回未决列表 | 376 | * @param succ 成功回调,返回未决列表 |
| 450 | * @param fail 失败回调 | 377 | * @param fail 失败回调 |
| 451 | * | 378 | * |
| 452 | - * @return 0:成功;1:失败 | 379 | + * @return 0 成功 |
| 453 | */ | 380 | */ |
| 454 | - (int)getPendencyFromServer:(TIMGroupPendencyOption*)option succ:(TIMGetGroupPendencyListSucc)succ fail:(TIMFail)fail; | 381 | - (int)getPendencyFromServer:(TIMGroupPendencyOption*)option succ:(TIMGetGroupPendencyListSucc)succ fail:(TIMFail)fail; |
| 455 | 382 | ||
| 456 | /** | 383 | /** |
| 457 | * 群未决已读上报 | 384 | * 群未决已读上报 |
| 458 | * | 385 | * |
| 459 | - * 对于未决信息,SDK 可对其和之前的所有未决信息上报已读。上报已读后,仍然可以拉取到这些未决信息,但可通过对已读时戳的判断判定未决信息是否已读。 | ||
| 460 | - * | ||
| 461 | * @param timestamp 上报已读时间戳 | 386 | * @param timestamp 上报已读时间戳 |
| 462 | * @param succ 成功回调 | 387 | * @param succ 成功回调 |
| 463 | * @param fail 失败回调 | 388 | * @param fail 失败回调 |
| 464 | * | 389 | * |
| 465 | - * @return 0:成功;1:失败 | 390 | + * @return 0 成功 |
| 466 | */ | 391 | */ |
| 467 | - (int)pendencyReport:(uint64_t)timestamp succ:(TIMSucc)succ fail:(TIMFail)fail; | 392 | - (int)pendencyReport:(uint64_t)timestamp succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 468 | 393 | ||
| 394 | +#pragma mark - 开启本地缓存后有效 | ||
| 395 | + | ||
| 469 | /** | 396 | /** |
| 470 | - * 获取用户所在群组信息(暂未实现) | ||
| 471 | - * | ||
| 472 | - * 开启本地缓存后有效 | 397 | + * 获取用户所在群组信息 |
| 473 | * | 398 | * |
| 474 | * @param groups 群组id(NSString*)列表,nil时返回群组列表 | 399 | * @param groups 群组id(NSString*)列表,nil时返回群组列表 |
| 475 | * | 400 | * |
| @@ -24,63 +24,47 @@ | @@ -24,63 +24,47 @@ | ||
| 24 | /** | 24 | /** |
| 25 | * 创建群组 | 25 | * 创建群组 |
| 26 | * | 26 | * |
| 27 | - * 1. 默认创建群组时,IM 通讯云服务器会生成一个唯一的 ID,该 ID 将以 @TGS# 开头,且保证在 App 中唯一,以便后续操作。 | ||
| 28 | - * 2. 如果用户需要自定义群组 ID,在创建时可指定 ID,自定义群组 ID 必须为可打印 ASCII 字符(0x20-0x7e),最长 48 个字节,且前缀不能为 @TGS#(避免与默认分配的群组 ID 混淆) | ||
| 29 | - * | ||
| 30 | * @param type 群类型,Private,Public,ChatRoom,AVChatRoom | 27 | * @param type 群类型,Private,Public,ChatRoom,AVChatRoom |
| 31 | - * @param groupId 自定义群组 ID,为空时系统自动分配 | 28 | + * @param groupId 自定义群组id,为空时系统自动分配 |
| 32 | * @param groupName 群组名称 | 29 | * @param groupName 群组名称 |
| 33 | * @param succ 成功回调 | 30 | * @param succ 成功回调 |
| 34 | * @param fail 失败回调 | 31 | * @param fail 失败回调 |
| 35 | * | 32 | * |
| 36 | - * @return 0:成功;1:失败 | 33 | + * @return 0 成功 |
| 37 | */ | 34 | */ |
| 38 | - (int)createGroup:(NSString*)type groupId:(NSString*)groupId groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | 35 | - (int)createGroup:(NSString*)type groupId:(NSString*)groupId groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; |
| 39 | 36 | ||
| 40 | /** | 37 | /** |
| 41 | * 解散群组 | 38 | * 解散群组 |
| 42 | * | 39 | * |
| 43 | - * 1. 私有群:任何人都无法解散群组 | ||
| 44 | - * 2. 公开群、聊天室、直播大群:群主可以解散群组。 | ||
| 45 | - * | ||
| 46 | * @param group 群组Id | 40 | * @param group 群组Id |
| 47 | * @param succ 成功回调 | 41 | * @param succ 成功回调 |
| 48 | * @param fail 失败回调 | 42 | * @param fail 失败回调 |
| 49 | * | 43 | * |
| 50 | - * @return 0:成功;1:失败 | 44 | + * @return 0 成功 |
| 51 | */ | 45 | */ |
| 52 | - (int)deleteGroup:(NSString*)group succ:(TIMSucc)succ fail:(TIMFail)fail; | 46 | - (int)deleteGroup:(NSString*)group succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 53 | 47 | ||
| 54 | /** | 48 | /** |
| 55 | * 申请加群 | 49 | * 申请加群 |
| 56 | * | 50 | * |
| 57 | - * 1. 私有群:不能由用户主动申请入群。 | ||
| 58 | - * 2. 公开群、聊天室:可以主动申请进入。 | ||
| 59 | - * 3. 直播大群:可以任意加入群组。 | ||
| 60 | - * 4. 如果群组设置为需要审核,申请入群后管理员和群主会收到申请入群系统消息 TIMGroupSystemElem,判断 TIMGroupSystemElem 的 Type 类型如果是 TIM_GROUP_SYSTEM_ADD_GROUP_REQUEST_TYPE ,调用消息的 accept 接口同意入群,申请人会收到同意入群的消息 TIMGroupSystemElem(Type:TIM_GROUP_SYSTEM_ADD_GROUP_ACCEPT_TYPE),调用 refuse 接口拒绝入群,申请人会收到拒绝入群的消息 TIMGroupSystemElem(Type:TIM_GROUP_SYSTEM_ADD_GROUP_REFUSE_TYPE)。 | ||
| 61 | - * 5. 如果群主设置为任何人可加入,则直接入群成功。 | ||
| 62 | - * | ||
| 63 | * @param group 申请加入的群组Id | 51 | * @param group 申请加入的群组Id |
| 64 | * @param msg 申请消息 | 52 | * @param msg 申请消息 |
| 65 | * @param succ 成功回调(申请成功等待审批) | 53 | * @param succ 成功回调(申请成功等待审批) |
| 66 | * @param fail 失败回调 | 54 | * @param fail 失败回调 |
| 67 | * | 55 | * |
| 68 | - * @return 0:成功;1:失败 | 56 | + * @return 0 成功 |
| 69 | */ | 57 | */ |
| 70 | - (int)joinGroup:(NSString*)group msg:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | 58 | - (int)joinGroup:(NSString*)group msg:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 71 | 59 | ||
| 72 | /** | 60 | /** |
| 73 | * 主动退出群组 | 61 | * 主动退出群组 |
| 74 | * | 62 | * |
| 75 | - * 1. 私有群:全员可退出群组。 | ||
| 76 | - * 2. 公开群、聊天室、直播大群:群主不能退出。 | ||
| 77 | - * 3. 当用户主动退出群组时,该用户会收到退群消息 TIMGroupSystemElem(Type:TIM_GROUP_SYSTEM_QUIT_GROUP_TYPE),只有退群的用户自己可以收到。当用户调用 QuitGroup 时成功回调返回,表示已退出成功,此消息主要为了多终端同步,其他终端可以作为更新群列表的时机,本终端可以选择忽略。 | ||
| 78 | - * | ||
| 79 | * @param group 群组Id | 63 | * @param group 群组Id |
| 80 | * @param succ 成功回调 | 64 | * @param succ 成功回调 |
| 81 | * @param fail 失败回调 | 65 | * @param fail 失败回调 |
| 82 | * | 66 | * |
| 83 | - * @return 0:成功;1:失败 | 67 | + * @return 0 成功 |
| 84 | */ | 68 | */ |
| 85 | - (int)quitGroup:(NSString*)group succ:(TIMSucc)succ fail:(TIMFail)fail; | 69 | - (int)quitGroup:(NSString*)group succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 86 | 70 |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | #ifndef TIMManager_MsgExt_h | 9 | #ifndef TIMManager_MsgExt_h |
| 10 | #define TIMManager_MsgExt_h | 10 | #define TIMManager_MsgExt_h |
| 11 | 11 | ||
| 12 | -#import "TIMManager.h" | 12 | +#import "ImSDK.h" |
| 13 | #import "TIMComm+MsgExt.h" | 13 | #import "TIMComm+MsgExt.h" |
| 14 | 14 | ||
| 15 | @class TIMMessage; | 15 | @class TIMMessage; |
| @@ -38,22 +38,20 @@ | @@ -38,22 +38,20 @@ | ||
| 38 | /** | 38 | /** |
| 39 | * 删除会话 | 39 | * 删除会话 |
| 40 | * | 40 | * |
| 41 | - * @param type 会话类型,TIM_C2C:表示单聊;TIM_GROUP:表示群聊 | ||
| 42 | - * @param receiver 用户 identifier 或者群组 Id | 41 | + * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊 |
| 42 | + * @param receiver 用户identifier 或者 群组Id | ||
| 43 | * | 43 | * |
| 44 | - * @return TRUE:删除成功;FALSE:删除失败 | 44 | + * @return TRUE:删除成功 FALSE:删除失败 |
| 45 | */ | 45 | */ |
| 46 | - (BOOL)deleteConversation:(TIMConversationType)type receiver:(NSString*)receiver; | 46 | - (BOOL)deleteConversation:(TIMConversationType)type receiver:(NSString*)receiver; |
| 47 | 47 | ||
| 48 | /** | 48 | /** |
| 49 | * 删除会话和消息 | 49 | * 删除会话和消息 |
| 50 | * | 50 | * |
| 51 | - * 这里只是删除本地消息,通过 getMessage 会拉取到漫游消息,所以存在删除消息成功,但是拉取到消息的情况,取决于是否重新从漫游拉回到本地。如果不需要拉取漫游,可以通过 getLocalMessage 获取本地消息,或者只通过 getMessage 拉取指定条数(如未读条数数量)的消息。 | 51 | + * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊 |
| 52 | + * @param receiver 用户identifier 或者 群组Id | ||
| 52 | * | 53 | * |
| 53 | - * @param type 会话类型,TIM_C2C:表示单聊;TIM_GROUP:表示群聊 | ||
| 54 | - * @param receiver 用户identifier 或者 群组 Id | ||
| 55 | - * | ||
| 56 | - * @return TRUE:删除成功;FALSE:删除失败 | 54 | + * @return TRUE:删除成功 FALSE:删除失败 |
| 57 | */ | 55 | */ |
| 58 | - (BOOL)deleteConversationAndMessages:(TIMConversationType)type receiver:(NSString*)receiver; | 56 | - (BOOL)deleteConversationAndMessages:(TIMConversationType)type receiver:(NSString*)receiver; |
| 59 | 57 | ||
| @@ -65,15 +63,13 @@ | @@ -65,15 +63,13 @@ | ||
| 65 | - (int)conversationCount; | 63 | - (int)conversationCount; |
| 66 | 64 | ||
| 67 | /** | 65 | /** |
| 68 | - * 初始化存储(暂未实现) | ||
| 69 | - * | ||
| 70 | - * 仅查看历史消息时使用,如果要收发消息等操作,如login成功,不需要调用此函数 | 66 | + * 初始化存储,仅查看历史消息时使用,如果要收发消息等操作,如login成功,不需要调用此函数 |
| 71 | * | 67 | * |
| 72 | * @param param 登陆参数(userSig 不用填写) | 68 | * @param param 登陆参数(userSig 不用填写) |
| 73 | * @param succ 成功回调,收到回调时,可以获取会话列表和消息 | 69 | * @param succ 成功回调,收到回调时,可以获取会话列表和消息 |
| 74 | * @param fail 失败回调 | 70 | * @param fail 失败回调 |
| 75 | * | 71 | * |
| 76 | - * @return 0:请求成功;1:失败 | 72 | + * @return 0 请求成功 |
| 77 | */ | 73 | */ |
| 78 | - (int)initStorage:(TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; | 74 | - (int)initStorage:(TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; |
| 79 | 75 |
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | #import "TIMCallback.h" | 13 | #import "TIMCallback.h" |
| 14 | 14 | ||
| 15 | @class TIMGroupManager; | 15 | @class TIMGroupManager; |
| 16 | -@class TIMFriendshipManager; | 16 | +//@class TIMFriendshipManager; |
| 17 | 17 | ||
| 18 | ///////////////////////////////////////////////////////// | 18 | ///////////////////////////////////////////////////////// |
| 19 | /// Tencent 开放 SDK API | 19 | /// Tencent 开放 SDK API |
| @@ -24,361 +24,255 @@ | @@ -24,361 +24,255 @@ | ||
| 24 | */ | 24 | */ |
| 25 | @interface TIMManager : NSObject | 25 | @interface TIMManager : NSObject |
| 26 | 26 | ||
| 27 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 28 | -// | ||
| 29 | -// (一)初始化相关接口函数 | ||
| 30 | -// | ||
| 31 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 32 | 27 | ||
| 33 | -/// @name 初始化相关接口 | ||
| 34 | -/// @{ | ||
| 35 | /** | 28 | /** |
| 36 | - * 1.1 获取管理器实例 TIMManager | 29 | + * 获取管理器实例 |
| 37 | * | 30 | * |
| 38 | * @return 管理器实例 | 31 | * @return 管理器实例 |
| 39 | */ | 32 | */ |
| 40 | + (TIMManager*)sharedInstance; | 33 | + (TIMManager*)sharedInstance; |
| 41 | 34 | ||
| 42 | /** | 35 | /** |
| 43 | - * 1.2 初始化 SDK,设置全局配置信息 | 36 | + * 初始化SDK |
| 44 | * | 37 | * |
| 45 | - * 初始化 SDK 需要设置 TIMSdkConfig 信息,TIMSdkConfig 主要包含 sdkAppId 和 accountType 设置、Log 相关逻辑设置、数据库存储路径设置、网络监听设置等,其中 sdkAppId 和 accountType 的获取请参考官网文档 [跑通Demo(iOS与Mac)](https://cloud.tencent.com/document/product/269/32674)。 | 38 | + * @param config 配置信息,全局有效 |
| 46 | * | 39 | * |
| 47 | - * @param config 配置信息,全局有效,详情请参考 TIMComm.h 中的 TIMSdkConfig 定义 | ||
| 48 | - * | ||
| 49 | - * @return 0:成功;1:失败,config 为 nil | 40 | + * @return 0 成功 |
| 50 | */ | 41 | */ |
| 51 | - (int)initSdk:(TIMSdkConfig*)config; | 42 | - (int)initSdk:(TIMSdkConfig*)config; |
| 52 | 43 | ||
| 53 | /** | 44 | /** |
| 54 | - * 1.3 获取全局配置信息 | ||
| 55 | - * | ||
| 56 | - * 获取初始化 SDK 时候设置的 TIMSdkConfig,方便客户在上层做相关业务逻辑。 | 45 | + * 获取全局配置 |
| 57 | * | 46 | * |
| 58 | - * @return 全局配置,详情请参考 TIMComm.h 中的 TIMSdkConfig 定义 | 47 | + * @return 全局配置 |
| 59 | */ | 48 | */ |
| 60 | - (TIMSdkConfig*)getGlobalConfig; | 49 | - (TIMSdkConfig*)getGlobalConfig; |
| 61 | 50 | ||
| 62 | /** | 51 | /** |
| 63 | - * 1.4 设置用户配置信息 | 52 | + * 初始化当前manager,在initSdk:后调用,login:前调用 |
| 64 | * | 53 | * |
| 65 | - * 1. setUserConfig 要在 initSdk 之后,login 之前,主要用来开启/关闭自动已读上报和已读回执,设置默认拉取的群组资料,群成员资料字段,监听用户登录状态、会话刷新、消息已读回执、文件上传进度、群组事件通知。 | ||
| 66 | - * 2. 自动已读上报默认是开启的,当客户端收到一条未读消息后,Server 默认会删除这条未读消息,切换终端以后无法看到之前终端已经拉回的未读消息,如果需要多终端情况下仍然会有未读,请设置 TIMUserConfig 中的 disableAutoReport 为 YES,一旦禁用自动上报,开发者需要显式调用 setReadMessage,详情请参考官方文档 [未读消息计数](https://cloud.tencent.com/document/product/269/9151)。 | ||
| 67 | - * 3. C2C 已读回执默认是关闭的,如果需要开启,请设置 TIMUserConfig 中的 enableReadReceipt 为 YES,收到消息的用户需要显式调用 setReadMessage,发消息的用户才能通过 TIMMessageReceiptListener 监听到消息的已读回执。 | ||
| 68 | - * 4. 当您获取群资料的时候,默认只能拉取内置字段,如果想要拉取自定义字段,首先要通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群维度自定义字段 配置相关的 key 和权限,然后把生成的 key 设置在 IMGroupInfoOption 里面的 groupCustom 字段。需要注意的是,只有对自定义字段 value 做了赋值或则修改,才能拉取到自定义字段。 | ||
| 69 | - * 5. 当您获取群成员资料的时候,默认只能拉取内置字段,如果想要拉取自定义字段,首先要通过 [IM 控制台](https://console.cloud.tencent.com/avc) -> 功能配置 -> 群成员维度自定义字段配置相关的 key 和权限,然后把生成的 key 设置在 TIMGroupMemberInfoOption 里面的 memberCustom 字段。需要注意的是,只有对自定义字段的 value 做了赋值或则修改,才能拉取到自定义字段。 | 54 | + * @param config 配置信息,对当前TIMManager有效 |
| 70 | * | 55 | * |
| 71 | - * @param config 配置信息,对当前 TIMManager 有效,详情请参考 TIMComm.h 中的 TIMUserConfig 定义 | ||
| 72 | - * | ||
| 73 | - * @return 0:成功;1:失败,config 为 nil | 56 | + * @return 0 成功 |
| 74 | */ | 57 | */ |
| 75 | - (int)setUserConfig:(TIMUserConfig*)config; | 58 | - (int)setUserConfig:(TIMUserConfig*)config; |
| 76 | 59 | ||
| 77 | /** | 60 | /** |
| 78 | - * 1.5 获取用户配置信息 | ||
| 79 | - * | ||
| 80 | - * 获取设置的用户配置信息 TIMSdkConfig,方便客户在上层做相关业务逻辑。 | 61 | + * 获取当前manager绑定用户的配置 |
| 81 | * | 62 | * |
| 82 | - * @return 当前 manager 绑定用户的配置,详情请参考 TIMComm.h 中的 TIMUserConfig 定义 | 63 | + * @return 当前manager绑定用户的配置 |
| 83 | */ | 64 | */ |
| 84 | - (TIMUserConfig*)getUserConfig; | 65 | - (TIMUserConfig*)getUserConfig; |
| 85 | 66 | ||
| 86 | /** | 67 | /** |
| 87 | - * 1.6 添加消息监听(重复添加无效) | 68 | + * 添加消息回调(重复添加无效) |
| 88 | * | 69 | * |
| 89 | - * 添加消息监听后,会在 TIMMessageListener 的 onNewMessage 收到回调消息,消息内容通过参数 TIMMessage 传递,通过 TIMMessage 可以获取消息和相关会话的详细信息,如消息文本,语音数据,图片等。详细可参阅 [消息解析](https://cloud.tencent.com/document/product/269/9150#.E6.B6.88.E6.81.AF.E8.A7.A3.E6.9E.90) 部分。 | 70 | + * @param listener 回调 |
| 90 | * | 71 | * |
| 91 | - * @param listener 回调,详情请参考 TIMCallback.h 中的 TIMMessageListener 定义 | ||
| 92 | - * | ||
| 93 | - * @return 0:成功;1:失败,listener 为 nil | 72 | + * @return 成功 |
| 94 | */ | 73 | */ |
| 95 | - (int)addMessageListener:(id<TIMMessageListener>)listener; | 74 | - (int)addMessageListener:(id<TIMMessageListener>)listener; |
| 96 | 75 | ||
| 97 | /** | 76 | /** |
| 98 | - * 1.7 移除消息监听 | 77 | + * 移除消息回调 |
| 99 | * | 78 | * |
| 100 | - * @param listener 回调,详情请参考 TIMCallback.h 中的 TIMMessageListener 定义 | 79 | + * @param listener 回调 |
| 101 | * | 80 | * |
| 102 | - * @return 0:成功;1:失败,listener 为 nil | 81 | + * @return 成功 |
| 103 | */ | 82 | */ |
| 104 | - (int)removeMessageListener:(id<TIMMessageListener>)listener; | 83 | - (int)removeMessageListener:(id<TIMMessageListener>)listener; |
| 105 | 84 | ||
| 106 | -/// @} | ||
| 107 | - | ||
| 108 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 109 | -// | ||
| 110 | -// (二)登录相关接口 | ||
| 111 | -// | ||
| 112 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 113 | - | ||
| 114 | -/// @name 登录相关接口 | ||
| 115 | -/// @{ | ||
| 116 | /** | 85 | /** |
| 117 | - * 2.1 登录 | ||
| 118 | - * | ||
| 119 | - * 1. 登录需要设置用户名 identifier 和用户签名 userSig,userSig 的生成请参考官网文档 [UserSig 后台 API](https://cloud.tencent.com/document/product/269/32688)。 | ||
| 120 | - * 2. 如果 userSig 过期,登录会返回 ERR_USER_SIG_EXPIRED:6206 错误码,收到错误码后请生成新的 userSig 重新登录。 | ||
| 121 | - * 3. 用户在线情况下被踢,会在 TIMUserConfig 里面配置的 TIMUserStatusListener 监听器获取 onForceOffline 回调,收到回调后可以选择重新登录。 | ||
| 122 | - * 4. 用户离线状态下被踢,由于此时用户不在线,无法感知此事件,为了显式提醒用户,用户重新登录时,会返回 ERR_IMSDK_KICKED_BY_OTHERS:6208 错误码,表明之前被踢,如果需要把对方踢下线,再次调用 login 强制上线,更多详情请参考 [用户状态变更](https://cloud.tencent.com/document/product/269/9148#5.-.E7.94.A8.E6.88.B7.E7.8A.B6.E6.80.81.E5.8F.98.E6.9B.B4)。 | 86 | + * 登陆 |
| 123 | * | 87 | * |
| 124 | - * @param param 登陆参数,详情请参考 TIMComm.h 中的 TIMLoginParam 定义 | ||
| 125 | - * @param succ 成功回调,详情请参考 TIMComm.h 中的 TIMLoginSucc 定义 | ||
| 126 | - * @param fail 失败回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | 88 | + * @param param 登陆参数 |
| 89 | + * @param succ 成功回调 | ||
| 90 | + * @param fail 失败回调 | ||
| 127 | * | 91 | * |
| 128 | - * @return 0:成功;1:失败,请检查 param 参数是否正常 | 92 | + * @return 0 请求成功 |
| 129 | */ | 93 | */ |
| 130 | - (int)login: (TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; | 94 | - (int)login: (TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; |
| 131 | 95 | ||
| 132 | /** | 96 | /** |
| 133 | - * 2.2 自动登录 | 97 | + * 获取当前登陆的用户 |
| 134 | * | 98 | * |
| 135 | - * 1. 首次登陆之后,SDK 会把登陆信息存在在本地,下次登陆即可调用自动登录 | ||
| 136 | - * 2. 如果用户之前没有登录过,或则 APP 被卸载过,自动登录会报 ERR_NO_PREVIOUS_LOGIN:6026 错误,这个时候请调用 login 接口重新登录。 | ||
| 137 | - * | ||
| 138 | - * @param param 登陆参数( userSig 不用填),详情请参考 TIMComm.h 中的 TIMLoginParam 定义 | ||
| 139 | - * @param succ 成功回调,详情请参考 TIMComm.h 中的 TIMLoginSucc 定义 | ||
| 140 | - * @param fail 失败回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | ||
| 141 | - * | ||
| 142 | - * @return 0:成功;1:失败,请检查 param 参数是否正常 | ||
| 143 | - */ | ||
| 144 | -- (int)autoLogin:(TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; | ||
| 145 | - | ||
| 146 | -/** | ||
| 147 | - * 2.3 登出 | ||
| 148 | - * | ||
| 149 | - * 退出登录,如果切换账号,需要 logout 回调成功或者失败后才能再次 login,否则 login 可能会失败。 | ||
| 150 | - * | ||
| 151 | - * @param succ 成功回调,登出成功 | ||
| 152 | - * @param fail 失败回调,返回错误吗和错误信息 | ||
| 153 | - * | ||
| 154 | - * @return 0:发送登出包成功,等待回调;1:失败 | ||
| 155 | - */ | ||
| 156 | -- (int)logout:(TIMLoginSucc)succ fail:(TIMFail)fail; | ||
| 157 | - | ||
| 158 | -/** | ||
| 159 | - * 2.4 获取当前登陆的用户 | ||
| 160 | - * | ||
| 161 | - * @return 如果登陆返回用户的 identifier,如果未登录返回 nil | 99 | + * @return 如果登陆返回用户的identifier,如果未登录返回nil |
| 162 | */ | 100 | */ |
| 163 | - (NSString*)getLoginUser; | 101 | - (NSString*)getLoginUser; |
| 164 | 102 | ||
| 165 | /** | 103 | /** |
| 166 | - * 2.5 获取当前登录状态 | 104 | + * 获取当前登录状态 |
| 167 | * | 105 | * |
| 168 | - * @return 登录状态,详情请参考 TIMComm.h 中的 TIMLoginStatus 定义 | 106 | + * @return 登录状态 |
| 169 | */ | 107 | */ |
| 170 | - (TIMLoginStatus)getLoginStatus; | 108 | - (TIMLoginStatus)getLoginStatus; |
| 171 | 109 | ||
| 172 | -/// @} | ||
| 173 | - | ||
| 174 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 175 | -// | ||
| 176 | -// (三)获取会话管理器 | ||
| 177 | -// | ||
| 178 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 179 | -/// @name 获取会话管理器 | ||
| 180 | -/// @{ | ||
| 181 | -/** | ||
| 182 | - * 获取会话管理器 | ||
| 183 | - * | ||
| 184 | - * TIMConversation 负责会话相关操作,包含发送消息、获取会话消息缓存、获取未读计数等。 | ||
| 185 | - * | ||
| 186 | - * @param type 会话类型,TIM_C2C:单聊;TIM_GROUP:群聊;TIM_SYSTEM:系统会话 | ||
| 187 | - * @param receiver 会话接收者,C2C:为对方用户;identifier;GROUP:群组 Id;SYSTEM:@"" | ||
| 188 | - * | ||
| 189 | - * @return 会话对象,详情请参考 TIMConversation.h 里面的 TIMConversation 定义 | ||
| 190 | - */ | ||
| 191 | -- (TIMConversation*)getConversation:(TIMConversationType)type receiver:(NSString*)receiver; | ||
| 192 | - | ||
| 193 | -/// @} | ||
| 194 | - | ||
| 195 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 196 | -// | ||
| 197 | -// (四)获取群管理器 | ||
| 198 | -// | ||
| 199 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 200 | -/// @name 获取群管理器 | ||
| 201 | -/// @{ | ||
| 202 | /** | 110 | /** |
| 203 | - * 获取群管理器 | 111 | + * 登出 |
| 204 | * | 112 | * |
| 205 | - * TIMGroupManager 负责创建群、增删成员、以及修改群资料等 | 113 | + * @param succ 成功回调,登出成功 |
| 114 | + * @param fail 失败回调,返回错误吗和错误信息 | ||
| 206 | * | 115 | * |
| 207 | - * @return 群管理器,详情请参考 TIMGroupManager.h 中的 TIMGroupManager 定义 | 116 | + * @return 0 发送登出包成功,等待回调 |
| 208 | */ | 117 | */ |
| 209 | -- (TIMGroupManager*)groupManager; | 118 | +- (int)logout:(TIMLoginSucc)succ fail:(TIMFail)fail; |
| 210 | 119 | ||
| 211 | -/// @} | 120 | +#pragma mark - 消息会话操作 |
| 212 | 121 | ||
| 213 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 214 | -// | ||
| 215 | -// (五)获取好友管理器 | ||
| 216 | -// | ||
| 217 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 218 | -///@name 获取好友管理器 | ||
| 219 | -/// @{ | ||
| 220 | /** | 122 | /** |
| 221 | - * 获取好友管理器 | 123 | + * 获取会话 |
| 222 | * | 124 | * |
| 223 | - * TIMFriendshipManager 负责加好友,删除好友,查询好友列表等 | 125 | + * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊 |
| 126 | + * TIM_SYSTEM 表示系统会话 | ||
| 127 | + * @param receiver C2C 为对方用户 identifier,GROUP 为群组Id,SYSTEM为@"" | ||
| 224 | * | 128 | * |
| 225 | - * @return 好友管理器,详情请参考 TIMFriendshipManager.h 中的 TIMFriendshipManager 定义 | 129 | + * @return 会话对象 |
| 226 | */ | 130 | */ |
| 227 | -- (TIMFriendshipManager*)friendshipManager; | 131 | +- (TIMConversation*)getConversation:(TIMConversationType)type receiver:(NSString*)receiver; |
| 228 | 132 | ||
| 229 | -/// @} | 133 | +#pragma mark - APNs推送 |
| 230 | 134 | ||
| 231 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 232 | -// | ||
| 233 | -// (六)设置 APNs 推送 | ||
| 234 | -// | ||
| 235 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 236 | -/// @name 设置 APNs 推送 | ||
| 237 | -/// @{ | ||
| 238 | /** | 135 | /** |
| 239 | - * 6.1. 设置客户端 Token 和证书 busiId | ||
| 240 | - * | ||
| 241 | - * 1. token 是向苹果后台请求 DeviceToken,具体实现请参考 appdelegate.h 里面的 registNotification。 | ||
| 242 | - * 2. busiId 是向 IM 控制台上传 iOS 证书(p.12)生成的,具体步骤请参考 [离线推送](https://cloud.tencent.com/document/product/269/9154)。 | 136 | + * 设置Token,需要登录后调用 |
| 243 | * | 137 | * |
| 244 | - * @param token 详情请参考 TIMComm.h 中的 TIMTokenParam 定义 | ||
| 245 | - * @param succ 成功回调,详情请参考 TIMComm.h 中的 TIMSucc 定义 | ||
| 246 | - * @param fail 失败回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | 138 | + * @param token token信息 |
| 139 | + * @param succ 成功回调 | ||
| 140 | + * @param fail 失败回调 | ||
| 247 | * | 141 | * |
| 248 | - * @return 0:成功;1:失败,token 参数异常 | 142 | + * @return 0 成功 |
| 249 | */ | 143 | */ |
| 250 | - (int)setToken:(TIMTokenParam*)token succ:(TIMSucc)succ fail:(TIMFail)fail; | 144 | - (int)setToken:(TIMTokenParam*)token succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 251 | 145 | ||
| 252 | /** | 146 | /** |
| 253 | - * 6.2. 设置推送声音 | 147 | + * 设置APNS配置 |
| 254 | * | 148 | * |
| 255 | - * 不同用户可能想使用不同的推送声音,TIMAPNSConfig 提供了设置用户声音的字段,可实现单聊声音、群组声音的设置,也可在用户级别设置是否开启推送。 | 149 | + * @param config APNS配置 |
| 150 | + * @param succ 成功回调 | ||
| 151 | + * @param fail 失败回调 | ||
| 256 | * | 152 | * |
| 257 | - * @param config APNS 配置,详情请参考 TIMComm.h 中的 TIMAPNSConfig 定义 | ||
| 258 | - * @param succ 成功回调,详情请参考 TIMComm.h 中的 TIMSucc 定义 | ||
| 259 | - * @param fail 失败回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | ||
| 260 | - * | ||
| 261 | - * @return 0:成功;1:失败,config 参数异常 | 153 | + * @return 0 成功 |
| 262 | */ | 154 | */ |
| 263 | - (int)setAPNS:(TIMAPNSConfig*)config succ:(TIMSucc)succ fail:(TIMFail)fail; | 155 | - (int)setAPNS:(TIMAPNSConfig*)config succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 264 | 156 | ||
| 265 | /** | 157 | /** |
| 266 | - * 6.3. 获取推送声音设置 | 158 | + * 获取APNS配置 |
| 267 | * | 159 | * |
| 268 | - * @param succ 成功回调,返回配置信息,详情请参考 TIMComm.h 中的 TIMAPNSConfigSucc 定义 | ||
| 269 | - * @param fail 失败回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | 160 | + * @param succ 成功回调,返回配置信息 |
| 161 | + * @param fail 失败回调 | ||
| 270 | * | 162 | * |
| 271 | - * @return 0:成功;1:失败 | 163 | + * @return 0 成功 |
| 272 | */ | 164 | */ |
| 273 | - (int)getAPNSConfig:(TIMAPNSConfigSucc)succ fail:(TIMFail)fail; | 165 | - (int)getAPNSConfig:(TIMAPNSConfigSucc)succ fail:(TIMFail)fail; |
| 274 | 166 | ||
| 275 | /** | 167 | /** |
| 276 | - * 6.4. APP 进后台 | ||
| 277 | - * | ||
| 278 | - * APP 进后台的时候需要主动调用 doBackground ,这个时候后台知道 APP 的状态,之后的消息会下发推送通知。 | 168 | + * app 切后台时调用 |
| 279 | * | 169 | * |
| 280 | - * @param param 上报参数,详情请参考 TIMComm.h 中的 TIMBackgroundParam 定义 | ||
| 281 | - * @param succ 成功时回调,详情请参考 TIMComm.h 中的 TIMSucc 定义 | ||
| 282 | - * @param fail 失败时回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | 170 | + * @param param 上报参数 |
| 171 | + * @param succ 成功时回调 | ||
| 172 | + * @param fail 失败时回调 | ||
| 283 | * | 173 | * |
| 284 | - * @return 0:成功;1:失败 | 174 | + * @return 0 表示成功 |
| 285 | */ | 175 | */ |
| 286 | - (int)doBackground:(TIMBackgroundParam*)param succ:(TIMSucc)succ fail:(TIMFail)fail; | 176 | - (int)doBackground:(TIMBackgroundParam*)param succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 287 | 177 | ||
| 288 | 178 | ||
| 289 | /** | 179 | /** |
| 290 | - * 6.5. APP 进后台 | 180 | + * 切前台 |
| 291 | * | 181 | * |
| 292 | - * APP 进前台的时候需要主动调用 doForeground。 | 182 | + * @param succ 成功时回调 |
| 183 | + * @param fail 失败时回调 | ||
| 293 | * | 184 | * |
| 294 | - * @param succ 成功时回调,详情请参考 TIMComm.h 中的 TIMSucc 定义 | ||
| 295 | - * @param fail 失败时回调,详情请参考 TIMComm.h 中的 TIMFail 定义 | ||
| 296 | - * | ||
| 297 | - * @return 0:成功;1:失败 | 185 | + * @return 0 表示成功 |
| 298 | */ | 186 | */ |
| 299 | - (int)doForeground:(TIMSucc)succ fail:(TIMFail)fail; | 187 | - (int)doForeground:(TIMSucc)succ fail:(TIMFail)fail; |
| 300 | 188 | ||
| 301 | -/// @} | 189 | +#pragma mark - 调试使用 |
| 302 | 190 | ||
| 303 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 304 | -// | ||
| 305 | -// (七)多账号登录接口 | ||
| 306 | -// | ||
| 307 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 308 | -///@name 多账号登录接口 | ||
| 309 | -/// @{ | ||
| 310 | /** | 191 | /** |
| 311 | - * 创建新的管理器类型(多用户登陆时使用,否则可直接调用 sharedInstance) | ||
| 312 | - * | ||
| 313 | - * @return 管理器实例 | 192 | + * 获取网络状态 |
| 314 | */ | 193 | */ |
| 315 | -+ (TIMManager*)newManager; | 194 | +- (TIMNetworkStatus)networkStatus; |
| 316 | 195 | ||
| 317 | /** | 196 | /** |
| 318 | - * 获取管理器类型(多用户登陆时使用,否则可直接调用 sharedInstance) | 197 | + * 设置环境(在InitSdk之前调用,注意:除非是IM工作人员指定要求设置,否则不需要调用此接口) |
| 319 | * | 198 | * |
| 320 | - * @param identifier 用户 identifier | 199 | + * @param env 0 正式环境(默认) |
| 200 | + * 1 测试环境 | ||
| 201 | + */ | ||
| 202 | +- (void)setEnv:(int)env; | ||
| 203 | + | ||
| 204 | +/** | ||
| 205 | + * 获取环境类型 | ||
| 321 | * | 206 | * |
| 322 | - * @return 对应管理器类型,如果没有创建过,返回 nil | 207 | + * @return env 0 正式环境(默认) |
| 208 | + * 1 测试环境 | ||
| 209 | + * 2 beta 环境 | ||
| 323 | */ | 210 | */ |
| 324 | -+ (TIMManager*)getManager:(NSString*)identifier; | 211 | +- (int)getEnv; |
| 325 | 212 | ||
| 326 | /** | 213 | /** |
| 327 | - * 销毁管理器(多用户登陆时使用,否则可直接调用 sharedInstance) | 214 | + * 获取版本号 |
| 328 | * | 215 | * |
| 329 | - * @param manager 需要销毁的管理器 | 216 | + * @return 返回版本号,字符串表示,例如v1.1.1 |
| 330 | */ | 217 | */ |
| 331 | -+ (void)deleteManager:(TIMManager*)manager; | 218 | +- (NSString*)GetVersion; |
| 332 | 219 | ||
| 333 | -/// @} | 220 | +/** |
| 221 | + * 获取联网SDK的版本号 | ||
| 222 | + * | ||
| 223 | + * @return 返回版本号 | ||
| 224 | + */ | ||
| 225 | +- (NSString*)GetQALVersion; | ||
| 334 | 226 | ||
| 335 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 336 | -// | ||
| 337 | -// (八)调试相关接口 | ||
| 338 | -// | ||
| 339 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 340 | -/// @name 调试相关接口 | ||
| 341 | -/// @{ | ||
| 342 | /** | 227 | /** |
| 343 | - * 获取网络状态 | 228 | + * 打印日志,通过ImSDK提供的日志功能打印日志 |
| 344 | * | 229 | * |
| 345 | - * @return 网络状态,详情请参考 TIMComm.h 中的 TIMNetworkStatus 定义 | 230 | + * @param level 日志级别 |
| 231 | + * @param tag 模块tag | ||
| 232 | + * @param msg 要输出的日志内容 | ||
| 346 | */ | 233 | */ |
| 347 | -- (TIMNetworkStatus)networkStatus; | 234 | +- (void)log:(TIMLogLevel)level tag:(NSString*)tag msg:(NSString*)msg; |
| 235 | + | ||
| 236 | +#pragma mark - 登录多账号 | ||
| 348 | 237 | ||
| 349 | /** | 238 | /** |
| 350 | - * 设置环境(暂未实现) | 239 | + * 创建新的管理器类型(多用户登陆时使用,否则可直接调用sharedInstance) |
| 351 | * | 240 | * |
| 352 | - * 在 InitSdk 之前调用,注意:除非是 IM 工作人员指定要求设置,否则不需要调用此接口 | 241 | + * @return 管理器实例 |
| 242 | + */ | ||
| 243 | ++ (TIMManager*)newManager; | ||
| 244 | + | ||
| 245 | +/** | ||
| 246 | + * 获取管理器类型(多用户登陆时使用,否则可直接调用sharedInstance) | ||
| 353 | * | 247 | * |
| 354 | - * @param env 0:正式环境(默认);1:测试环境 | 248 | + * @param identifier 用户identifier |
| 355 | * | 249 | * |
| 250 | + * @return 对应管理器类型,如果没有创建过,返回nil | ||
| 356 | */ | 251 | */ |
| 357 | -- (void)setEnv:(int)env; | 252 | ++ (TIMManager*)getManager:(NSString*)identifier; |
| 358 | 253 | ||
| 359 | /** | 254 | /** |
| 360 | - * 获取环境类型(暂未实现) | ||
| 361 | - * | ||
| 362 | - * @return env 0:正式环境(默认);1:测试环境 | 255 | + * 销毁管理器(多用户登陆时使用,否则可直接调用sharedInstance) |
| 363 | * | 256 | * |
| 257 | + * @param manager 需要销毁的管理器 | ||
| 364 | */ | 258 | */ |
| 365 | -- (int)getEnv; | 259 | ++ (void)deleteManager:(TIMManager*)manager; |
| 366 | 260 | ||
| 367 | /** | 261 | /** |
| 368 | - * 获取版本号 | 262 | + * 获取好友管理器 |
| 369 | * | 263 | * |
| 370 | - * @return 返回版本号,字符串表示,例如 v1.1.1 | 264 | + * @return 好友管理器 |
| 371 | */ | 265 | */ |
| 372 | -- (NSString*)GetVersion; | 266 | +//- (TIMFriendshipManager*)friendshipManager; |
| 373 | 267 | ||
| 374 | /** | 268 | /** |
| 375 | - * 打印日志,通过 ImSDK 提供的日志功能打印日志 | 269 | + * 获取群管理器 |
| 376 | * | 270 | * |
| 377 | - * @param level 日志级别,详情请参考 TIMComm.h 中的 TIMLogLevel 定义 | ||
| 378 | - * @param tag 模块 tag | ||
| 379 | - * @param msg 要输出的日志内容 | 271 | + * @return 群管理器 |
| 380 | */ | 272 | */ |
| 381 | -- (void)log:(TIMLogLevel)level tag:(NSString*)tag msg:(NSString*)msg; | 273 | +- (TIMGroupManager*)groupManager; |
| 274 | + | ||
| 275 | +#pragma mark - 内部使用的方法 | ||
| 382 | 276 | ||
| 383 | /** | 277 | /** |
| 384 | * 获取日志文件路径 | 278 | * 获取日志文件路径 |
| @@ -386,35 +280,15 @@ | @@ -386,35 +280,15 @@ | ||
| 386 | - (NSString*)getLogPath; | 280 | - (NSString*)getLogPath; |
| 387 | 281 | ||
| 388 | /** | 282 | /** |
| 389 | - * 是否开启 sdk 日志打印 | ||
| 390 | - * | ||
| 391 | - * @return YES:允许 log 打印;NO:不允许 log 打印 | 283 | + * 是否开启sdk日志打印 |
| 392 | */ | 284 | */ |
| 393 | - (BOOL)getIsLogPrintEnabled; | 285 | - (BOOL)getIsLogPrintEnabled; |
| 394 | 286 | ||
| 395 | /** | 287 | /** |
| 396 | * 获取日志级别 | 288 | * 获取日志级别 |
| 397 | * | 289 | * |
| 398 | - * @return 返回日志级别,详情请参考 TIMComm.h 中的 TIMLogLevel 定义 | 290 | + * @return 返回日志级别 |
| 399 | */ | 291 | */ |
| 400 | -(TIMLogLevel) getLogLevel; | 292 | -(TIMLogLevel) getLogLevel; |
| 401 | - | ||
| 402 | -///@} | ||
| 403 | - | ||
| 404 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 405 | -// | ||
| 406 | -// (九)废弃接口 | ||
| 407 | -// | ||
| 408 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 409 | -/// @name 废弃接口 | ||
| 410 | -/// @{ | ||
| 411 | -/** | ||
| 412 | - * 获取联网SDK的版本号 (方法已废弃, SDK 不再依赖 QAL 库) | ||
| 413 | - * | ||
| 414 | - * @return 返回版本号 | ||
| 415 | - */ | ||
| 416 | -- (NSString*)GetQALVersion; | ||
| 417 | - | ||
| 418 | -///@} | ||
| 419 | @end | 293 | @end |
| 420 | #endif | 294 | #endif |
| @@ -9,18 +9,14 @@ | @@ -9,18 +9,14 @@ | ||
| 9 | #ifndef TIMMessage_h | 9 | #ifndef TIMMessage_h |
| 10 | #define TIMMessage_h | 10 | #define TIMMessage_h |
| 11 | 11 | ||
| 12 | -#import "TIMMessage.h" | 12 | +#import "ImSDK.h" |
| 13 | #import "TIMComm+MsgExt.h" | 13 | #import "TIMComm+MsgExt.h" |
| 14 | 14 | ||
| 15 | #pragma mark - Elem类型 | 15 | #pragma mark - Elem类型 |
| 16 | 16 | ||
| 17 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 18 | -// | ||
| 19 | -// (一)关系链变更消息 | ||
| 20 | -// | ||
| 21 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 22 | -/// @name 关系链变更消息 | ||
| 23 | -/// @{ | 17 | +/** |
| 18 | + * 关系链变更消息 | ||
| 19 | + */ | ||
| 24 | @interface TIMSNSSystemElem : TIMElem | 20 | @interface TIMSNSSystemElem : TIMElem |
| 25 | 21 | ||
| 26 | /** | 22 | /** |
| @@ -34,31 +30,25 @@ | @@ -34,31 +30,25 @@ | ||
| 34 | @property(nonatomic,strong) NSArray * users; | 30 | @property(nonatomic,strong) NSArray * users; |
| 35 | 31 | ||
| 36 | /** | 32 | /** |
| 37 | - * 未决已读上报时间戳 type = TIM_SNS_SYSTEM_PENDENCY_REPORT 有效 | 33 | + * 未决已读上报时间戳 type=TIM_SNS_SYSTEM_PENDENCY_REPORT 有效 |
| 38 | */ | 34 | */ |
| 39 | @property(nonatomic,assign) uint64_t pendencyReportTimestamp; | 35 | @property(nonatomic,assign) uint64_t pendencyReportTimestamp; |
| 40 | 36 | ||
| 41 | /** | 37 | /** |
| 42 | - * 推荐已读上报时间戳 type = TIM_SNS_SYSTEM_RECOMMEND_REPORT 有效 | 38 | + * 推荐已读上报时间戳 type=TIM_SNS_SYSTEM_RECOMMEND_REPORT 有效 |
| 43 | */ | 39 | */ |
| 44 | @property(nonatomic,assign) uint64_t recommendReportTimestamp; | 40 | @property(nonatomic,assign) uint64_t recommendReportTimestamp; |
| 45 | 41 | ||
| 46 | /** | 42 | /** |
| 47 | - * 已决已读上报时间戳 type = TIM_SNS_SYSTEM_DECIDE_REPORT 有效 | 43 | + * 已决已读上报时间戳 type=TIM_SNS_SYSTEM_DECIDE_REPORT 有效 |
| 48 | */ | 44 | */ |
| 49 | @property(nonatomic,assign) uint64_t decideReportTimestamp; | 45 | @property(nonatomic,assign) uint64_t decideReportTimestamp; |
| 50 | 46 | ||
| 51 | @end | 47 | @end |
| 52 | 48 | ||
| 53 | -/// @} | ||
| 54 | - | ||
| 55 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 56 | -// | ||
| 57 | -// (二)资料变更消息 | ||
| 58 | -// | ||
| 59 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 60 | -/// @name 资料变更消息 | ||
| 61 | -/// @{ | 49 | +/** |
| 50 | + * 资料变更系统消息 | ||
| 51 | + */ | ||
| 62 | @interface TIMProfileSystemElem : TIMElem | 52 | @interface TIMProfileSystemElem : TIMElem |
| 63 | 53 | ||
| 64 | /** | 54 | /** |
| @@ -72,87 +62,72 @@ | @@ -72,87 +62,72 @@ | ||
| 72 | @property(nonatomic,strong) NSString * fromUser; | 62 | @property(nonatomic,strong) NSString * fromUser; |
| 73 | 63 | ||
| 74 | /** | 64 | /** |
| 75 | - * 资料变更的昵称(如果昵称没有变更,该值为 nil) | 65 | + * 资料变更的昵称(如果昵称没有变更,该值为nil) |
| 76 | */ | 66 | */ |
| 77 | @property(nonatomic,strong) NSString * nickName; | 67 | @property(nonatomic,strong) NSString * nickName; |
| 78 | 68 | ||
| 79 | @end | 69 | @end |
| 80 | 70 | ||
| 81 | -/// @} | 71 | +#pragma mark - 消息扩展 |
| 82 | 72 | ||
| 83 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 84 | -// | ||
| 85 | -// (三)消息扩展接口 | ||
| 86 | -// | ||
| 87 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 88 | -/// @name 消息扩展接口 | ||
| 89 | -/// @{ | ||
| 90 | @interface TIMMessage (MsgExt) | 73 | @interface TIMMessage (MsgExt) |
| 91 | 74 | ||
| 92 | /** | 75 | /** |
| 93 | - * 自己是否已读 | 76 | + * 是否已读 |
| 94 | * | 77 | * |
| 95 | - * @return TRUE:已读;FALSE:未读 | 78 | + * @return TRUE 已读 FALSE 未读 |
| 96 | */ | 79 | */ |
| 97 | - (BOOL)isReaded; | 80 | - (BOOL)isReaded; |
| 98 | 81 | ||
| 99 | /** | 82 | /** |
| 100 | - * 对方是否已读(仅 C2C 消息有效) | 83 | + * 对方是否已读(仅C2C消息有效) |
| 101 | * | 84 | * |
| 102 | - * @return TRUE:已读;FALSE:未读 | 85 | + * @return TRUE 已读 FALSE 未读 |
| 103 | */ | 86 | */ |
| 104 | - (BOOL)isPeerReaded; | 87 | - (BOOL)isPeerReaded; |
| 105 | 88 | ||
| 106 | /** | 89 | /** |
| 107 | * 删除消息 | 90 | * 删除消息 |
| 108 | * | 91 | * |
| 109 | - * 目前暂不支持 Server 消息删除,只能在本地删除。删除后使用 getMessage 拉取本地消息,不会返回被删除的消息。 | ||
| 110 | - * | ||
| 111 | - * @return TRUE:成功;FALSE:失败 | 92 | + * @return TRUE 成功 |
| 112 | */ | 93 | */ |
| 113 | - (BOOL)remove; | 94 | - (BOOL)remove; |
| 114 | 95 | ||
| 115 | /** | 96 | /** |
| 116 | - * 消息是否有断层 | ||
| 117 | - * | ||
| 118 | - * OnNewMessage 回调收到消息,如果有断层,需要重新 getMessage 补全(有C2C漫游的情况下使用) | 97 | + * 消息有断层,OnNewMessage回调收到消息,如果有断层,需要重新GetMessage补全(有C2C漫游的情况下使用) |
| 119 | * | 98 | * |
| 120 | - * @return TRUE:有断层;FALSE:无断层 | 99 | + * @return TRUE 有断层 |
| 100 | + * FALSE 无断层 | ||
| 121 | */ | 101 | */ |
| 122 | - (BOOL)hasGap; | 102 | - (BOOL)hasGap; |
| 123 | 103 | ||
| 124 | /** | 104 | /** |
| 125 | - * 设置自定义整数,默认为 0 | ||
| 126 | - * | ||
| 127 | - * 1.此自定义字段仅存储于本地,不会同步到 Server,用户卸载应用或则更换终端后无法获取。 | ||
| 128 | - * 2.可以根据这个字段设置语音消息是否已经播放,如 customInt 的值 0 表示未播放,1 表示播放,当用户单击播放后可设置 customInt 的值为 1。 | 105 | + * 设置自定义整数,默认为0 |
| 129 | * | 106 | * |
| 130 | * @param param 设置参数 | 107 | * @param param 设置参数 |
| 131 | * | 108 | * |
| 132 | - * @return TRUE:设置成功;FALSE:设置失败 | 109 | + * @return TRUE 设置成功 |
| 133 | */ | 110 | */ |
| 134 | - (BOOL)setCustomInt:(int32_t)param; | 111 | - (BOOL)setCustomInt:(int32_t)param; |
| 135 | 112 | ||
| 136 | /** | 113 | /** |
| 137 | * 设置自定义数据,默认为"" | 114 | * 设置自定义数据,默认为"" |
| 138 | * | 115 | * |
| 139 | - * 此自定义字段仅存储于本地,不会同步到 Server,用户卸载应用或则更换终端后无法获取。 | ||
| 140 | - * | ||
| 141 | * @param data 设置参数 | 116 | * @param data 设置参数 |
| 142 | * | 117 | * |
| 143 | - * @return TRUE:设置成功;FALSE:设置失败 | 118 | + * @return TRUE 设置成功 |
| 144 | */ | 119 | */ |
| 145 | - (BOOL)setCustomData:(NSData*)data; | 120 | - (BOOL)setCustomData:(NSData*)data; |
| 146 | 121 | ||
| 147 | /** | 122 | /** |
| 148 | - * 获取 CustomInt | 123 | + * 获取CustomInt |
| 149 | * | 124 | * |
| 150 | * @return CustomInt | 125 | * @return CustomInt |
| 151 | */ | 126 | */ |
| 152 | - (int32_t)customInt; | 127 | - (int32_t)customInt; |
| 153 | 128 | ||
| 154 | /** | 129 | /** |
| 155 | - * 获取 CustomData | 130 | + * 获取CustomData |
| 156 | * | 131 | * |
| 157 | * @return CustomData | 132 | * @return CustomData |
| 158 | */ | 133 | */ |
| @@ -161,12 +136,12 @@ | @@ -161,12 +136,12 @@ | ||
| 161 | /** | 136 | /** |
| 162 | * 获取消息定位符 | 137 | * 获取消息定位符 |
| 163 | * | 138 | * |
| 164 | - * @return locator,详情请参考 TIMComm.h 里面的 TIMMessageLocator 定义 | 139 | + * @return locator |
| 165 | */ | 140 | */ |
| 166 | - (TIMMessageLocator*)locator; | 141 | - (TIMMessageLocator*)locator; |
| 167 | 142 | ||
| 168 | /** | 143 | /** |
| 169 | - * 是否为 locator 对应的消息 | 144 | + * 是否为locator对应的消息 |
| 170 | * | 145 | * |
| 171 | * @param locator 消息定位符 | 146 | * @param locator 消息定位符 |
| 172 | * | 147 | * |
| @@ -175,47 +150,35 @@ | @@ -175,47 +150,35 @@ | ||
| 175 | - (BOOL)respondsToLocator:(TIMMessageLocator*)locator; | 150 | - (BOOL)respondsToLocator:(TIMMessageLocator*)locator; |
| 176 | 151 | ||
| 177 | /** | 152 | /** |
| 178 | - * 设置消息时间戳 | ||
| 179 | - * | ||
| 180 | - * 需要先将消息到导入到本地,调用 convertToImportedMsg 方法 | 153 | + * 设置消息时间戳,导入到本地时有效 |
| 181 | * | 154 | * |
| 182 | * @param time 时间戳 | 155 | * @param time 时间戳 |
| 183 | * | 156 | * |
| 184 | - * @return 0:成功;1:失败 | 157 | + * @return 0 成功 |
| 185 | */ | 158 | */ |
| 186 | - (int)setTime:(time_t)time; | 159 | - (int)setTime:(time_t)time; |
| 187 | 160 | ||
| 188 | /** | 161 | /** |
| 189 | - * 设置消息发送方 | ||
| 190 | - * | ||
| 191 | - * 需要先将消息到导入到本地,调用 convertToImportedMsg 方法 | 162 | + * 设置消息发送方(需要先将消息到导入到本地,调用 convertToImportedMsg 方法) |
| 163 | + | ||
| 192 | * | 164 | * |
| 193 | * @param sender 发送方Id | 165 | * @param sender 发送方Id |
| 194 | * | 166 | * |
| 195 | - * @return 0:成功;1:失败 | 167 | + * @return 0 成功 |
| 196 | */ | 168 | */ |
| 197 | - (int)setSender:(NSString*)sender; | 169 | - (int)setSender:(NSString*)sender; |
| 198 | 170 | ||
| 199 | /** | 171 | /** |
| 200 | * 将消息导入到本地 | 172 | * 将消息导入到本地 |
| 201 | * | 173 | * |
| 202 | - * 只有调用这个接口,才能去修改消息的时间戳和发送方 | ||
| 203 | - * | ||
| 204 | - * @return 0:成功;1:失败 | 174 | + * @return 0 成功 |
| 205 | */ | 175 | */ |
| 206 | - (int)convertToImportedMsg; | 176 | - (int)convertToImportedMsg; |
| 207 | 177 | ||
| 208 | -/// @} | ||
| 209 | - | ||
| 210 | @end | 178 | @end |
| 211 | 179 | ||
| 212 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 213 | -// | ||
| 214 | -// (四)草稿箱 | ||
| 215 | -// | ||
| 216 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 217 | -/// @name 草稿箱 | ||
| 218 | -/// @{ | 180 | +#pragma mark - 消息草稿 |
| 181 | + | ||
| 219 | @interface TIMMessageDraft : NSObject | 182 | @interface TIMMessageDraft : NSObject |
| 220 | 183 | ||
| 221 | /** | 184 | /** |
| @@ -223,7 +186,7 @@ | @@ -223,7 +186,7 @@ | ||
| 223 | * | 186 | * |
| 224 | * @param userData 自定义数据 | 187 | * @param userData 自定义数据 |
| 225 | * | 188 | * |
| 226 | - * @return 0:成功;1:失败 | 189 | + * @return 0 成功 |
| 227 | */ | 190 | */ |
| 228 | - (int)setUserData:(NSData*)userData; | 191 | - (int)setUserData:(NSData*)userData; |
| 229 | 192 | ||
| @@ -239,17 +202,18 @@ | @@ -239,17 +202,18 @@ | ||
| 239 | * | 202 | * |
| 240 | * @param elem elem结构 | 203 | * @param elem elem结构 |
| 241 | * | 204 | * |
| 242 | - * @return 0:表示成功;1:禁止添加Elem(文件或语音多于两个Elem);2:未知Elem | ||
| 243 | - * | 205 | + * @return 0 表示成功 |
| 206 | + * 1 禁止添加Elem(文件或语音多于两个Elem) | ||
| 207 | + * 2 未知Elem | ||
| 244 | */ | 208 | */ |
| 245 | - (int)addElem:(TIMElem*)elem; | 209 | - (int)addElem:(TIMElem*)elem; |
| 246 | 210 | ||
| 247 | /** | 211 | /** |
| 248 | - * 获取对应索引的 Elem | 212 | + * 获取对应索引的Elem |
| 249 | * | 213 | * |
| 250 | * @param index 对应索引 | 214 | * @param index 对应索引 |
| 251 | * | 215 | * |
| 252 | - * @return 返回对应 Elem | 216 | + * @return 返回对应Elem |
| 253 | */ | 217 | */ |
| 254 | - (TIMElem*)getElem:(int)index; | 218 | - (TIMElem*)getElem:(int)index; |
| 255 | 219 | ||
| @@ -263,7 +227,7 @@ | @@ -263,7 +227,7 @@ | ||
| 263 | /** | 227 | /** |
| 264 | * 草稿生成对应的消息 | 228 | * 草稿生成对应的消息 |
| 265 | * | 229 | * |
| 266 | - * @return 消息,详情请参考 TIMMessage.h 里面的 TIMMessage 定义 | 230 | + * @return 消息 |
| 267 | */ | 231 | */ |
| 268 | - (TIMMessage*)transformToMessage; | 232 | - (TIMMessage*)transformToMessage; |
| 269 | 233 | ||
| @@ -274,8 +238,6 @@ | @@ -274,8 +238,6 @@ | ||
| 274 | */ | 238 | */ |
| 275 | - (NSDate*)timestamp; | 239 | - (NSDate*)timestamp; |
| 276 | 240 | ||
| 277 | -/// @} | ||
| 278 | - | ||
| 279 | @end | 241 | @end |
| 280 | 242 | ||
| 281 | #endif /* TIMMessage_h */ | 243 | #endif /* TIMMessage_h */ |
| @@ -18,29 +18,15 @@ | @@ -18,29 +18,15 @@ | ||
| 18 | @class TIMUserProfile; | 18 | @class TIMUserProfile; |
| 19 | @class TIMGroupMemberInfo; | 19 | @class TIMGroupMemberInfo; |
| 20 | @class TIMConversation; | 20 | @class TIMConversation; |
| 21 | -@class TIMSnapshot; | ||
| 22 | 21 | ||
| 23 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 24 | -// | ||
| 25 | -// (一)消息基类 | ||
| 26 | -// | ||
| 27 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 28 | -/// @name 消息基类 | ||
| 29 | /** | 22 | /** |
| 30 | - * 消息 Elem 基类 | 23 | + * 消息Elem基类 |
| 31 | */ | 24 | */ |
| 32 | @interface TIMElem : NSObject | 25 | @interface TIMElem : NSObject |
| 33 | @end | 26 | @end |
| 34 | -/// @} | ||
| 35 | 27 | ||
| 36 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 37 | -// | ||
| 38 | -// (二)文本消息 | ||
| 39 | -// | ||
| 40 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 41 | -/// @name 文本消息 | ||
| 42 | /** | 28 | /** |
| 43 | - * 文本消息 Elem | 29 | + * 文本消息Elem |
| 44 | */ | 30 | */ |
| 45 | @interface TIMTextElem : TIMElem | 31 | @interface TIMTextElem : TIMElem |
| 46 | /** | 32 | /** |
| @@ -48,17 +34,9 @@ | @@ -48,17 +34,9 @@ | ||
| 48 | */ | 34 | */ |
| 49 | @property(nonatomic,strong) NSString * text; | 35 | @property(nonatomic,strong) NSString * text; |
| 50 | @end | 36 | @end |
| 51 | -/// @} | ||
| 52 | 37 | ||
| 53 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 54 | -// | ||
| 55 | -// (三)图片消息 | ||
| 56 | -// | ||
| 57 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 58 | -/// @name 图片消息 | ||
| 59 | -/** | ||
| 60 | - * 图片 | ||
| 61 | - */ | 38 | +#pragma mark - 普通消息类型 |
| 39 | + | ||
| 62 | @interface TIMImage : NSObject | 40 | @interface TIMImage : NSObject |
| 63 | /** | 41 | /** |
| 64 | * 图片ID,内部标识,可用于外部缓存key | 42 | * 图片ID,内部标识,可用于外部缓存key |
| @@ -88,28 +66,16 @@ | @@ -88,28 +66,16 @@ | ||
| 88 | /** | 66 | /** |
| 89 | * 获取图片 | 67 | * 获取图片 |
| 90 | * | 68 | * |
| 91 | - * 下载的数据需要由开发者缓存,IM SDK 每次调用 getImage 都会从服务端重新下载数据。建议通过图片的 uuid 作为 key 进行图片文件的存储。 | ||
| 92 | - * | ||
| 93 | * @param path 图片保存路径 | 69 | * @param path 图片保存路径 |
| 94 | * @param succ 成功回调,返回图片数据 | 70 | * @param succ 成功回调,返回图片数据 |
| 95 | * @param fail 失败回调,返回错误码和错误描述 | 71 | * @param fail 失败回调,返回错误码和错误描述 |
| 96 | */ | 72 | */ |
| 97 | - (void)getImage:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | 73 | - (void)getImage:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 98 | - | ||
| 99 | -/** | ||
| 100 | - * 获取图片(有进度回调) | ||
| 101 | - * | ||
| 102 | - * 下载的数据需要由开发者缓存,IM SDK 每次调用 getImage 都会从服务端重新下载数据。建议通过图片的 uuid 作为 key 进行图片文件的存储。 | ||
| 103 | - * | ||
| 104 | - * @param path 图片保存路径 | ||
| 105 | - * @param progress 图片下载进度 | ||
| 106 | - * @param succ 成功回调,返回图片数据 | ||
| 107 | - * @param fail 失败回调,返回错误码和错误描述 | ||
| 108 | - */ | ||
| 109 | - (void)getImage:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | 74 | - (void)getImage:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 110 | 75 | ||
| 111 | @end | 76 | @end |
| 112 | 77 | ||
| 78 | + | ||
| 113 | /** | 79 | /** |
| 114 | * 图片消息Elem | 80 | * 图片消息Elem |
| 115 | */ | 81 | */ |
| @@ -121,17 +87,17 @@ | @@ -121,17 +87,17 @@ | ||
| 121 | @property(nonatomic,strong) NSString * path; | 87 | @property(nonatomic,strong) NSString * path; |
| 122 | 88 | ||
| 123 | /** | 89 | /** |
| 124 | - * 所有类型图片,只读,发送的时候不用关注,接收的时候这个字段会保存图片的所有规格,目前最多包含三种规格:原图、大图、缩略图,每种规格保存在一个 TIMImage 对象中 | 90 | + * 所有类型图片,只读 |
| 125 | */ | 91 | */ |
| 126 | @property(nonatomic,strong) NSArray * imageList; | 92 | @property(nonatomic,strong) NSArray * imageList; |
| 127 | 93 | ||
| 128 | /** | 94 | /** |
| 129 | - * 上传时任务Id,可用来查询上传进度(已废弃,请在 TIMUploadProgressListener 监听上传进度) | 95 | + * 上传时任务Id,可用来查询上传进度 |
| 130 | */ | 96 | */ |
| 131 | -@property(nonatomic,assign) uint32_t taskId DEPRECATED_ATTRIBUTE; | 97 | +@property(nonatomic,assign) uint32_t taskId; |
| 132 | 98 | ||
| 133 | /** | 99 | /** |
| 134 | - * 图片压缩等级,详见 TIM_IMAGE_COMPRESS_TYPE(仅对 jpg 格式有效) | 100 | + * 图片压缩等级,详见 TIM_IMAGE_COMPRESS_TYPE(仅对jpg格式有效) |
| 135 | */ | 101 | */ |
| 136 | @property(nonatomic,assign) TIM_IMAGE_COMPRESS_TYPE level; | 102 | @property(nonatomic,assign) TIM_IMAGE_COMPRESS_TYPE level; |
| 137 | 103 | ||
| @@ -142,224 +108,124 @@ | @@ -142,224 +108,124 @@ | ||
| 142 | 108 | ||
| 143 | @end | 109 | @end |
| 144 | 110 | ||
| 145 | -/// @} | ||
| 146 | - | ||
| 147 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 148 | -// | ||
| 149 | -// (四)语音消息 | ||
| 150 | -// | ||
| 151 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 152 | -/// @name 语音消息 | ||
| 153 | /** | 111 | /** |
| 154 | - * 语音消息Elem | ||
| 155 | - * | ||
| 156 | - * 1. 一条消息只能有一个语音 Elem,添加多条语音 Elem 时,AddElem 函数返回错误 1,添加不生效。 | ||
| 157 | - * 2. 语音和文件 Elem 不一定会按照添加时的顺序获取,建议逐个判断 Elem 类型展示,而且语音和文件 Elem 也不保证按照发送的 Elem 顺序排序。 | ||
| 158 | - * | 112 | + * 文件消息Elem |
| 159 | */ | 113 | */ |
| 160 | -@interface TIMSoundElem : TIMElem | 114 | +@interface TIMFileElem : TIMElem |
| 161 | /** | 115 | /** |
| 162 | - * 上传时任务Id,可用来查询上传进度(已废弃,请在 TIMUploadProgressListener 监听上传进度) | 116 | + * 上传时任务Id,可用来查询上传进度 |
| 163 | */ | 117 | */ |
| 164 | -@property(nonatomic,assign) uint32_t taskId DEPRECATED_ATTRIBUTE; | 118 | +@property(nonatomic,assign) uint32_t taskId; |
| 165 | /** | 119 | /** |
| 166 | - * 上传时,语音文件的路径,接收时使用 getSound 获得数据 | 120 | + * 上传时,文件的路径(设置path时,优先上传文件) |
| 167 | */ | 121 | */ |
| 168 | @property(nonatomic,strong) NSString * path; | 122 | @property(nonatomic,strong) NSString * path; |
| 169 | /** | 123 | /** |
| 170 | - * 语音消息内部 ID | 124 | + * 文件内部ID |
| 171 | */ | 125 | */ |
| 172 | @property(nonatomic,strong) NSString * uuid; | 126 | @property(nonatomic,strong) NSString * uuid; |
| 173 | /** | 127 | /** |
| 174 | - * 语音数据大小 | ||
| 175 | - */ | ||
| 176 | -@property(nonatomic,assign) int dataSize; | ||
| 177 | -/** | ||
| 178 | - * 语音长度(秒),发送消息时设置 | 128 | + * 文件大小 |
| 179 | */ | 129 | */ |
| 180 | -@property(nonatomic,assign) int second; | ||
| 181 | - | 130 | +@property(nonatomic,assign) int fileSize; |
| 182 | /** | 131 | /** |
| 183 | - * 获取语音数据到指定路径的文件中 | ||
| 184 | - * | ||
| 185 | - * getSound 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | ||
| 186 | - * | ||
| 187 | - * @param path 语音保存路径 | ||
| 188 | - * @param succ 成功回调 | ||
| 189 | - * @param fail 失败回调,返回错误码和错误描述 | 132 | + * 文件显示名,发消息时设置 |
| 190 | */ | 133 | */ |
| 191 | -- (void)getSound:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | 134 | +@property(nonatomic,strong) NSString * filename; |
| 192 | 135 | ||
| 193 | /** | 136 | /** |
| 194 | - * 获取语音数据到指定路径的文件中(有进度回调) | ||
| 195 | - * | ||
| 196 | - * getSound 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | 137 | + * 获取文件数据到指定路径的文件中 |
| 197 | * | 138 | * |
| 198 | - * @param path 语音保存路径 | ||
| 199 | - * @param progress 语音下载进度 | ||
| 200 | - * @param succ 成功回调 | 139 | + * @param path 文件保存路径 |
| 140 | + * @param succ 成功回调,返回数据 | ||
| 201 | * @param fail 失败回调,返回错误码和错误描述 | 141 | * @param fail 失败回调,返回错误码和错误描述 |
| 202 | */ | 142 | */ |
| 203 | -- (void)getSound:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | 143 | +- (void)getFile:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 144 | +- (void)getFile:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 204 | 145 | ||
| 205 | @end | 146 | @end |
| 206 | 147 | ||
| 207 | -/// @} | ||
| 208 | - | ||
| 209 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 210 | -// | ||
| 211 | -// (五)视频消息 | ||
| 212 | -// | ||
| 213 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 214 | -/// @name 视频消息 | ||
| 215 | /** | 148 | /** |
| 216 | - * 视频 | 149 | + * 语音消息Elem |
| 217 | */ | 150 | */ |
| 218 | -@interface TIMVideo : NSObject | 151 | +@interface TIMSoundElem : TIMElem |
| 219 | /** | 152 | /** |
| 220 | - * 视频消息内部 ID,不用设置 | 153 | + * 上传时任务Id,可用来查询上传进度 |
| 221 | */ | 154 | */ |
| 222 | -@property(nonatomic,strong) NSString * uuid; | 155 | +@property(nonatomic,assign) uint32_t taskId; |
| 223 | /** | 156 | /** |
| 224 | - * 视频文件类型,发送消息时设置 | 157 | + * 上传时,语音文件的路径,接收时使用getSound获得数据 |
| 225 | */ | 158 | */ |
| 226 | -@property(nonatomic,strong) NSString * type; | 159 | +@property(nonatomic,strong) NSString * path; |
| 227 | /** | 160 | /** |
| 228 | - * 视频大小,不用设置 | 161 | + * 语音消息内部ID |
| 229 | */ | 162 | */ |
| 230 | -@property(nonatomic,assign) int size; | 163 | +@property(nonatomic,strong) NSString * uuid; |
| 231 | /** | 164 | /** |
| 232 | - * 视频时长,发送消息时设置 | 165 | + * 语音数据大小 |
| 233 | */ | 166 | */ |
| 234 | -@property(nonatomic,assign) int duration; | ||
| 235 | - | 167 | +@property(nonatomic,assign) int dataSize; |
| 236 | /** | 168 | /** |
| 237 | - * 获取视频 | ||
| 238 | - * | ||
| 239 | - * getVideo 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | ||
| 240 | - * | ||
| 241 | - * @param path 视频保存路径 | ||
| 242 | - * @param succ 成功回调 | ||
| 243 | - * @param fail 失败回调,返回错误码和错误描述 | 169 | + * 语音长度(秒),发送消息时设置 |
| 244 | */ | 170 | */ |
| 245 | -- (void)getVideo:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | 171 | +@property(nonatomic,assign) int second; |
| 246 | 172 | ||
| 247 | /** | 173 | /** |
| 248 | - * 获取视频(有进度回调) | ||
| 249 | - * | ||
| 250 | - * getVideo 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | 174 | + * 获取语音数据到指定路径的文件中 |
| 251 | * | 175 | * |
| 252 | - * @param path 视频保存路径 | ||
| 253 | - * @param progress 视频下载进度 | 176 | + * @param path 语音保存路径 |
| 254 | * @param succ 成功回调 | 177 | * @param succ 成功回调 |
| 255 | * @param fail 失败回调,返回错误码和错误描述 | 178 | * @param fail 失败回调,返回错误码和错误描述 |
| 256 | */ | 179 | */ |
| 257 | -- (void)getVideo:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 258 | -@end | ||
| 259 | - | ||
| 260 | -/** | ||
| 261 | - * 视频消息 Elem | ||
| 262 | - */ | ||
| 263 | -@interface TIMVideoElem : TIMElem | 180 | +- (void)getSound:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 181 | +- (void)getSound:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 264 | 182 | ||
| 265 | -/** | ||
| 266 | - * 上传时任务Id,可用来查询上传进度 | ||
| 267 | - */ | ||
| 268 | -@property(nonatomic,assign) uint32_t taskId; | 183 | +@end |
| 269 | 184 | ||
| 270 | /** | 185 | /** |
| 271 | - * 视频文件路径,发送消息时设置 | 186 | + * 地理位置Elem |
| 272 | */ | 187 | */ |
| 273 | -@property(nonatomic,strong) NSString * videoPath; | ||
| 274 | - | 188 | +@interface TIMLocationElem : TIMElem |
| 275 | /** | 189 | /** |
| 276 | - * 视频信息,发送消息时设置 | 190 | + * 地理位置描述信息,发送消息时设置 |
| 277 | */ | 191 | */ |
| 278 | -@property(nonatomic,strong) TIMVideo * video; | ||
| 279 | - | 192 | +@property(nonatomic,strong) NSString * desc; |
| 280 | /** | 193 | /** |
| 281 | - * 截图文件路径,发送消息时设置 | 194 | + * 纬度,发送消息时设置 |
| 282 | */ | 195 | */ |
| 283 | -@property(nonatomic,strong) NSString * snapshotPath; | ||
| 284 | - | 196 | +@property(nonatomic,assign) double latitude; |
| 285 | /** | 197 | /** |
| 286 | - * 视频截图,发送消息时设置 | 198 | + * 经度,发送消息时设置 |
| 287 | */ | 199 | */ |
| 288 | -@property(nonatomic,strong) TIMSnapshot * snapshot; | ||
| 289 | - | 200 | +@property(nonatomic,assign) double longitude; |
| 290 | @end | 201 | @end |
| 291 | 202 | ||
| 292 | -/// @} | ||
| 293 | 203 | ||
| 294 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 295 | -// | ||
| 296 | -// (六)文件消息 | ||
| 297 | -// | ||
| 298 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 299 | -/// @name 文件消息 | ||
| 300 | /** | 204 | /** |
| 301 | - * 文件消息Elem | ||
| 302 | - */ | ||
| 303 | -@interface TIMFileElem : TIMElem | ||
| 304 | -/** | ||
| 305 | - * 上传时任务Id,可用来查询上传进度(已废弃,请在 TIMUploadProgressListener 监听上传进度) | ||
| 306 | - */ | ||
| 307 | -@property(nonatomic,assign) uint32_t taskId DEPRECATED_ATTRIBUTE; | ||
| 308 | -/** | ||
| 309 | - * 上传时,文件的路径(设置 path 时,优先上传文件) | ||
| 310 | - */ | ||
| 311 | -@property(nonatomic,strong) NSString * path; | ||
| 312 | -/** | ||
| 313 | - * 文件内部ID | 205 | + * 自定义消息类型 |
| 314 | */ | 206 | */ |
| 315 | -@property(nonatomic,strong) NSString * uuid; | 207 | +@interface TIMCustomElem : TIMElem |
| 208 | + | ||
| 316 | /** | 209 | /** |
| 317 | - * 文件大小 | 210 | + * 自定义消息二进制数据 |
| 318 | */ | 211 | */ |
| 319 | -@property(nonatomic,assign) int fileSize; | 212 | +@property(nonatomic,strong) NSData * data; |
| 320 | /** | 213 | /** |
| 321 | - * 文件显示名,发消息时设置 | 214 | + * 自定义消息描述信息,做离线Push时文本展示(已废弃,请使用TIMMessage中offlinePushInfo进行配置) |
| 322 | */ | 215 | */ |
| 323 | -@property(nonatomic,strong) NSString * filename; | ||
| 324 | - | 216 | +@property(nonatomic,strong) NSString * desc DEPRECATED_ATTRIBUTE; |
| 325 | /** | 217 | /** |
| 326 | - * 获取文件数据到指定路径的文件中 | ||
| 327 | - * | ||
| 328 | - * getFile 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | ||
| 329 | - * | ||
| 330 | - * @param path 文件保存路径 | ||
| 331 | - * @param succ 成功回调,返回数据 | ||
| 332 | - * @param fail 失败回调,返回错误码和错误描述 | 218 | + * 离线Push时扩展字段信息(已废弃,请使用TIMMessage中offlinePushInfo进行配置) |
| 333 | */ | 219 | */ |
| 334 | -- (void)getFile:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 335 | - | 220 | +@property(nonatomic,strong) NSString * ext DEPRECATED_ATTRIBUTE; |
| 336 | /** | 221 | /** |
| 337 | - * 获取文件数据到指定路径的文件中(有进度回调) | ||
| 338 | - * | ||
| 339 | - * getFile 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | ||
| 340 | - * | ||
| 341 | - * @param path 文件保存路径 | ||
| 342 | - * @param progress 文件下载进度 | ||
| 343 | - * @param succ 成功回调,返回数据 | ||
| 344 | - * @param fail 失败回调,返回错误码和错误描述 | 222 | + * 离线Push时声音字段信息(已废弃,请使用TIMMessage中offlinePushInfo进行配置) |
| 345 | */ | 223 | */ |
| 346 | -- (void)getFile:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 347 | - | 224 | +@property(nonatomic,strong) NSString * sound DEPRECATED_ATTRIBUTE; |
| 348 | @end | 225 | @end |
| 349 | 226 | ||
| 350 | -/// @} | ||
| 351 | - | ||
| 352 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 353 | -// | ||
| 354 | -// (七)表情消息 | ||
| 355 | -// | ||
| 356 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 357 | /** | 227 | /** |
| 358 | * 表情消息类型 | 228 | * 表情消息类型 |
| 359 | - * | ||
| 360 | - * 1. 表情消息由 TIMFaceElem 定义,SDK 并不提供表情包,如果开发者有表情包,可使用 index 存储表情在表情包中的索引,由用户自定义,或者直接使用 data 存储表情二进制信息以及字符串 key,都由用户自定义,SDK 内部只做透传。 | ||
| 361 | - * 2. index 和 data 只需要传入一个即可,ImSDK 只是透传这两个数据。 | ||
| 362 | - * | ||
| 363 | */ | 229 | */ |
| 364 | @interface TIMFaceElem : TIMElem | 230 | @interface TIMFaceElem : TIMElem |
| 365 | 231 | ||
| @@ -374,37 +240,36 @@ | @@ -374,37 +240,36 @@ | ||
| 374 | 240 | ||
| 375 | @end | 241 | @end |
| 376 | 242 | ||
| 377 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 378 | -// | ||
| 379 | -// (八)地理位置消息 | ||
| 380 | -// | ||
| 381 | -///////////////////////////////////////////////////////////////////////////////// | 243 | +@interface TIMVideo : NSObject |
| 382 | /** | 244 | /** |
| 383 | - * 地理位置Elem | 245 | + * 视频ID,不用设置 |
| 384 | */ | 246 | */ |
| 385 | -@interface TIMLocationElem : TIMElem | 247 | +@property(nonatomic,strong) NSString * uuid; |
| 386 | /** | 248 | /** |
| 387 | - * 地理位置描述信息,发送消息时设置 | 249 | + * 视频文件类型,发送消息时设置 |
| 388 | */ | 250 | */ |
| 389 | -@property(nonatomic,strong) NSString * desc; | 251 | +@property(nonatomic,strong) NSString * type; |
| 390 | /** | 252 | /** |
| 391 | - * 纬度,发送消息时设置 | 253 | + * 视频大小,不用设置 |
| 392 | */ | 254 | */ |
| 393 | -@property(nonatomic,assign) double latitude; | 255 | +@property(nonatomic,assign) int size; |
| 394 | /** | 256 | /** |
| 395 | - * 经度,发送消息时设置 | 257 | + * 视频时长,发送消息时设置 |
| 396 | */ | 258 | */ |
| 397 | -@property(nonatomic,assign) double longitude; | ||
| 398 | -@end | 259 | +@property(nonatomic,assign) int duration; |
| 399 | 260 | ||
| 400 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 401 | -// | ||
| 402 | -// (九)截图消息 | ||
| 403 | -// | ||
| 404 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 405 | /** | 261 | /** |
| 406 | - * 截图消息 Elem | 262 | + * 获取视频 |
| 263 | + * | ||
| 264 | + * @param path 视频保存路径 | ||
| 265 | + * @param succ 成功回调 | ||
| 266 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 407 | */ | 267 | */ |
| 268 | +- (void)getVideo:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 269 | +- (void)getVideo:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 270 | +@end | ||
| 271 | + | ||
| 272 | + | ||
| 408 | @interface TIMSnapshot : NSObject | 273 | @interface TIMSnapshot : NSObject |
| 409 | /** | 274 | /** |
| 410 | * 图片ID,不用设置 | 275 | * 图片ID,不用设置 |
| @@ -430,64 +295,48 @@ | @@ -430,64 +295,48 @@ | ||
| 430 | /** | 295 | /** |
| 431 | * 获取图片 | 296 | * 获取图片 |
| 432 | * | 297 | * |
| 433 | - * getImage 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | ||
| 434 | - * | ||
| 435 | * @param path 图片保存路径 | 298 | * @param path 图片保存路径 |
| 436 | * @param succ 成功回调,返回图片数据 | 299 | * @param succ 成功回调,返回图片数据 |
| 437 | * @param fail 失败回调,返回错误码和错误描述 | 300 | * @param fail 失败回调,返回错误码和错误描述 |
| 438 | */ | 301 | */ |
| 439 | - (void)getImage:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | 302 | - (void)getImage:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 440 | - | ||
| 441 | -/** | ||
| 442 | - * 获取图片(有进度回调) | ||
| 443 | - * | ||
| 444 | - * getImage 接口每次都会从服务端下载,如需缓存或者存储,开发者可根据 uuid 作为 key 进行外部存储,ImSDK 并不会存储资源文件。 | ||
| 445 | - * | ||
| 446 | - * @param path 图片保存路径 | ||
| 447 | - * @param progress 图片下载进度 | ||
| 448 | - * @param succ 成功回调,返回图片数据 | ||
| 449 | - * @param fail 失败回调,返回错误码和错误描述 | ||
| 450 | - */ | ||
| 451 | - (void)getImage:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | 303 | - (void)getImage:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; |
| 452 | 304 | ||
| 453 | @end | 305 | @end |
| 454 | 306 | ||
| 455 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 456 | -// | ||
| 457 | -// (十)自定义消息 | ||
| 458 | -// | ||
| 459 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 460 | /** | 307 | /** |
| 461 | - * 自定义消息类型 | ||
| 462 | - * | ||
| 463 | - * 自定义消息是指当内置的消息类型无法满足特殊需求,开发者可以自定义消息格式,内容全部由开发者定义,IM SDK 只负责透传。自定义消息由 TIMCustomElem 定义,其中 data 存储消息的二进制数据,其数据格式由开发者定义,desc 存储描述文本。一条消息内可以有多个自定义 Elem,并且可以跟其他 Elem 混合排列,离线 Push 时叠加每个 Elem 的 desc 描述信息进行下发。 | ||
| 464 | - * | 308 | + * 微视频消息 |
| 465 | */ | 309 | */ |
| 466 | -@interface TIMCustomElem : TIMElem | 310 | +@interface TIMVideoElem : TIMElem |
| 467 | 311 | ||
| 468 | /** | 312 | /** |
| 469 | - * 自定义消息二进制数据 | 313 | + * 上传时任务Id,可用来查询上传进度 |
| 470 | */ | 314 | */ |
| 471 | -@property(nonatomic,strong) NSData * data; | 315 | +@property(nonatomic,assign) uint32_t taskId; |
| 316 | + | ||
| 317 | +/** | ||
| 318 | + * 视频文件路径,发送消息时设置 | ||
| 319 | + */ | ||
| 320 | +@property(nonatomic,strong) NSString * videoPath; | ||
| 321 | + | ||
| 472 | /** | 322 | /** |
| 473 | - * 自定义消息描述信息,做离线Push时文本展示(已废弃,请使用 TIMMessage 中 offlinePushInfo 进行配置) | 323 | + * 视频信息,发送消息时设置 |
| 474 | */ | 324 | */ |
| 475 | -@property(nonatomic,strong) NSString * desc DEPRECATED_ATTRIBUTE; | 325 | +@property(nonatomic,strong) TIMVideo * video; |
| 326 | + | ||
| 476 | /** | 327 | /** |
| 477 | - * 离线Push时扩展字段信息(已废弃,请使用 TIMMessage 中 offlinePushInfo 进行配置) | 328 | + * 截图文件路径,发送消息时设置 |
| 478 | */ | 329 | */ |
| 479 | -@property(nonatomic,strong) NSString * ext DEPRECATED_ATTRIBUTE; | 330 | +@property(nonatomic,strong) NSString * snapshotPath; |
| 331 | + | ||
| 480 | /** | 332 | /** |
| 481 | - * 离线Push时声音字段信息(已废弃,请使用 TIMMessage 中 offlinePushInfo 进行配置) | 333 | + * 视频截图,发送消息时设置 |
| 482 | */ | 334 | */ |
| 483 | -@property(nonatomic,strong) NSString * sound DEPRECATED_ATTRIBUTE; | 335 | +@property(nonatomic,strong) TIMSnapshot * snapshot; |
| 336 | + | ||
| 484 | @end | 337 | @end |
| 485 | 338 | ||
| 486 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 487 | -// | ||
| 488 | -// (十一)群 Tips 消息 | ||
| 489 | -// | ||
| 490 | -///////////////////////////////////////////////////////////////////////////////// | 339 | +#pragma mark - 群系统消息和tip消息 |
| 491 | 340 | ||
| 492 | /** | 341 | /** |
| 493 | * 群tips,成员变更信息 | 342 | * 群tips,成员变更信息 |
| @@ -506,7 +355,7 @@ | @@ -506,7 +355,7 @@ | ||
| 506 | @end | 355 | @end |
| 507 | 356 | ||
| 508 | /** | 357 | /** |
| 509 | - * 群 tips,群变更信息 | 358 | + * 群tips,群变更信息 |
| 510 | */ | 359 | */ |
| 511 | @interface TIMGroupTipsElemGroupInfo : NSObject | 360 | @interface TIMGroupTipsElemGroupInfo : NSObject |
| 512 | 361 | ||
| @@ -593,11 +442,7 @@ | @@ -593,11 +442,7 @@ | ||
| 593 | 442 | ||
| 594 | @end | 443 | @end |
| 595 | 444 | ||
| 596 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 597 | -// | ||
| 598 | -// (十二)群系统消息 | ||
| 599 | -// | ||
| 600 | -///////////////////////////////////////////////////////////////////////////////// | 445 | + |
| 601 | /** | 446 | /** |
| 602 | * 群系统消息 | 447 | * 群系统消息 |
| 603 | */ | 448 | */ |
| @@ -623,6 +468,7 @@ | @@ -623,6 +468,7 @@ | ||
| 623 | */ | 468 | */ |
| 624 | @property(nonatomic,strong) NSString * msg; | 469 | @property(nonatomic,strong) NSString * msg; |
| 625 | 470 | ||
| 471 | + | ||
| 626 | /** | 472 | /** |
| 627 | * 消息标识,客户端无需关心 | 473 | * 消息标识,客户端无需关心 |
| 628 | */ | 474 | */ |
| @@ -634,7 +480,7 @@ | @@ -634,7 +480,7 @@ | ||
| 634 | @property(nonatomic,strong) NSData * authKey; | 480 | @property(nonatomic,strong) NSData * authKey; |
| 635 | 481 | ||
| 636 | /** | 482 | /** |
| 637 | - * 用户自定义透传消息体(type = TIM_GROUP_SYSTEM_CUSTOM_INFO 时有效) | 483 | + * 用户自定义透传消息体(type=TIM_GROUP_SYSTEM_CUSTOM_INFO时有效) |
| 638 | */ | 484 | */ |
| 639 | @property(nonatomic,strong) NSData * userData; | 485 | @property(nonatomic,strong) NSData * userData; |
| 640 | 486 | ||
| @@ -650,20 +496,16 @@ | @@ -650,20 +496,16 @@ | ||
| 650 | 496 | ||
| 651 | /** | 497 | /** |
| 652 | * 操作方平台信息 | 498 | * 操作方平台信息 |
| 653 | - * 取值: iOS、Android、Windows、Mac、Web、RESTAPI、Unknown | 499 | + * 取值: iOS Android Windows Mac Web RESTAPI Unknown |
| 654 | */ | 500 | */ |
| 655 | @property(nonatomic,strong) NSString * platform; | 501 | @property(nonatomic,strong) NSString * platform; |
| 656 | 502 | ||
| 657 | @end | 503 | @end |
| 658 | 504 | ||
| 505 | +#pragma mark - 消息体TIMMessage | ||
| 659 | 506 | ||
| 660 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 661 | -// | ||
| 662 | -// (十三)设置消息推送 | ||
| 663 | -// | ||
| 664 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 665 | /** | 507 | /** |
| 666 | - 填入 sound 字段表示接收时不会播放声音 | 508 | + 填入sound字段表示接收时不会播放声音 |
| 667 | */ | 509 | */ |
| 668 | extern NSString * const kIOSOfflinePushNoSound; | 510 | extern NSString * const kIOSOfflinePushNoSound; |
| 669 | 511 | ||
| @@ -673,7 +515,7 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -673,7 +515,7 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 673 | */ | 515 | */ |
| 674 | @property(nonatomic,strong) NSString * desc; | 516 | @property(nonatomic,strong) NSString * desc; |
| 675 | /** | 517 | /** |
| 676 | - * 离线 Push 时扩展字段信息 | 518 | + * 离线Push时扩展字段信息 |
| 677 | */ | 519 | */ |
| 678 | @property(nonatomic,strong) NSString * ext; | 520 | @property(nonatomic,strong) NSString * ext; |
| 679 | /** | 521 | /** |
| @@ -691,36 +533,33 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -691,36 +533,33 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 691 | @end | 533 | @end |
| 692 | 534 | ||
| 693 | 535 | ||
| 694 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 695 | -// | ||
| 696 | -// (十四)消息封装 | ||
| 697 | -// | ||
| 698 | -///////////////////////////////////////////////////////////////////////////////// | ||
| 699 | /** | 536 | /** |
| 700 | * 消息 | 537 | * 消息 |
| 701 | */ | 538 | */ |
| 702 | @interface TIMMessage : NSObject | 539 | @interface TIMMessage : NSObject |
| 703 | 540 | ||
| 704 | /** | 541 | /** |
| 705 | - * 增加 Elem | 542 | + * 增加Elem |
| 706 | * | 543 | * |
| 707 | - * @param elem elem 结构 | 544 | + * @param elem elem结构 |
| 708 | * | 545 | * |
| 709 | - * @return 0:表示成功;1:禁止添加 Elem(文件或语音多于两个 Elem);2:未知 Elem | 546 | + * @return 0 表示成功 |
| 547 | + * 1 禁止添加Elem(文件或语音多于两个Elem) | ||
| 548 | + * 2 未知Elem | ||
| 710 | */ | 549 | */ |
| 711 | - (int)addElem:(TIMElem*)elem; | 550 | - (int)addElem:(TIMElem*)elem; |
| 712 | 551 | ||
| 713 | /** | 552 | /** |
| 714 | - * 获取对应索引的 Elem | 553 | + * 获取对应索引的Elem |
| 715 | * | 554 | * |
| 716 | * @param index 对应索引 | 555 | * @param index 对应索引 |
| 717 | * | 556 | * |
| 718 | - * @return 返回对应 Elem | 557 | + * @return 返回对应Elem |
| 719 | */ | 558 | */ |
| 720 | - (TIMElem*)getElem:(int)index; | 559 | - (TIMElem*)getElem:(int)index; |
| 721 | 560 | ||
| 722 | /** | 561 | /** |
| 723 | - * 获取 Elem 数量 | 562 | + * 获取Elem数量 |
| 724 | * | 563 | * |
| 725 | * @return elem数量 | 564 | * @return elem数量 |
| 726 | */ | 565 | */ |
| @@ -738,7 +577,7 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -738,7 +577,7 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 738 | /** | 577 | /** |
| 739 | * 获得本消息离线推送配置信息 | 578 | * 获得本消息离线推送配置信息 |
| 740 | * | 579 | * |
| 741 | - * @return 配置信息,没设置返回 nil | 580 | + * @return 配置信息,没设置返回nil |
| 742 | */ | 581 | */ |
| 743 | - (TIMOfflinePushInfo*)getOfflinePushInfo; | 582 | - (TIMOfflinePushInfo*)getOfflinePushInfo; |
| 744 | 583 | ||
| @@ -746,14 +585,14 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -746,14 +585,14 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 746 | * 设置业务命令字 | 585 | * 设置业务命令字 |
| 747 | * | 586 | * |
| 748 | * @param buzCmds 业务命令字列表 | 587 | * @param buzCmds 业务命令字列表 |
| 749 | - * @"im_open_busi_cmd.msg_robot":表示发送给IM机器人; | ||
| 750 | - * @"im_open_busi_cmd.msg_nodb":表示不存离线; | ||
| 751 | - * @"im_open_busi_cmd.msg_noramble":表示不存漫游; | ||
| 752 | - * @"im_open_busi_cmd.msg_nopush":表示不实时下发给用户 | 588 | + * @"im_open_busi_cmd.msg_robot" 表示发送给IM机器人 |
| 589 | + * @"im_open_busi_cmd.msg_nodb" 表示不存离线 | ||
| 590 | + * @"im_open_busi_cmd.msg_noramble" 表示不存漫游 | ||
| 591 | + * @"im_open_busi_cmd.msg_nopush" 表示不实时下发给用户 | ||
| 753 | * | 592 | * |
| 754 | - * @return 0:成功;1:buzCmds 为 nil | 593 | + * @return 0 成功 |
| 755 | */ | 594 | */ |
| 756 | --(int)setBusinessCmd:(NSArray*)buzCmds; | 595 | +-(int) setBusinessCmd:(NSArray*)buzCmds; |
| 757 | 596 | ||
| 758 | /** | 597 | /** |
| 759 | * 获取会话 | 598 | * 获取会话 |
| @@ -772,7 +611,7 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -772,7 +611,7 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 772 | /** | 611 | /** |
| 773 | * 是否发送方 | 612 | * 是否发送方 |
| 774 | * | 613 | * |
| 775 | - * @return TRUE:表示是发送消息;FALSE:表示是接收消息 | 614 | + * @return TRUE 表示是发送消息 FALSE 表示是接收消息 |
| 776 | */ | 615 | */ |
| 777 | - (BOOL)isSelf; | 616 | - (BOOL)isSelf; |
| 778 | 617 | ||
| @@ -784,12 +623,12 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -784,12 +623,12 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 784 | - (NSString*)sender; | 623 | - (NSString*)sender; |
| 785 | 624 | ||
| 786 | /** | 625 | /** |
| 787 | - * 消息 Id,当消息生成时,就已经固定,这种方式可能跟其他用户产生的消息冲突,需要再加一个时间约束,可以认为 10 分钟以内的消息可以使用 msgId 区分,需要在同一个会话内判断。 | 626 | + * 消息Id |
| 788 | */ | 627 | */ |
| 789 | - (NSString*)msgId; | 628 | - (NSString*)msgId; |
| 790 | 629 | ||
| 791 | /** | 630 | /** |
| 792 | - * 消息 uniqueId,当消息发送成功以后才能固定下来(uniqueId),这种方式能保证全局唯一,需要在同一个会话内判断。 | 631 | + * 获取消息uniqueId |
| 793 | * | 632 | * |
| 794 | * @return uniqueId | 633 | * @return uniqueId |
| 795 | */ | 634 | */ |
| @@ -798,17 +637,15 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -798,17 +637,15 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 798 | /** | 637 | /** |
| 799 | * 当前消息的时间戳 | 638 | * 当前消息的时间戳 |
| 800 | * | 639 | * |
| 801 | - * @return 时间戳,该时间是 Server 时间,而非本地时间。在创建消息时,此时间为根据 Server 时间校准过的时间,发送成功后会改为准确的 Server 时间。 | 640 | + * @return 时间戳 |
| 802 | */ | 641 | */ |
| 803 | - (NSDate*)timestamp; | 642 | - (NSDate*)timestamp; |
| 804 | 643 | ||
| 644 | + | ||
| 805 | /** | 645 | /** |
| 806 | * 获取发送者资料(发送者为自己时可能为空) | 646 | * 获取发送者资料(发送者为自己时可能为空) |
| 807 | * | 647 | * |
| 808 | - * C2C 消息只有字段:identifier、nickname、customInfo,群组消息只有字段:identifier、nickname、faceURL、customInfo。如果要获取更多用户信息,请主动调用 TIMFriendshipManager.h 里面的 getUsersProfile 接口。 | ||
| 809 | - * C2C 消息不携带 faceURL,原因是在 C2C 会话中,对方的用户固定且 faceURL 一般不会变化,如果每条消息都带上这个字段,会造成系统资源的浪费。 | ||
| 810 | - * | ||
| 811 | - * @return 发送者资料,nil 表示没有获取资料 | 648 | + * @return 发送者资料,nil 表示没有获取资料,目前只有字段:identifier、nickname、faceURL、customInfo |
| 812 | */ | 649 | */ |
| 813 | - (TIMUserProfile*)getSenderProfile; | 650 | - (TIMUserProfile*)getSenderProfile; |
| 814 | 651 | ||
| @@ -829,9 +666,7 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -829,9 +666,7 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 829 | - (BOOL)setPriority:(TIMMessagePriority)priority; | 666 | - (BOOL)setPriority:(TIMMessagePriority)priority; |
| 830 | 667 | ||
| 831 | /** | 668 | /** |
| 832 | - * 获取消息的优先级(仅对群组消息有效) | ||
| 833 | - * | ||
| 834 | - * 对于直播场景,会有点赞和发红包功能,点赞相对优先级较低,红包消息优先级较高,具体消息内容可以使用 TIMCustomElem 进行定义,发送消息时,可设置消息优先级。 | 669 | + * 获取消息的优先级 |
| 835 | * | 670 | * |
| 836 | * @return 优先级 | 671 | * @return 优先级 |
| 837 | */ | 672 | */ |
| @@ -840,8 +675,6 @@ extern NSString * const kIOSOfflinePushNoSound; | @@ -840,8 +675,6 @@ extern NSString * const kIOSOfflinePushNoSound; | ||
| 840 | /** | 675 | /** |
| 841 | * 获取消息所属会话的接收消息选项(仅对群组消息有效) | 676 | * 获取消息所属会话的接收消息选项(仅对群组消息有效) |
| 842 | * | 677 | * |
| 843 | - * 对于群组会话消息,可以通过消息属性判断本群组设置的接收消息选项,可参阅 [群组管理](https://cloud.tencent.com/document/product/269/9152#.E4.BF.AE.E6.94.B9.E6.8E.A5.E6.94.B6.E7.BE.A4.E6.B6.88.E6.81.AF.E9.80.89.E9.A1.B9)。 | ||
| 844 | - * | ||
| 845 | * @return 接收消息选项 | 678 | * @return 接收消息选项 |
| 846 | */ | 679 | */ |
| 847 | - (TIMGroupReceiveMessageOpt)getRecvOpt; | 680 | - (TIMGroupReceiveMessageOpt)getRecvOpt; |
This file is too large to display.
No preview for this file type
| @@ -14,21 +14,21 @@ | @@ -14,21 +14,21 @@ | ||
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | * 原始声音的回调 | 16 | * 原始声音的回调 |
| 17 | - * @param data pcm数据 | ||
| 18 | - * @param timeStamp 时间戳 | ||
| 19 | - * @param sampleRate 采样率 | ||
| 20 | - * @param channels 声道数 | ||
| 21 | - * @param withBgm 回调的数据是否包含bgm,当不开启回声消除时,回调的raw pcm会包含bgm | 17 | + * @prarm data pcm数据 |
| 18 | + * @prarm timeStamp 时间戳 | ||
| 19 | + * @prarm sampleRate 采样率 | ||
| 20 | + * @prarm channels 声道数 | ||
| 21 | + * @prarm withBgm 回调的数据是否包含bgm,当不开启回声消除时,回调的raw pcm会包含bgm | ||
| 22 | */ | 22 | */ |
| 23 | @optional | 23 | @optional |
| 24 | - (void)onRecordRawPcmData:(NSData *)data timeStamp:(unsigned long long)timeStamp sampleRate:(int)sampleRate channels:(int)channels withBgm:(BOOL)withBgm; | 24 | - (void)onRecordRawPcmData:(NSData *)data timeStamp:(unsigned long long)timeStamp sampleRate:(int)sampleRate channels:(int)channels withBgm:(BOOL)withBgm; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 经过特效处理的声音回调 | 27 | * 经过特效处理的声音回调 |
| 28 | - * @param data pcm数据 | ||
| 29 | - * @param timeStamp 时间戳 | ||
| 30 | - * @param sampleRate 采样率 | ||
| 31 | - * @param channels 声道数 | 28 | + * @prarm data pcm数据 |
| 29 | + * @prarm timeStamp 时间戳 | ||
| 30 | + * @prarm sampleRate 采样率 | ||
| 31 | + * @prarm channels 声道数 | ||
| 32 | */ | 32 | */ |
| 33 | @optional | 33 | @optional |
| 34 | - (void)onRecordPcmData:(NSData *)data timeStamp:(unsigned long long)timeStamp sampleRate:(int)sampleRate channels:(int)channels; | 34 | - (void)onRecordPcmData:(NSData *)data timeStamp:(unsigned long long)timeStamp sampleRate:(int)sampleRate channels:(int)channels; |
-
Please register or login to post a comment