Merge branch 'develop' into 'master'
Develop See merge request !1
Showing
32 changed files
with
4911 additions
and
0 deletions
Too many changes to show.
To preserve performance only 32 of 32+ files are displayed.
.gitignore
0 → 100644
| 1 | +# Xcode | ||
| 2 | +# | ||
| 3 | +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
| 4 | + | ||
| 5 | +## Build generated | ||
| 6 | +build/ | ||
| 7 | +DerivedData/ | ||
| 8 | + | ||
| 9 | +## Various settings | ||
| 10 | +*.pbxuser | ||
| 11 | +!default.pbxuser | ||
| 12 | +*.mode1v3 | ||
| 13 | +!default.mode1v3 | ||
| 14 | +*.mode2v3 | ||
| 15 | +!default.mode2v3 | ||
| 16 | +*.perspectivev3 | ||
| 17 | +!default.perspectivev3 | ||
| 18 | +xcuserdata/ | ||
| 19 | + | ||
| 20 | +## Other | ||
| 21 | +*.moved-aside | ||
| 22 | +*.xccheckout | ||
| 23 | +*.xcscmblueprint | ||
| 24 | + | ||
| 25 | +## Obj-C/Swift specific | ||
| 26 | +*.hmap | ||
| 27 | +*.ipa | ||
| 28 | +*.dSYM.zip | ||
| 29 | +*.dSYM | ||
| 30 | + | ||
| 31 | +## Playgrounds | ||
| 32 | +timeline.xctimeline | ||
| 33 | +playground.xcworkspace | ||
| 34 | + | ||
| 35 | +# Swift Package Manager | ||
| 36 | +# | ||
| 37 | +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. | ||
| 38 | +# Packages/ | ||
| 39 | +# Package.pins | ||
| 40 | +.build/ | ||
| 41 | + | ||
| 42 | +# CocoaPods | ||
| 43 | +# | ||
| 44 | +# We recommend against adding the Pods directory to your .gitignore. However | ||
| 45 | +# you should judge for yourself, the pros and cons are mentioned at: | ||
| 46 | +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control | ||
| 47 | +# | ||
| 48 | +# Pods/ | ||
| 49 | + | ||
| 50 | +# Carthage | ||
| 51 | +# | ||
| 52 | +# Add this line if you want to avoid checking in source code from Carthage dependencies. | ||
| 53 | +# Carthage/Checkouts | ||
| 54 | + | ||
| 55 | +Carthage/Build | ||
| 56 | + | ||
| 57 | +# fastlane | ||
| 58 | +# | ||
| 59 | +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
| 60 | +# screenshots whenever they are needed. | ||
| 61 | +# For more information about the recommended setup visit: | ||
| 62 | +# https://docs.fastlane.tools/best-practices/source-control/#source-control | ||
| 63 | + | ||
| 64 | +fastlane/report.xml | ||
| 65 | +fastlane/Preview.html | ||
| 66 | +fastlane/screenshots | ||
| 67 | +fastlane/test_output |
.swift-version
0 → 100644
| 1 | +4.0 |
HHVDoctorSDK.podspec
0 → 100644
| 1 | +Pod::Spec.new do |s| | ||
| 2 | + s.name = "HHVDoctorSDK" | ||
| 3 | + s.version = "2.0.6.0705.1151" | ||
| 4 | + s.summary = "和缓视频医生 SDK" | ||
| 5 | + | ||
| 6 | + s.description = <<-DESC | ||
| 7 | + 和缓视频医生,连接千万用户和全科医生。 | ||
| 8 | + DESC | ||
| 9 | + | ||
| 10 | + s.homepage = "https://code.hh-medic.com/dev-client/hhsdk.ios" | ||
| 11 | + s.license = "MIT" | ||
| 12 | + s.author = { "shmily" => "shmilyshijian@foxmail.com" } | ||
| 13 | + s.social_media_url = "https://github.com/515783034" | ||
| 14 | + | ||
| 15 | + s.platform = :ios, "8.0" | ||
| 16 | + s.source = { :git => "http://code.hh-medic.com/hh_public/hhvDoctorSDK.ios.git", :tag => s.version } | ||
| 17 | + s.default_subspec = 'Base' | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + s.subspec 'Base' do |base| | ||
| 21 | + base.vendored_frameworks = 'HHVDoctorSDK/*.framework' | ||
| 22 | + base.resources = 'HHVDoctorSDK/resources/*.bundle' | ||
| 23 | + | ||
| 24 | + base.frameworks = 'SystemConfiguration', 'MobileCoreServices', 'AVFoundation', 'CoreTelephony', 'VideoToolbox', 'AudioToolbox', 'CoreMedia' | ||
| 25 | + base.libraries = 'z', 'sqlite3.0', 'c++', 'resolv.9' | ||
| 26 | + end | ||
| 27 | + | ||
| 28 | +end | ||
| 29 | + | ||
| 30 | + |
| 1 | +// | ||
| 2 | +// IMMessageExt.h | ||
| 3 | +// IMMessageExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2016/12/27. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_h | ||
| 10 | +#define ImSDK_h | ||
| 11 | + | ||
| 12 | +#import "ImSDK.h" | ||
| 13 | +#import "TIMConversation+MsgExt.h" | ||
| 14 | +#import "TIMMessage+MsgExt.h" | ||
| 15 | +#import "TIMComm+MsgExt.h" | ||
| 16 | +#import "TIMManager+MsgExt.h" | ||
| 17 | + | ||
| 18 | +#endif /* ImSDK_h */ |
| 1 | +// | ||
| 2 | +// IMSdkComm.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 10/12/14. | ||
| 6 | +// Copyright (c) 2014 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_IMSdkComm_h | ||
| 10 | +#define ImSDK_IMSdkComm_h | ||
| 11 | + | ||
| 12 | +@interface OMErrResp : NSObject | ||
| 13 | +{ | ||
| 14 | + NSString* cmd; // 返回的命令字 | ||
| 15 | + int seq; // 请求包的seq | ||
| 16 | + NSString* uin; // uin | ||
| 17 | + int errCode; // 错误码 | ||
| 18 | + NSString* errTips; // error tips | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +@property(nonatomic,strong) NSString* cmd; | ||
| 22 | +@property(nonatomic,strong) NSString* uin; | ||
| 23 | +@property(nonatomic,assign) int seq; | ||
| 24 | +@property(nonatomic,assign) int errCode; | ||
| 25 | +@property(nonatomic,strong) NSString* errTips; | ||
| 26 | + | ||
| 27 | +@end | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +/// 业务相关回调 | ||
| 31 | + | ||
| 32 | +/** | ||
| 33 | + * userid和tinyid 转换回包 | ||
| 34 | + * userList 存储IMUserId结构 | ||
| 35 | + */ | ||
| 36 | +@interface OMUserIdResp : NSObject{ | ||
| 37 | + NSArray* userList; // 用户的登录的open id | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | + | ||
| 41 | +@property(nonatomic,strong) NSArray* userList; | ||
| 42 | + | ||
| 43 | +@end | ||
| 44 | + | ||
| 45 | +/** | ||
| 46 | + * userid转换tinyid回调 | ||
| 47 | + * | ||
| 48 | + * @param resp 回包结构 | ||
| 49 | + * | ||
| 50 | + * @return 0 处理成功 | ||
| 51 | + */ | ||
| 52 | +typedef int (^OMUserIdSucc)(OMUserIdResp *resp); | ||
| 53 | + | ||
| 54 | +//请求回调 | ||
| 55 | +typedef int (^OMErr)(OMErrResp *resp); | ||
| 56 | + | ||
| 57 | + | ||
| 58 | +/** | ||
| 59 | + * 音视频回调 | ||
| 60 | + */ | ||
| 61 | +@interface OMCommandResp : NSObject{ | ||
| 62 | + NSData* rspbody; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | + | ||
| 66 | +@property(nonatomic,strong) NSData* rspbody; | ||
| 67 | + | ||
| 68 | +@end | ||
| 69 | + | ||
| 70 | +// relay 回调 | ||
| 71 | +typedef int (^OMCommandSucc)(OMCommandResp *resp); | ||
| 72 | + | ||
| 73 | +// request 回调 | ||
| 74 | +typedef void (^OMRequestSucc)(NSData * data); | ||
| 75 | +typedef void (^OMRequsetFail)(int code, NSString* msg); | ||
| 76 | + | ||
| 77 | +/** | ||
| 78 | + * UserId 结构,表示一个用户的账号信息 | ||
| 79 | + */ | ||
| 80 | +@interface IMUserId : NSObject{ | ||
| 81 | + NSString* uidtype; // uid 类型 | ||
| 82 | + unsigned int userappid; | ||
| 83 | + NSString* userid; // 用户id | ||
| 84 | + unsigned long long tinyid; | ||
| 85 | + unsigned long long uin; | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +@property(nonatomic,strong) NSString* uidtype; | ||
| 89 | +@property(nonatomic,assign) unsigned int userappid; | ||
| 90 | +@property(nonatomic,strong) NSString* userid; | ||
| 91 | +@property(nonatomic,assign) unsigned long long tinyid; | ||
| 92 | +@property(nonatomic,assign) unsigned long long uin; | ||
| 93 | + | ||
| 94 | +@end | ||
| 95 | + | ||
| 96 | +/** | ||
| 97 | + * 一般多人音视频操作成功回调 | ||
| 98 | + */ | ||
| 99 | +typedef void (^OMMultiSucc)(); | ||
| 100 | + | ||
| 101 | +/** | ||
| 102 | + * 一般多人音视频操作失败回调 | ||
| 103 | + * | ||
| 104 | + * @param code 错误码 | ||
| 105 | + * @param err 错误描述 | ||
| 106 | + */ | ||
| 107 | +typedef void (^OMMultiFail)(int code, NSString * err); | ||
| 108 | + | ||
| 109 | +#endif |
HHVDoctorSDK/ImSDK.framework/Headers/ImSDK.h
0 → 100755
| 1 | +// | ||
| 2 | +// ImSDK.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 24/3/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_ImSDK_h | ||
| 10 | +#define ImSDK_ImSDK_h | ||
| 11 | + | ||
| 12 | +#import "TIMComm.h" | ||
| 13 | +#import "TIMManager.h" | ||
| 14 | +#import "TIMMessage.h" | ||
| 15 | +#import "TIMConversation.h" | ||
| 16 | +#import "TIMGroupManager.h" | ||
| 17 | +#import "TIMCallback.h" | ||
| 18 | +//#import "TIMFriendshipManager.h" | ||
| 19 | + | ||
| 20 | +//#import "IMSdkInt.h" | ||
| 21 | + | ||
| 22 | +#endif |
| 1 | +// | ||
| 2 | +// TIMCallback.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 30/3/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_TIMCallback_h | ||
| 10 | +#define ImSDK_TIMCallback_h | ||
| 11 | + | ||
| 12 | +#import "TIMComm.h" | ||
| 13 | + | ||
| 14 | +@class TIMMessage; | ||
| 15 | +@class TIMGroupTipsElem; | ||
| 16 | +@class TIMGroupInfo; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 连接通知回调 | ||
| 20 | + */ | ||
| 21 | +@protocol TIMConnListener <NSObject> | ||
| 22 | +@optional | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * 网络连接成功 | ||
| 26 | + */ | ||
| 27 | +- (void)onConnSucc; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 网络连接失败 | ||
| 31 | + * | ||
| 32 | + * @param code 错误码 | ||
| 33 | + * @param err 错误描述 | ||
| 34 | + */ | ||
| 35 | +- (void)onConnFailed:(int)code err:(NSString*)err; | ||
| 36 | + | ||
| 37 | +/** | ||
| 38 | + * 网络连接断开(断线只是通知用户,不需要重新登陆,重连以后会自动上线) | ||
| 39 | + * | ||
| 40 | + * @param code 错误码 | ||
| 41 | + * @param err 错误描述 | ||
| 42 | + */ | ||
| 43 | +- (void)onDisconnect:(int)code err:(NSString*)err; | ||
| 44 | + | ||
| 45 | + | ||
| 46 | +/** | ||
| 47 | + * 连接中 | ||
| 48 | + */ | ||
| 49 | +- (void)onConnecting; | ||
| 50 | + | ||
| 51 | +@end | ||
| 52 | + | ||
| 53 | + | ||
| 54 | +/** | ||
| 55 | + * 用户在线状态通知 | ||
| 56 | + */ | ||
| 57 | +@protocol TIMUserStatusListener <NSObject> | ||
| 58 | +@optional | ||
| 59 | +/** | ||
| 60 | + * 踢下线通知 | ||
| 61 | + */ | ||
| 62 | +- (void)onForceOffline; | ||
| 63 | + | ||
| 64 | +/** | ||
| 65 | + * 断线重连失败 | ||
| 66 | + */ | ||
| 67 | +- (void)onReConnFailed:(int)code err:(NSString*)err; | ||
| 68 | + | ||
| 69 | +/** | ||
| 70 | + * 用户登录的userSig过期(用户需要重新获取userSig后登录) | ||
| 71 | + */ | ||
| 72 | +- (void)onUserSigExpired; | ||
| 73 | +@end | ||
| 74 | + | ||
| 75 | +/** | ||
| 76 | + * 页面刷新接口(如有需要未读计数刷新,会话列表刷新等) | ||
| 77 | + */ | ||
| 78 | +@protocol TIMRefreshListener <NSObject> | ||
| 79 | +@optional | ||
| 80 | +/** | ||
| 81 | + * 刷新会话 | ||
| 82 | + */ | ||
| 83 | +- (void)onRefresh; | ||
| 84 | + | ||
| 85 | +/** | ||
| 86 | + * 刷新部分会话(包括多终端已读上报同步) | ||
| 87 | + * | ||
| 88 | + * @param conversations 会话(TIMConversation*)列表 | ||
| 89 | + */ | ||
| 90 | +- (void)onRefreshConversations:(NSArray*)conversations; | ||
| 91 | +@end | ||
| 92 | + | ||
| 93 | +/** | ||
| 94 | + * 消息回调 | ||
| 95 | + */ | ||
| 96 | +@protocol TIMMessageListener <NSObject> | ||
| 97 | +@optional | ||
| 98 | +/** | ||
| 99 | + * 新消息回调通知 | ||
| 100 | + * | ||
| 101 | + * @param msgs 新消息列表,TIMMessage 类型数组 | ||
| 102 | + */ | ||
| 103 | +- (void)onNewMessage:(NSArray*)msgs; | ||
| 104 | +@end | ||
| 105 | + | ||
| 106 | +@protocol TIMMessageReceiptListener <NSObject> | ||
| 107 | +@optional | ||
| 108 | +/** | ||
| 109 | + * 收到了已读回执 | ||
| 110 | + * | ||
| 111 | + * @param receipts 已读回执(TIMMessageReceipt*)列表 | ||
| 112 | + */ | ||
| 113 | +- (void) onRecvMessageReceipts:(NSArray*)receipts; | ||
| 114 | +@end | ||
| 115 | + | ||
| 116 | +/** | ||
| 117 | + * 消息修改回调 | ||
| 118 | + */ | ||
| 119 | +@protocol TIMMessageUpdateListener <NSObject> | ||
| 120 | +@optional | ||
| 121 | +/** | ||
| 122 | + * 消息修改通知 | ||
| 123 | + * | ||
| 124 | + * @param msgs 修改的消息列表,TIMMessage 类型数组 | ||
| 125 | + */ | ||
| 126 | +- (void)onMessageUpdate:(NSArray*) msgs; | ||
| 127 | +@end | ||
| 128 | + | ||
| 129 | + | ||
| 130 | +@protocol TIMMessageRevokeListener <NSObject> | ||
| 131 | +@optional | ||
| 132 | +/** | ||
| 133 | + * 消息撤回通知 | ||
| 134 | + * | ||
| 135 | + * @param locator 被撤回消息的标识 | ||
| 136 | + */ | ||
| 137 | +- (void)onRevokeMessage:(TIMMessageLocator*)locator; | ||
| 138 | + | ||
| 139 | +@end | ||
| 140 | + | ||
| 141 | +/** | ||
| 142 | + * 图片上传进度回调 | ||
| 143 | + */ | ||
| 144 | +@protocol TIMUploadProgressListener <NSObject> | ||
| 145 | +@optional | ||
| 146 | +/** | ||
| 147 | + * 上传进度回调 | ||
| 148 | + * | ||
| 149 | + * @param msg 正在上传的消息 | ||
| 150 | + * @param elemidx 正在上传的elem的索引 | ||
| 151 | + * @param taskid 任务id | ||
| 152 | + * @param progress 上传进度 | ||
| 153 | + */ | ||
| 154 | +- (void)onUploadProgressCallback:(TIMMessage*)msg elemidx:(uint32_t)elemidx taskid:(uint32_t)taskid progress:(uint32_t)progress; | ||
| 155 | +@end | ||
| 156 | + | ||
| 157 | +/** | ||
| 158 | + * 群事件通知回调 | ||
| 159 | + */ | ||
| 160 | +@protocol TIMGroupEventListener <NSObject> | ||
| 161 | +@optional | ||
| 162 | +/** | ||
| 163 | + * 群tips回调 | ||
| 164 | + * | ||
| 165 | + * @param elem 群tips消息 | ||
| 166 | + */ | ||
| 167 | +- (void)onGroupTipsEvent:(TIMGroupTipsElem*)elem; | ||
| 168 | +@end | ||
| 169 | + | ||
| 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 | + | ||
| 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 | ||
| 255 | + | ||
| 256 | +#endif |
| 1 | +// | ||
| 2 | +// TIMComm+Group.h | ||
| 3 | +// IMGroupExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2017/2/9. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TIMComm_Group_h | ||
| 10 | +#define TIMComm_Group_h | ||
| 11 | + | ||
| 12 | +#import "ImSDK.h" | ||
| 13 | + | ||
| 14 | +@class TIMGroupPendencyMeta; | ||
| 15 | + | ||
| 16 | +#pragma mark - 枚举类型 | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * 群基本获取资料标志 | ||
| 20 | + */ | ||
| 21 | +typedef NS_ENUM(NSInteger, TIMGetGroupBaseInfoFlag) { | ||
| 22 | + /** | ||
| 23 | + * 不获取群组资料 | ||
| 24 | + */ | ||
| 25 | + TIM_GET_GROUP_BASE_INFO_FLAG_NONE = 0x00, | ||
| 26 | + /** | ||
| 27 | + * 获取群组名 | ||
| 28 | + */ | ||
| 29 | + TIM_GET_GROUP_BASE_INFO_FLAG_NAME = 0x01, | ||
| 30 | + /** | ||
| 31 | + * 获取创建时间 | ||
| 32 | + */ | ||
| 33 | + TIM_GET_GROUP_BASE_INFO_FLAG_CREATE_TIME = 0x01 << 1, | ||
| 34 | + /** | ||
| 35 | + * 获取群主id | ||
| 36 | + */ | ||
| 37 | + TIM_GET_GROUP_BASE_INFO_FLAG_OWNER_UIN = 0x01 << 2, | ||
| 38 | + /** | ||
| 39 | + * (不可用) | ||
| 40 | + */ | ||
| 41 | + TIM_GET_GROUP_BASE_INFO_FLAG_SEQ = 0x01 << 3, | ||
| 42 | + /** | ||
| 43 | + * 获取最近一次修改群信息时间 | ||
| 44 | + */ | ||
| 45 | + TIM_GET_GROUP_BASE_INFO_FLAG_TIME = 0x01 << 4, | ||
| 46 | + /** | ||
| 47 | + * (不可用) | ||
| 48 | + */ | ||
| 49 | + TIM_GET_GROUP_BASE_INFO_FLAG_NEXT_MSG_SEQ = 0x01 << 5, | ||
| 50 | + /** | ||
| 51 | + * 获取最近一次发消息时间 | ||
| 52 | + */ | ||
| 53 | + TIM_GET_GROUP_BASE_INFO_FLAG_LAST_MSG_TIME = 0x01 << 6, | ||
| 54 | + /** | ||
| 55 | + * (不可用) | ||
| 56 | + */ | ||
| 57 | + TIM_GET_GROUP_BASE_INFO_FLAG_APP_ID = 0x01 << 7, | ||
| 58 | + /** | ||
| 59 | + * 获取群成员数量 | ||
| 60 | + */ | ||
| 61 | + TIM_GET_GROUP_BASE_INFO_FLAG_MEMBER_NUM = 0x01 << 8, | ||
| 62 | + /** | ||
| 63 | + * 获取最大群成员数量 | ||
| 64 | + */ | ||
| 65 | + TIM_GET_GROUP_BASE_INFO_FLAG_MAX_MEMBER_NUM = 0x01 << 9, | ||
| 66 | + /** | ||
| 67 | + * 获取群公告 | ||
| 68 | + */ | ||
| 69 | + TIM_GET_GROUP_BASE_INFO_FLAG_NOTIFICATION = 0x01 << 10, | ||
| 70 | + /** | ||
| 71 | + * 获取群简介 | ||
| 72 | + */ | ||
| 73 | + TIM_GET_GROUP_BASE_INFO_FLAG_INTRODUCTION = 0x01 << 11, | ||
| 74 | + /** | ||
| 75 | + * 获取群头像 | ||
| 76 | + */ | ||
| 77 | + TIM_GET_GROUP_BASE_INFO_FLAG_FACE_URL = 0x01 << 12, | ||
| 78 | + /** | ||
| 79 | + * 获取入群类型 | ||
| 80 | + */ | ||
| 81 | + TIM_GET_GROUP_BASE_INFO_FLAG_ADD_OPTION = 0x01 << 13, | ||
| 82 | + /** | ||
| 83 | + * 获取群组类型 | ||
| 84 | + */ | ||
| 85 | + TIM_GET_GROUP_BASE_INFO_FLAG_GROUP_TYPE = 0x01 << 14, | ||
| 86 | + /** | ||
| 87 | + * 获取最后一条群消息 | ||
| 88 | + */ | ||
| 89 | + TIM_GET_GROUP_BASE_INFO_FLAG_LAST_MSG = 0x01 << 15, | ||
| 90 | + /** | ||
| 91 | + * 获取在线人数 | ||
| 92 | + */ | ||
| 93 | + TIM_GET_GROUP_BASE_INFO_FLAG_ONLINE_NUM = 0x01 << 16, | ||
| 94 | + /** | ||
| 95 | + * 获取群成员是否可见标志 | ||
| 96 | + */ | ||
| 97 | + TIM_GET_GROUP_BASE_INFO_VISIBLE = 0x01 << 17, | ||
| 98 | + /** | ||
| 99 | + * 获取群是否能被搜到标志 | ||
| 100 | + */ | ||
| 101 | + TIM_GET_GROUP_BASE_INFO_SEARCHABLE = 0x01 << 18, | ||
| 102 | + /** | ||
| 103 | + * 获取群全员禁言时间 | ||
| 104 | + */ | ||
| 105 | + TIM_GET_GROUP_BASE_INFO_ALL_SHUTUP = 0x01 << 19 | ||
| 106 | +}; | ||
| 107 | + | ||
| 108 | +/** | ||
| 109 | + * 群成员角色过滤方式 | ||
| 110 | + */ | ||
| 111 | +typedef NS_ENUM(NSInteger, TIMGroupMemberFilter) { | ||
| 112 | + /** | ||
| 113 | + * 全部成员 | ||
| 114 | + */ | ||
| 115 | + TIM_GROUP_MEMBER_FILTER_ALL = 0x00, | ||
| 116 | + /** | ||
| 117 | + * 群主 | ||
| 118 | + */ | ||
| 119 | + TIM_GROUP_MEMBER_FILTER_SUPER = 0x01, | ||
| 120 | + /** | ||
| 121 | + * 管理员 | ||
| 122 | + */ | ||
| 123 | + TIM_GROUP_MEMBER_FILTER_ADMIN = 0x02, | ||
| 124 | + /** | ||
| 125 | + * 普通成员 | ||
| 126 | + */ | ||
| 127 | + TIM_GROUP_MEMBER_FILTER_COMMON = 0x04, | ||
| 128 | +}; | ||
| 129 | + | ||
| 130 | +/** | ||
| 131 | + * 群成员获取资料标志 | ||
| 132 | + */ | ||
| 133 | +typedef NS_ENUM(NSInteger, TIMGetGroupMemInfoFlag) { | ||
| 134 | + | ||
| 135 | + /** | ||
| 136 | + * 入群时间 | ||
| 137 | + */ | ||
| 138 | + TIM_GET_GROUP_MEM_INFO_FLAG_JOIN_TIME = 0x01, | ||
| 139 | + /** | ||
| 140 | + * 消息标志 | ||
| 141 | + */ | ||
| 142 | + TIM_GET_GROUP_MEM_INFO_FLAG_MSG_FLAG = 0x01 << 1, | ||
| 143 | + /** | ||
| 144 | + * 角色 | ||
| 145 | + */ | ||
| 146 | + TIM_GET_GROUP_MEM_INFO_FLAG_ROLE_INFO = 0x01 << 3, | ||
| 147 | + /** | ||
| 148 | + * 禁言时间 | ||
| 149 | + */ | ||
| 150 | + TIM_GET_GROUP_MEM_INFO_FLAG_SHUTUP_TIME = 0x01 << 4, | ||
| 151 | + /** | ||
| 152 | + * 群名片 | ||
| 153 | + */ | ||
| 154 | + TIM_GET_GROUP_MEM_INFO_FLAG_NAME_CARD = 0x01 << 5, | ||
| 155 | +}; | ||
| 156 | + | ||
| 157 | +/** | ||
| 158 | + * 群组操作结果 | ||
| 159 | + */ | ||
| 160 | +typedef NS_ENUM(NSInteger, TIMGroupMemberStatus) { | ||
| 161 | + /** | ||
| 162 | + * 操作失败 | ||
| 163 | + */ | ||
| 164 | + TIM_GROUP_MEMBER_STATUS_FAIL = 0, | ||
| 165 | + | ||
| 166 | + /** | ||
| 167 | + * 操作成功 | ||
| 168 | + */ | ||
| 169 | + TIM_GROUP_MEMBER_STATUS_SUCC = 1, | ||
| 170 | + | ||
| 171 | + /** | ||
| 172 | + * 无效操作,加群时已经是群成员,移除群组时不在群内 | ||
| 173 | + */ | ||
| 174 | + TIM_GROUP_MEMBER_STATUS_INVALID = 2, | ||
| 175 | + | ||
| 176 | + /** | ||
| 177 | + * 等待处理,邀请入群时等待对方处理 | ||
| 178 | + */ | ||
| 179 | + TIM_GROUP_MEMBER_STATUS_PENDING = 3, | ||
| 180 | +}; | ||
| 181 | + | ||
| 182 | +typedef NS_ENUM(NSInteger, TIMGroupPendencyGetType) { | ||
| 183 | + /** | ||
| 184 | + * 申请入群 | ||
| 185 | + */ | ||
| 186 | + TIM_GROUP_PENDENCY_GET_TYPE_JOIN = 0x0, | ||
| 187 | + /** | ||
| 188 | + * 邀请入群 | ||
| 189 | + */ | ||
| 190 | + TIM_GROUP_PENDENCY_GET_TYPE_INVITE = 0x1, | ||
| 191 | +}; | ||
| 192 | + | ||
| 193 | +typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleStatus) { | ||
| 194 | + /** | ||
| 195 | + * 未处理 | ||
| 196 | + */ | ||
| 197 | + TIM_GROUP_PENDENCY_HANDLE_STATUS_UNHANDLED = 0, | ||
| 198 | + /** | ||
| 199 | + * 被他人处理 | ||
| 200 | + */ | ||
| 201 | + TIM_GROUP_PENDENCY_HANDLE_STATUS_OTHER_HANDLED = 1, | ||
| 202 | + /** | ||
| 203 | + * 被用户处理 | ||
| 204 | + */ | ||
| 205 | + TIM_GROUP_PENDENCY_HANDLE_STATUS_OPERATOR_HANDLED = 2, | ||
| 206 | +}; | ||
| 207 | + | ||
| 208 | +typedef NS_ENUM(NSInteger, TIMGroupPendencyHandleResult) { | ||
| 209 | + /** | ||
| 210 | + * 拒绝申请 | ||
| 211 | + */ | ||
| 212 | + TIM_GROUP_PENDENCY_HANDLE_RESULT_REFUSE = 0, | ||
| 213 | + /** | ||
| 214 | + * 同意申请 | ||
| 215 | + */ | ||
| 216 | + TIM_GROUP_PENDENCY_HANDLE_RESULT_AGREE = 1, | ||
| 217 | +}; | ||
| 218 | + | ||
| 219 | +#pragma mark - block回调 | ||
| 220 | + | ||
| 221 | +/** | ||
| 222 | + * 群成员列表回调 | ||
| 223 | + * | ||
| 224 | + * @param members 群成员列表 | ||
| 225 | + */ | ||
| 226 | +typedef void (^TIMGroupMemberSucc)(NSArray * members); | ||
| 227 | + | ||
| 228 | +/** | ||
| 229 | + * 群列表回调 | ||
| 230 | + * | ||
| 231 | + * @param arr 群列表 | ||
| 232 | + */ | ||
| 233 | +typedef void (^TIMGroupListSucc)(NSArray * arr); | ||
| 234 | + | ||
| 235 | +/** | ||
| 236 | + * 本人群组内成员信息回调 | ||
| 237 | + * | ||
| 238 | + * @param selfInfo 本人成员信息 | ||
| 239 | + */ | ||
| 240 | +typedef void (^TIMGroupSelfSucc)(TIMGroupMemberInfo * selfInfo); | ||
| 241 | + | ||
| 242 | +/** | ||
| 243 | + * 群接受消息选项回调 | ||
| 244 | + * | ||
| 245 | + * @param opt 群接受消息选项 | ||
| 246 | + */ | ||
| 247 | +typedef void (^TIMGroupReciveMessageOptSucc)(TIMGroupReceiveMessageOpt opt); | ||
| 248 | + | ||
| 249 | +/** | ||
| 250 | + * 群成员列表回调(分页使用) | ||
| 251 | + * | ||
| 252 | + * @param members 群成员(TIMGroupMemberInfo*)列表 | ||
| 253 | + */ | ||
| 254 | +typedef void (^TIMGroupMemberSuccV2)(uint64_t nextSeq, NSArray * members); | ||
| 255 | + | ||
| 256 | +/** | ||
| 257 | + * 群搜索回调 | ||
| 258 | + * | ||
| 259 | + * @param totalNum 搜索结果的总数 | ||
| 260 | + * @param groups 请求的群列表片段 | ||
| 261 | + */ | ||
| 262 | +typedef void (^TIMGroupSearchSucc)(uint64_t totalNum, NSArray * groups); | ||
| 263 | + | ||
| 264 | +/** | ||
| 265 | + * 获取群组未决请求列表成功 | ||
| 266 | + * | ||
| 267 | + * @param meta 未决请求元信息 | ||
| 268 | + * @param pendencies 未决请求列表(TIMGroupPendencyItem)数组 | ||
| 269 | + */ | ||
| 270 | +typedef void (^TIMGetGroupPendencyListSucc)(TIMGroupPendencyMeta * meta, NSArray * pendencies); | ||
| 271 | + | ||
| 272 | +#pragma mark - 基本类型 | ||
| 273 | + | ||
| 274 | +/** | ||
| 275 | + * 创建群参数 | ||
| 276 | + */ | ||
| 277 | +@interface TIMCreateGroupInfo : TIMCodingModel | ||
| 278 | + | ||
| 279 | +/** | ||
| 280 | + * 群组Id,nil则使用系统默认Id | ||
| 281 | + */ | ||
| 282 | +@property(nonatomic,strong) NSString* group; | ||
| 283 | + | ||
| 284 | +/** | ||
| 285 | + * 群名 | ||
| 286 | + */ | ||
| 287 | +@property(nonatomic,strong) NSString* groupName; | ||
| 288 | + | ||
| 289 | +/** | ||
| 290 | + * 群类型:Private,Public,ChatRoom,AVChatRoom,BChatRoom | ||
| 291 | + */ | ||
| 292 | +@property(nonatomic,strong) NSString* groupType; | ||
| 293 | + | ||
| 294 | +/** | ||
| 295 | + * 是否设置入群选项,Private类型群组请设置为false | ||
| 296 | + */ | ||
| 297 | +@property(nonatomic,assign) BOOL setAddOpt; | ||
| 298 | + | ||
| 299 | +/** | ||
| 300 | + * 入群选项 | ||
| 301 | + */ | ||
| 302 | +@property(nonatomic,assign) TIMGroupAddOpt addOpt; | ||
| 303 | + | ||
| 304 | +/** | ||
| 305 | + * 最大成员数,填0则系统使用默认值 | ||
| 306 | + */ | ||
| 307 | +@property(nonatomic,assign) uint32_t maxMemberNum; | ||
| 308 | + | ||
| 309 | +/** | ||
| 310 | + * 群公告 | ||
| 311 | + */ | ||
| 312 | +@property(nonatomic,strong) NSString* notification; | ||
| 313 | + | ||
| 314 | +/** | ||
| 315 | + * 群简介 | ||
| 316 | + */ | ||
| 317 | +@property(nonatomic,strong) NSString* introduction; | ||
| 318 | + | ||
| 319 | +/** | ||
| 320 | + * 群头像 | ||
| 321 | + */ | ||
| 322 | +@property(nonatomic,strong) NSString* faceURL; | ||
| 323 | + | ||
| 324 | +/** | ||
| 325 | + * 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 326 | + */ | ||
| 327 | +@property(nonatomic,strong) NSDictionary* customInfo; | ||
| 328 | + | ||
| 329 | +/** | ||
| 330 | + * 创建成员(TIMCreateGroupMemberInfo*)列表 | ||
| 331 | + */ | ||
| 332 | +@property(nonatomic,strong) NSArray* membersInfo; | ||
| 333 | + | ||
| 334 | +@end | ||
| 335 | + | ||
| 336 | +/** | ||
| 337 | + * 未决请求选项 | ||
| 338 | + */ | ||
| 339 | +@interface TIMGroupPendencyOption : TIMCodingModel | ||
| 340 | + | ||
| 341 | +/** | ||
| 342 | + * 拉取的起始时间 0:拉取最新的 | ||
| 343 | + */ | ||
| 344 | +@property(nonatomic,assign) uint64_t timestamp; | ||
| 345 | + | ||
| 346 | +/** | ||
| 347 | + * 每页的数量 | ||
| 348 | + */ | ||
| 349 | +@property(nonatomic,assign) uint32_t numPerPage; | ||
| 350 | +@end | ||
| 351 | + | ||
| 352 | +/** | ||
| 353 | + * 未决请求元信息 | ||
| 354 | + */ | ||
| 355 | +@interface TIMGroupPendencyMeta : TIMCodingModel | ||
| 356 | + | ||
| 357 | +/** | ||
| 358 | + * 下一次拉取的起始时间戳 | ||
| 359 | + */ | ||
| 360 | +@property(nonatomic,assign) uint64_t nextStartTime; | ||
| 361 | + | ||
| 362 | +/** | ||
| 363 | + * 已读时间戳大小 | ||
| 364 | + */ | ||
| 365 | +@property(nonatomic,assign) uint64_t readTimeSeq; | ||
| 366 | + | ||
| 367 | +/** | ||
| 368 | + * 未决未读数 | ||
| 369 | + */ | ||
| 370 | +@property(nonatomic,assign) uint32_t unReadCnt; | ||
| 371 | + | ||
| 372 | +@end | ||
| 373 | + | ||
| 374 | +/** | ||
| 375 | + * 创建群组时的成员信息 | ||
| 376 | + */ | ||
| 377 | +@interface TIMCreateGroupMemberInfo : TIMCodingModel | ||
| 378 | + | ||
| 379 | +/** | ||
| 380 | + * 被操作成员 | ||
| 381 | + */ | ||
| 382 | +@property(nonatomic,strong) NSString* member; | ||
| 383 | + | ||
| 384 | +/** | ||
| 385 | + * 成员类型 | ||
| 386 | + */ | ||
| 387 | +@property(nonatomic,assign) TIMGroupMemberRole role; | ||
| 388 | + | ||
| 389 | +/** | ||
| 390 | + * 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 391 | + */ | ||
| 392 | +@property(nonatomic,strong) NSDictionary* customInfo; | ||
| 393 | + | ||
| 394 | +@end | ||
| 395 | + | ||
| 396 | +/** | ||
| 397 | + * 成员操作返回值 | ||
| 398 | + */ | ||
| 399 | +@interface TIMGroupMemberResult : NSObject | ||
| 400 | + | ||
| 401 | +/** | ||
| 402 | + * 被操作成员 | ||
| 403 | + */ | ||
| 404 | +@property(nonatomic,strong) NSString* member; | ||
| 405 | +/** | ||
| 406 | + * 返回状态 | ||
| 407 | + */ | ||
| 408 | +@property(nonatomic,assign) TIMGroupMemberStatus status; | ||
| 409 | + | ||
| 410 | +@end | ||
| 411 | + | ||
| 412 | +/** | ||
| 413 | + * 未决申请 | ||
| 414 | + */ | ||
| 415 | +@interface TIMGroupPendencyItem : TIMCodingModel | ||
| 416 | + | ||
| 417 | +/** | ||
| 418 | + * 相关群组id | ||
| 419 | + */ | ||
| 420 | +@property(nonatomic,strong) NSString* groupId; | ||
| 421 | + | ||
| 422 | +/** | ||
| 423 | + * 请求者id,请求加群:请求者,邀请加群:邀请人 | ||
| 424 | + */ | ||
| 425 | +@property(nonatomic,strong) NSString* fromUser; | ||
| 426 | + | ||
| 427 | +/** | ||
| 428 | + * 判决者id,请求加群:0,邀请加群:被邀请人 | ||
| 429 | + */ | ||
| 430 | +@property(nonatomic,strong) NSString* toUser; | ||
| 431 | + | ||
| 432 | +/** | ||
| 433 | + * 未决添加时间 | ||
| 434 | + */ | ||
| 435 | +@property(nonatomic,assign) uint64_t addTime; | ||
| 436 | + | ||
| 437 | +/** | ||
| 438 | + * 未决请求类型 | ||
| 439 | + */ | ||
| 440 | +@property(nonatomic,assign) TIMGroupPendencyGetType getType; | ||
| 441 | + | ||
| 442 | +/** | ||
| 443 | + * 已决标志 | ||
| 444 | + */ | ||
| 445 | +@property(nonatomic,assign) TIMGroupPendencyHandleStatus handleStatus; | ||
| 446 | + | ||
| 447 | +/** | ||
| 448 | + * 已决结果 | ||
| 449 | + */ | ||
| 450 | +@property(nonatomic,assign) TIMGroupPendencyHandleResult handleResult; | ||
| 451 | + | ||
| 452 | +/** | ||
| 453 | + * 申请或邀请附加信息 | ||
| 454 | + */ | ||
| 455 | +@property(nonatomic,strong) NSString* requestMsg; | ||
| 456 | + | ||
| 457 | +/** | ||
| 458 | + * 审批信息:同意或拒绝信息 | ||
| 459 | + */ | ||
| 460 | +@property(nonatomic,strong) NSString* handledMsg; | ||
| 461 | + | ||
| 462 | + | ||
| 463 | +/** | ||
| 464 | + * 同意申请 | ||
| 465 | + * | ||
| 466 | + * @param msg 同意理由,选填 | ||
| 467 | + * @param succ 成功回调 | ||
| 468 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 469 | + */ | ||
| 470 | +-(void) accept:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 471 | + | ||
| 472 | +/** | ||
| 473 | + * 拒绝申请 | ||
| 474 | + * | ||
| 475 | + * @param msg 拒绝理由,选填 | ||
| 476 | + * @param succ 成功回调 | ||
| 477 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 478 | + */ | ||
| 479 | +-(void) refuse:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 480 | + | ||
| 481 | + | ||
| 482 | +/** | ||
| 483 | + * 用户自己的id | ||
| 484 | + */ | ||
| 485 | +@property(nonatomic,strong) NSString* selfIdentifier; | ||
| 486 | + | ||
| 487 | +@end | ||
| 488 | + | ||
| 489 | +#endif /* TIMComm_Group_h */ |
| 1 | +// | ||
| 2 | +// TIMComm+MsgExt.h | ||
| 3 | +// IMMessageExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2017/1/11. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TIMComm_MsgExt_h | ||
| 10 | +#define TIMComm_MsgExt_h | ||
| 11 | + | ||
| 12 | +#import <Foundation/Foundation.h> | ||
| 13 | +#import "ImSDK.h" | ||
| 14 | + | ||
| 15 | +@class TIMSendToUsersDetailInfo; | ||
| 16 | + | ||
| 17 | +#pragma mark - 枚举类型 | ||
| 18 | + | ||
| 19 | +typedef NS_ENUM(NSInteger, TIM_SNS_SYSTEM_TYPE){ | ||
| 20 | + /** | ||
| 21 | + * 增加好友消息 | ||
| 22 | + */ | ||
| 23 | + TIM_SNS_SYSTEM_ADD_FRIEND = 0x01, | ||
| 24 | + /** | ||
| 25 | + * 删除好友消息 | ||
| 26 | + */ | ||
| 27 | + TIM_SNS_SYSTEM_DEL_FRIEND = 0x02, | ||
| 28 | + /** | ||
| 29 | + * 增加好友申请 | ||
| 30 | + */ | ||
| 31 | + TIM_SNS_SYSTEM_ADD_FRIEND_REQ = 0x03, | ||
| 32 | + /** | ||
| 33 | + * 删除未决申请 | ||
| 34 | + */ | ||
| 35 | + TIM_SNS_SYSTEM_DEL_FRIEND_REQ = 0x04, | ||
| 36 | + /** | ||
| 37 | + * 黑名单添加 | ||
| 38 | + */ | ||
| 39 | + TIM_SNS_SYSTEM_ADD_BLACKLIST = 0x05, | ||
| 40 | + /** | ||
| 41 | + * 黑名单删除 | ||
| 42 | + */ | ||
| 43 | + TIM_SNS_SYSTEM_DEL_BLACKLIST = 0x06, | ||
| 44 | + /** | ||
| 45 | + * 未决已读上报 | ||
| 46 | + */ | ||
| 47 | + TIM_SNS_SYSTEM_PENDENCY_REPORT = 0x07, | ||
| 48 | + /** | ||
| 49 | + * 关系链资料变更 | ||
| 50 | + */ | ||
| 51 | + TIM_SNS_SYSTEM_SNS_PROFILE_CHANGE = 0x08, | ||
| 52 | + /** | ||
| 53 | + * 推荐数据增加 | ||
| 54 | + */ | ||
| 55 | + TIM_SNS_SYSTEM_ADD_RECOMMEND = 0x09, | ||
| 56 | + /** | ||
| 57 | + * 推荐数据删除 | ||
| 58 | + */ | ||
| 59 | + TIM_SNS_SYSTEM_DEL_RECOMMEND = 0x0a, | ||
| 60 | + /** | ||
| 61 | + * 已决增加 | ||
| 62 | + */ | ||
| 63 | + TIM_SNS_SYSTEM_ADD_DECIDE = 0x0b, | ||
| 64 | + /** | ||
| 65 | + * 已决删除 | ||
| 66 | + */ | ||
| 67 | + TIM_SNS_SYSTEM_DEL_DECIDE = 0x0c, | ||
| 68 | + /** | ||
| 69 | + * 推荐已读上报 | ||
| 70 | + */ | ||
| 71 | + TIM_SNS_SYSTEM_RECOMMEND_REPORT = 0x0d, | ||
| 72 | + /** | ||
| 73 | + * 已决已读上报 | ||
| 74 | + */ | ||
| 75 | + TIM_SNS_SYSTEM_DECIDE_REPORT = 0x0e, | ||
| 76 | + | ||
| 77 | + | ||
| 78 | +}; | ||
| 79 | + | ||
| 80 | +/** | ||
| 81 | + * 资料变更 | ||
| 82 | + */ | ||
| 83 | +typedef NS_ENUM(NSInteger, TIM_PROFILE_SYSTEM_TYPE){ | ||
| 84 | + /** | ||
| 85 | + 好友资料变更 | ||
| 86 | + */ | ||
| 87 | + TIM_PROFILE_SYSTEM_FRIEND_PROFILE_CHANGE = 0x01, | ||
| 88 | +}; | ||
| 89 | + | ||
| 90 | +#pragma mark - block回调 | ||
| 91 | + | ||
| 92 | +typedef void (^TIMSendToUsersFail)(int code, NSString *err, TIMSendToUsersDetailInfo *detailInfo); | ||
| 93 | + | ||
| 94 | +#pragma mark - 基本类型 | ||
| 95 | + | ||
| 96 | +/** | ||
| 97 | + * 发送消息给多用户的失败回调信息 | ||
| 98 | + */ | ||
| 99 | +@interface TIMSendToUsersDetailInfo : NSObject | ||
| 100 | +/** | ||
| 101 | + * 发送消息成功的目标用户数 | ||
| 102 | + */ | ||
| 103 | +@property(nonatomic,assign) uint32_t succCnt; | ||
| 104 | +/** | ||
| 105 | + * 发送消息失败的目标用户数 | ||
| 106 | + */ | ||
| 107 | +@property(nonatomic,assign) uint32_t failCnt; | ||
| 108 | +/** | ||
| 109 | + * 失败信息(TIMSendToUsersErrInfo*)列表 | ||
| 110 | + */ | ||
| 111 | +@property(nonatomic,strong) NSArray *errInofs; | ||
| 112 | +@end | ||
| 113 | + | ||
| 114 | +/** | ||
| 115 | + * 发送消息给多用户的失败信息 | ||
| 116 | + */ | ||
| 117 | +@interface TIMSendToUsersErrInfo : NSObject | ||
| 118 | +/** | ||
| 119 | + * 发送消息失败的目标用户id | ||
| 120 | + */ | ||
| 121 | +@property(nonatomic,strong) NSString *identifier; | ||
| 122 | +/** | ||
| 123 | + * 错误码 | ||
| 124 | + */ | ||
| 125 | +@property(nonatomic,assign) int code; | ||
| 126 | +/** | ||
| 127 | + * 错误描述 | ||
| 128 | + */ | ||
| 129 | +@property(nonatomic,strong) NSString *err; | ||
| 130 | +@end | ||
| 131 | + | ||
| 132 | +/** | ||
| 133 | + * 关系链变更详细信息 | ||
| 134 | + */ | ||
| 135 | +@interface TIMSNSChangeInfo : NSObject | ||
| 136 | + | ||
| 137 | +/** | ||
| 138 | + * 用户 identifier | ||
| 139 | + */ | ||
| 140 | +@property(nonatomic,strong) NSString * identifier; | ||
| 141 | + | ||
| 142 | +/** | ||
| 143 | + * 用户昵称 | ||
| 144 | + */ | ||
| 145 | +@property(nonatomic,strong) NSString * nickname; | ||
| 146 | + | ||
| 147 | +/** | ||
| 148 | + * 申请添加时有效,添加理由 | ||
| 149 | + */ | ||
| 150 | +@property(nonatomic,strong) NSString * wording; | ||
| 151 | + | ||
| 152 | +/** | ||
| 153 | + * 申请时填写,添加来源 | ||
| 154 | + */ | ||
| 155 | +@property(nonatomic,strong) NSString * source; | ||
| 156 | + | ||
| 157 | + | ||
| 158 | +/** | ||
| 159 | + * 备注 type=TIM_SNS_SYSTEM_SNS_PROFILE_CHANGE 有效 | ||
| 160 | + */ | ||
| 161 | +@property(nonatomic,strong) NSString * remark; | ||
| 162 | + | ||
| 163 | +@end | ||
| 164 | + | ||
| 165 | +#endif /* TIMComm_MsgExt_h */ |
| 1 | +// | ||
| 2 | +// TIMComm.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 29/1/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_TIMComm_h | ||
| 10 | +#define ImSDK_TIMComm_h | ||
| 11 | + | ||
| 12 | +#import <Foundation/Foundation.h> | ||
| 13 | + | ||
| 14 | +#define ERR_IMSDK_KICKED_BY_OTHERS 6208 | ||
| 15 | + | ||
| 16 | +@protocol TIMConnListener; | ||
| 17 | +@protocol TIMUserStatusListener; | ||
| 18 | +@protocol TIMRefreshListener; | ||
| 19 | +@protocol TIMMessageReceiptListener; | ||
| 20 | +@protocol TIMMessageUpdateListener; | ||
| 21 | +@protocol TIMMessageRevokeListener; | ||
| 22 | +@protocol TIMUploadProgressListener; | ||
| 23 | +@protocol TIMGroupEventListener; | ||
| 24 | +//@protocol TIMFriendshipListener; | ||
| 25 | +//@protocol TIMGroupListener; | ||
| 26 | +@class TIMMessage; | ||
| 27 | +@class TIMImageElem; | ||
| 28 | +@class TIMConversation; | ||
| 29 | +@class TIMAPNSConfig; | ||
| 30 | +@class TIMUserProfile; | ||
| 31 | +@class TIMGroupInfoOption; | ||
| 32 | +@class TIMGroupMemberInfoOption; | ||
| 33 | +@class TIMFriendProfileOption; | ||
| 34 | + | ||
| 35 | +#pragma mark - 枚举类型 | ||
| 36 | + | ||
| 37 | +/** | ||
| 38 | + * 网络连接状态 | ||
| 39 | + */ | ||
| 40 | +typedef NS_ENUM(NSInteger, TIMNetworkStatus) { | ||
| 41 | + /** | ||
| 42 | + * 已连接 | ||
| 43 | + */ | ||
| 44 | + TIM_NETWORK_STATUS_CONNECTED = 1, | ||
| 45 | + /** | ||
| 46 | + * 链接断开 | ||
| 47 | + */ | ||
| 48 | + TIM_NETWORK_STATUS_DISCONNECTED = 2, | ||
| 49 | +}; | ||
| 50 | + | ||
| 51 | + | ||
| 52 | +/** | ||
| 53 | + * 日志级别 | ||
| 54 | + */ | ||
| 55 | +typedef NS_ENUM(NSInteger, TIMLogLevel) { | ||
| 56 | + TIM_LOG_NONE = 0, | ||
| 57 | + TIM_LOG_DEBUG = 3, | ||
| 58 | + TIM_LOG_INFO = 4, | ||
| 59 | + TIM_LOG_WARN = 5, | ||
| 60 | + TIM_LOG_ERROR = 6, | ||
| 61 | +}; | ||
| 62 | + | ||
| 63 | +/** | ||
| 64 | + * 会话类型: | ||
| 65 | + * C2C 双人聊天 | ||
| 66 | + * GROUP 群聊 | ||
| 67 | + */ | ||
| 68 | +typedef NS_ENUM(NSInteger, TIMConversationType) { | ||
| 69 | + /** | ||
| 70 | + * C2C 类型 | ||
| 71 | + */ | ||
| 72 | + TIM_C2C = 1, | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 群聊 类型 | ||
| 76 | + */ | ||
| 77 | + TIM_GROUP = 2, | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 系统消息 | ||
| 81 | + */ | ||
| 82 | + TIM_SYSTEM = 3, | ||
| 83 | +}; | ||
| 84 | + | ||
| 85 | +/** | ||
| 86 | + * 消息状态 | ||
| 87 | + */ | ||
| 88 | +typedef NS_ENUM(NSInteger, TIMMessageStatus){ | ||
| 89 | + /** | ||
| 90 | + * 消息发送中 | ||
| 91 | + */ | ||
| 92 | + TIM_MSG_STATUS_SENDING = 1, | ||
| 93 | + /** | ||
| 94 | + * 消息发送成功 | ||
| 95 | + */ | ||
| 96 | + TIM_MSG_STATUS_SEND_SUCC = 2, | ||
| 97 | + /** | ||
| 98 | + * 消息发送失败 | ||
| 99 | + */ | ||
| 100 | + TIM_MSG_STATUS_SEND_FAIL = 3, | ||
| 101 | + /** | ||
| 102 | + * 消息被删除 | ||
| 103 | + */ | ||
| 104 | + TIM_MSG_STATUS_HAS_DELETED = 4, | ||
| 105 | + /** | ||
| 106 | + * 导入到本地的消息 | ||
| 107 | + */ | ||
| 108 | + TIM_MSG_STATUS_LOCAL_STORED = 5, | ||
| 109 | + /** | ||
| 110 | + * 被撤销的消息 | ||
| 111 | + */ | ||
| 112 | + TIM_MSG_STATUS_LOCAL_REVOKED = 6, | ||
| 113 | +}; | ||
| 114 | + | ||
| 115 | +/** | ||
| 116 | + * 消息优先级标识 | ||
| 117 | + */ | ||
| 118 | +typedef NS_ENUM(NSInteger, TIMMessagePriority) { | ||
| 119 | + /** | ||
| 120 | + * 高优先级,一般为红包或者礼物消息 | ||
| 121 | + */ | ||
| 122 | + TIM_MSG_PRIORITY_HIGH = 1, | ||
| 123 | + /** | ||
| 124 | + * 普通优先级,普通消息 | ||
| 125 | + */ | ||
| 126 | + TIM_MSG_PRIORITY_NORMAL = 2, | ||
| 127 | + /** | ||
| 128 | + * 低优先级,一般为点赞消息 | ||
| 129 | + */ | ||
| 130 | + TIM_MSG_PRIORITY_LOW = 3, | ||
| 131 | + /** | ||
| 132 | + * 最低优先级,一般为后台下发的成员进退群通知 | ||
| 133 | + */ | ||
| 134 | + TIM_MSG_PRIORITY_LOWEST = 4, | ||
| 135 | +}; | ||
| 136 | + | ||
| 137 | +/** | ||
| 138 | + * 图片压缩选项 | ||
| 139 | + */ | ||
| 140 | +typedef NS_ENUM(NSInteger, TIM_IMAGE_COMPRESS_TYPE){ | ||
| 141 | + /** | ||
| 142 | + * 原图(不压缩) | ||
| 143 | + */ | ||
| 144 | + TIM_IMAGE_COMPRESS_ORIGIN = 0x00, | ||
| 145 | + /** | ||
| 146 | + * 高压缩率:图片较小,默认值 | ||
| 147 | + */ | ||
| 148 | + TIM_IMAGE_COMPRESS_HIGH = 0x01, | ||
| 149 | + /** | ||
| 150 | + * 低压缩:高清图发送(图片较大) | ||
| 151 | + */ | ||
| 152 | + TIM_IMAGE_COMPRESS_LOW = 0x02, | ||
| 153 | +}; | ||
| 154 | + | ||
| 155 | +/** | ||
| 156 | + * 图片类型 | ||
| 157 | + */ | ||
| 158 | +typedef NS_ENUM(NSInteger, TIM_IMAGE_TYPE){ | ||
| 159 | + /** | ||
| 160 | + * 原图 | ||
| 161 | + */ | ||
| 162 | + TIM_IMAGE_TYPE_ORIGIN = 0x01, | ||
| 163 | + /** | ||
| 164 | + * 缩略图 | ||
| 165 | + */ | ||
| 166 | + TIM_IMAGE_TYPE_THUMB = 0x02, | ||
| 167 | + /** | ||
| 168 | + * 大图 | ||
| 169 | + */ | ||
| 170 | + TIM_IMAGE_TYPE_LARGE = 0x04, | ||
| 171 | +}; | ||
| 172 | + | ||
| 173 | +/** | ||
| 174 | + * 图片格式 | ||
| 175 | + */ | ||
| 176 | +typedef NS_ENUM(NSInteger, TIM_IMAGE_FORMAT){ | ||
| 177 | + /** | ||
| 178 | + * JPG格式 | ||
| 179 | + */ | ||
| 180 | + TIM_IMAGE_FORMAT_JPG = 0x1, | ||
| 181 | + /** | ||
| 182 | + * GIF格式 | ||
| 183 | + */ | ||
| 184 | + TIM_IMAGE_FORMAT_GIF = 0x2, | ||
| 185 | + /** | ||
| 186 | + * PNG格式 | ||
| 187 | + */ | ||
| 188 | + TIM_IMAGE_FORMAT_PNG = 0x3, | ||
| 189 | + /** | ||
| 190 | + * BMP格式 | ||
| 191 | + */ | ||
| 192 | + TIM_IMAGE_FORMAT_BMP = 0x4, | ||
| 193 | + /** | ||
| 194 | + * 未知格式 | ||
| 195 | + */ | ||
| 196 | + TIM_IMAGE_FORMAT_UNKNOWN = 0xff, | ||
| 197 | +}; | ||
| 198 | + | ||
| 199 | +typedef NS_ENUM(NSInteger, TIMLoginStatus) { | ||
| 200 | + /** | ||
| 201 | + * 已登陆 | ||
| 202 | + */ | ||
| 203 | + TIM_STATUS_LOGINED = 1, | ||
| 204 | + | ||
| 205 | + /** | ||
| 206 | + * 登陆中 | ||
| 207 | + */ | ||
| 208 | + TIM_STATUS_LOGINING = 2, | ||
| 209 | + | ||
| 210 | + /** | ||
| 211 | + * 无登陆 | ||
| 212 | + */ | ||
| 213 | + TIM_STATUS_LOGOUT = 3, | ||
| 214 | +}; | ||
| 215 | + | ||
| 216 | +typedef NS_ENUM(NSInteger, TIMGroupMemberVisibleType) { | ||
| 217 | + /** | ||
| 218 | + * 未知 | ||
| 219 | + */ | ||
| 220 | + TIM_GROUP_MEMBER_VISIBLE_UNKNOWN = 0x00, | ||
| 221 | + /** | ||
| 222 | + * 群组成员不可见 | ||
| 223 | + */ | ||
| 224 | + TIM_GROUP_MEMBER_VISIBLE_NO = 0x01, | ||
| 225 | + /** | ||
| 226 | + * 群组成员可见 | ||
| 227 | + */ | ||
| 228 | + TIM_GROUP_MEMBER_VISIBLE_YES = 0x02, | ||
| 229 | +}; | ||
| 230 | + | ||
| 231 | +typedef NS_ENUM(NSInteger, TIMGroupSearchableType) { | ||
| 232 | + /** | ||
| 233 | + * 未知 | ||
| 234 | + */ | ||
| 235 | + TIM_GROUP_SEARCHABLE_UNKNOWN = 0x00, | ||
| 236 | + /** | ||
| 237 | + * 群组不能被搜到 | ||
| 238 | + */ | ||
| 239 | + TIM_GROUP_SEARCHABLE_NO = 0x01, | ||
| 240 | + /** | ||
| 241 | + * 群组能被搜到 | ||
| 242 | + */ | ||
| 243 | + TIM_GROUP_SEARCHABLE_YES = 0x02, | ||
| 244 | +}; | ||
| 245 | + | ||
| 246 | +/** | ||
| 247 | + * 加群选项 | ||
| 248 | + */ | ||
| 249 | +typedef NS_ENUM(NSInteger, TIMGroupAddOpt) { | ||
| 250 | + /** | ||
| 251 | + * 禁止加群 | ||
| 252 | + */ | ||
| 253 | + TIM_GROUP_ADD_FORBID = 0, | ||
| 254 | + | ||
| 255 | + /** | ||
| 256 | + * 需要管理员审批 | ||
| 257 | + */ | ||
| 258 | + TIM_GROUP_ADD_AUTH = 1, | ||
| 259 | + | ||
| 260 | + /** | ||
| 261 | + * 任何人可以加入 | ||
| 262 | + */ | ||
| 263 | + TIM_GROUP_ADD_ANY = 2, | ||
| 264 | +}; | ||
| 265 | + | ||
| 266 | +/** | ||
| 267 | + * 群组提示类型 | ||
| 268 | + */ | ||
| 269 | +typedef NS_ENUM(NSInteger, TIMGroupTipsType){ | ||
| 270 | + /** | ||
| 271 | + * 成员加入 | ||
| 272 | + */ | ||
| 273 | + TIM_GROUP_TIPS_JOIN = 1, | ||
| 274 | + /** | ||
| 275 | + * 成员离开 | ||
| 276 | + */ | ||
| 277 | + TIM_GROUP_TIPS_QUIT = 2, | ||
| 278 | + /** | ||
| 279 | + * 成员被踢 | ||
| 280 | + */ | ||
| 281 | + TIM_GROUP_TIPS_KICK = 3, | ||
| 282 | + /** | ||
| 283 | + * 成员设置管理员 | ||
| 284 | + */ | ||
| 285 | + TIM_GROUP_TIPS_SET_ADMIN = 4, | ||
| 286 | + /** | ||
| 287 | + * 成员取消管理员 | ||
| 288 | + */ | ||
| 289 | + TIM_GROUP_TIPS_CANCEL_ADMIN = 5, | ||
| 290 | +}; | ||
| 291 | + | ||
| 292 | +/** | ||
| 293 | + * 群消息接受选项 | ||
| 294 | + */ | ||
| 295 | +typedef NS_ENUM(NSInteger, TIMGroupReceiveMessageOpt) { | ||
| 296 | + /** | ||
| 297 | + * 接收消息 | ||
| 298 | + */ | ||
| 299 | + TIM_GROUP_RECEIVE_MESSAGE = 0, | ||
| 300 | + /** | ||
| 301 | + * 不接收消息,服务器不进行转发 | ||
| 302 | + */ | ||
| 303 | + TIM_GROUP_NOT_RECEIVE_MESSAGE = 1, | ||
| 304 | + /** | ||
| 305 | + * 接受消息,不进行iOS APNs 推送 | ||
| 306 | + */ | ||
| 307 | + TIM_GROUP_RECEIVE_NOT_NOTIFY_MESSAGE = 2, | ||
| 308 | +}; | ||
| 309 | + | ||
| 310 | +/** | ||
| 311 | + * 群Tips类型 | ||
| 312 | + */ | ||
| 313 | +typedef NS_ENUM(NSInteger, TIM_GROUP_TIPS_TYPE){ | ||
| 314 | + /** | ||
| 315 | + * 邀请加入群 (opUser & groupName & userList) | ||
| 316 | + */ | ||
| 317 | + TIM_GROUP_TIPS_TYPE_INVITE = 0x01, | ||
| 318 | + /** | ||
| 319 | + * 退出群 (opUser & groupName & userList) | ||
| 320 | + */ | ||
| 321 | + TIM_GROUP_TIPS_TYPE_QUIT_GRP = 0x02, | ||
| 322 | + /** | ||
| 323 | + * 踢出群 (opUser & groupName & userList) | ||
| 324 | + */ | ||
| 325 | + TIM_GROUP_TIPS_TYPE_KICKED = 0x03, | ||
| 326 | + /** | ||
| 327 | + * 设置管理员 (opUser & groupName & userList) | ||
| 328 | + */ | ||
| 329 | + TIM_GROUP_TIPS_TYPE_SET_ADMIN = 0x04, | ||
| 330 | + /** | ||
| 331 | + * 取消管理员 (opUser & groupName & userList) | ||
| 332 | + */ | ||
| 333 | + TIM_GROUP_TIPS_TYPE_CANCEL_ADMIN = 0x05, | ||
| 334 | + /** | ||
| 335 | + * 群资料变更 (opUser & groupName & introduction & notification & faceUrl & owner) | ||
| 336 | + */ | ||
| 337 | + TIM_GROUP_TIPS_TYPE_INFO_CHANGE = 0x06, | ||
| 338 | + /** | ||
| 339 | + * 群成员资料变更 (opUser & groupName & memberInfoList) | ||
| 340 | + */ | ||
| 341 | + TIM_GROUP_TIPS_TYPE_MEMBER_INFO_CHANGE = 0x07, | ||
| 342 | +}; | ||
| 343 | + | ||
| 344 | +/** | ||
| 345 | + * 群Tips类型 | ||
| 346 | + */ | ||
| 347 | +typedef NS_ENUM(NSInteger, TIM_GROUP_INFO_CHANGE_TYPE){ | ||
| 348 | + /** | ||
| 349 | + * 群名修改 | ||
| 350 | + */ | ||
| 351 | + TIM_GROUP_INFO_CHANGE_GROUP_NAME = 0x01, | ||
| 352 | + /** | ||
| 353 | + * 群简介修改 | ||
| 354 | + */ | ||
| 355 | + TIM_GROUP_INFO_CHANGE_GROUP_INTRODUCTION = 0x02, | ||
| 356 | + /** | ||
| 357 | + * 群公告修改 | ||
| 358 | + */ | ||
| 359 | + TIM_GROUP_INFO_CHANGE_GROUP_NOTIFICATION = 0x03, | ||
| 360 | + /** | ||
| 361 | + * 群头像修改 | ||
| 362 | + */ | ||
| 363 | + TIM_GROUP_INFO_CHANGE_GROUP_FACE = 0x04, | ||
| 364 | + /** | ||
| 365 | + * 群主变更 | ||
| 366 | + */ | ||
| 367 | + TIM_GROUP_INFO_CHANGE_GROUP_OWNER = 0x05, | ||
| 368 | +}; | ||
| 369 | + | ||
| 370 | +/** | ||
| 371 | + * 群系统消息类型 | ||
| 372 | + */ | ||
| 373 | +typedef NS_ENUM(NSInteger, TIM_GROUP_SYSTEM_TYPE){ | ||
| 374 | + /** | ||
| 375 | + * 申请加群请求(只有管理员会收到) | ||
| 376 | + */ | ||
| 377 | + TIM_GROUP_SYSTEM_ADD_GROUP_REQUEST_TYPE = 0x01, | ||
| 378 | + /** | ||
| 379 | + * 申请加群被同意(只有申请人能够收到) | ||
| 380 | + */ | ||
| 381 | + TIM_GROUP_SYSTEM_ADD_GROUP_ACCEPT_TYPE = 0x02, | ||
| 382 | + /** | ||
| 383 | + * 申请加群被拒绝(只有申请人能够收到) | ||
| 384 | + */ | ||
| 385 | + TIM_GROUP_SYSTEM_ADD_GROUP_REFUSE_TYPE = 0x03, | ||
| 386 | + /** | ||
| 387 | + * 被管理员踢出群(只有被踢的人能够收到) | ||
| 388 | + */ | ||
| 389 | + TIM_GROUP_SYSTEM_KICK_OFF_FROM_GROUP_TYPE = 0x04, | ||
| 390 | + /** | ||
| 391 | + * 群被解散(全员能够收到) | ||
| 392 | + */ | ||
| 393 | + TIM_GROUP_SYSTEM_DELETE_GROUP_TYPE = 0x05, | ||
| 394 | + /** | ||
| 395 | + * 创建群消息(创建者能够收到) | ||
| 396 | + */ | ||
| 397 | + TIM_GROUP_SYSTEM_CREATE_GROUP_TYPE = 0x06, | ||
| 398 | + /** | ||
| 399 | + * 邀请入群通知(被邀请者能够收到) | ||
| 400 | + */ | ||
| 401 | + TIM_GROUP_SYSTEM_INVITED_TO_GROUP_TYPE = 0x07, | ||
| 402 | + /** | ||
| 403 | + * 主动退群(主动退群者能够收到) | ||
| 404 | + */ | ||
| 405 | + TIM_GROUP_SYSTEM_QUIT_GROUP_TYPE = 0x08, | ||
| 406 | + /** | ||
| 407 | + * 设置管理员(被设置者接收) | ||
| 408 | + */ | ||
| 409 | + TIM_GROUP_SYSTEM_GRANT_ADMIN_TYPE = 0x09, | ||
| 410 | + /** | ||
| 411 | + * 取消管理员(被取消者接收) | ||
| 412 | + */ | ||
| 413 | + TIM_GROUP_SYSTEM_CANCEL_ADMIN_TYPE = 0x0a, | ||
| 414 | + /** | ||
| 415 | + * 群已被回收(全员接收) | ||
| 416 | + */ | ||
| 417 | + TIM_GROUP_SYSTEM_REVOKE_GROUP_TYPE = 0x0b, | ||
| 418 | + /** | ||
| 419 | + * 邀请入群请求(被邀请者接收) | ||
| 420 | + */ | ||
| 421 | + TIM_GROUP_SYSTEM_INVITE_TO_GROUP_REQUEST_TYPE = 0x0c, | ||
| 422 | + /** | ||
| 423 | + * 邀请加群被同意(只有发出邀请者会接收到) | ||
| 424 | + */ | ||
| 425 | + TIM_GROUP_SYSTEM_INVITE_TO_GROUP_ACCEPT_TYPE = 0x0d, | ||
| 426 | + /** | ||
| 427 | + * 邀请加群被拒绝(只有发出邀请者会接收到) | ||
| 428 | + */ | ||
| 429 | + TIM_GROUP_SYSTEM_INVITE_TO_GROUP_REFUSE_TYPE = 0x0e, | ||
| 430 | + /** | ||
| 431 | + * 用户自定义通知(默认全员接收) | ||
| 432 | + */ | ||
| 433 | + TIM_GROUP_SYSTEM_CUSTOM_INFO = 0xff, | ||
| 434 | +}; | ||
| 435 | + | ||
| 436 | +typedef NS_ENUM(NSInteger, TIMOfflinePushFlag) { | ||
| 437 | + /** | ||
| 438 | + * 按照默认规则进行推送 | ||
| 439 | + */ | ||
| 440 | + TIM_OFFLINE_PUSH_DEFAULT = 0, | ||
| 441 | + /** | ||
| 442 | + * 不进行推送 | ||
| 443 | + */ | ||
| 444 | + TIM_OFFLINE_PUSH_NO_PUSH = 1, | ||
| 445 | +}; | ||
| 446 | + | ||
| 447 | +typedef NS_ENUM(NSInteger, TIMAndroidOfflinePushNotifyMode) { | ||
| 448 | + /** | ||
| 449 | + * 通知栏消息 | ||
| 450 | + */ | ||
| 451 | + TIM_ANDROID_OFFLINE_PUSH_NOTIFY_MODE_NOTIFICATION = 0x00, | ||
| 452 | + /** | ||
| 453 | + * 不弹窗,由应用自行处理 | ||
| 454 | + */ | ||
| 455 | + TIM_ANDROID_OFFLINE_PUSH_NOTIFY_MODE_CUSTOM = 0x01, | ||
| 456 | +}; | ||
| 457 | + | ||
| 458 | +/** | ||
| 459 | + * 群成员角色 | ||
| 460 | + */ | ||
| 461 | +typedef NS_ENUM(NSInteger, TIMGroupMemberRole) { | ||
| 462 | + /** | ||
| 463 | + * 未定义(没有获取该字段) | ||
| 464 | + */ | ||
| 465 | + TIM_GROUP_MEMBER_UNDEFINED = 0, | ||
| 466 | + | ||
| 467 | + /** | ||
| 468 | + * 群成员 | ||
| 469 | + */ | ||
| 470 | + TIM_GROUP_MEMBER_ROLE_MEMBER = 200, | ||
| 471 | + | ||
| 472 | + /** | ||
| 473 | + * 群管理员 | ||
| 474 | + */ | ||
| 475 | + TIM_GROUP_MEMBER_ROLE_ADMIN = 300, | ||
| 476 | + | ||
| 477 | + /** | ||
| 478 | + * 群主 | ||
| 479 | + */ | ||
| 480 | + TIM_GROUP_MEMBER_ROLE_SUPER = 400, | ||
| 481 | +}; | ||
| 482 | + | ||
| 483 | +typedef NS_ENUM(NSInteger, TIMFriendAllowType) { | ||
| 484 | + /** | ||
| 485 | + * 同意任何用户加好友 | ||
| 486 | + */ | ||
| 487 | + TIM_FRIEND_ALLOW_ANY = 0, | ||
| 488 | + | ||
| 489 | + /** | ||
| 490 | + * 需要验证 | ||
| 491 | + */ | ||
| 492 | + TIM_FRIEND_NEED_CONFIRM = 1, | ||
| 493 | + | ||
| 494 | + /** | ||
| 495 | + * 拒绝任何人加好友 | ||
| 496 | + */ | ||
| 497 | + TIM_FRIEND_DENY_ANY = 2, | ||
| 498 | +}; | ||
| 499 | + | ||
| 500 | +typedef NS_ENUM(NSInteger, TIMGender) { | ||
| 501 | + /** | ||
| 502 | + * 未知性别 | ||
| 503 | + */ | ||
| 504 | + TIM_GENDER_UNKNOWN = 0, | ||
| 505 | + /** | ||
| 506 | + * 男性 | ||
| 507 | + */ | ||
| 508 | + TIM_GENDER_MALE = 1, | ||
| 509 | + /** | ||
| 510 | + * 女性 | ||
| 511 | + */ | ||
| 512 | + TIM_GENDER_FEMALE = 2, | ||
| 513 | + | ||
| 514 | +}; | ||
| 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 | +}; | ||
| 569 | + | ||
| 570 | +#pragma mark - block回调 | ||
| 571 | + | ||
| 572 | +/** | ||
| 573 | + * 获取消息回调 | ||
| 574 | + * | ||
| 575 | + * @param msgs 消息列表 | ||
| 576 | + */ | ||
| 577 | +typedef void (^TIMGetMsgSucc)(NSArray * msgs); | ||
| 578 | + | ||
| 579 | +/** | ||
| 580 | + * 一般操作成功回调 | ||
| 581 | + */ | ||
| 582 | +typedef void (^TIMSucc)(void); | ||
| 583 | + | ||
| 584 | +/** | ||
| 585 | + * 操作失败回调 | ||
| 586 | + * | ||
| 587 | + * @param code 错误码 | ||
| 588 | + * @param msg 错误描述,配合错误码使用,如果问题建议打印信息定位 | ||
| 589 | + */ | ||
| 590 | +typedef void (^TIMFail)(int code, NSString * msg); | ||
| 591 | + | ||
| 592 | +/** | ||
| 593 | + * 进度毁掉 | ||
| 594 | + * | ||
| 595 | + * @param curSize 已下载大小 | ||
| 596 | + * @param totalSize 总大小 | ||
| 597 | + */ | ||
| 598 | +typedef void (^TIMProgress)(NSInteger curSize, NSInteger totalSize); | ||
| 599 | + | ||
| 600 | +/** | ||
| 601 | + * 登陆成功回调 | ||
| 602 | + */ | ||
| 603 | +typedef void (^TIMLoginSucc)(void); | ||
| 604 | + | ||
| 605 | +/** | ||
| 606 | + * 获取资源 | ||
| 607 | + * | ||
| 608 | + * @param data 资源二进制 | ||
| 609 | + */ | ||
| 610 | +typedef void (^TIMGetResourceSucc)(NSData * data); | ||
| 611 | + | ||
| 612 | +/** | ||
| 613 | + * 日志回调 | ||
| 614 | + * | ||
| 615 | + * @param lvl 输出的日志级别 | ||
| 616 | + * @param msg 日志内容 | ||
| 617 | + */ | ||
| 618 | +typedef void (^TIMLogFunc)(TIMLogLevel lvl, NSString * msg); | ||
| 619 | + | ||
| 620 | +/** | ||
| 621 | + * 上传图片成功回调 | ||
| 622 | + * | ||
| 623 | + * @param elem 上传图片成功后elem | ||
| 624 | + */ | ||
| 625 | +typedef void (^TIMUploadImageSucc)(TIMImageElem * elem); | ||
| 626 | + | ||
| 627 | +/** | ||
| 628 | + * APNs推送配置更新成功回调 | ||
| 629 | + * | ||
| 630 | + * @param config 配置 | ||
| 631 | + */ | ||
| 632 | +typedef void (^TIMAPNSConfigSucc)(TIMAPNSConfig* config); | ||
| 633 | + | ||
| 634 | +/** | ||
| 635 | + * 群创建成功 | ||
| 636 | + * | ||
| 637 | + * @param groupId 群组Id | ||
| 638 | + */ | ||
| 639 | +typedef void (^TIMCreateGroupSucc)(NSString * groupId); | ||
| 640 | + | ||
| 641 | +/** | ||
| 642 | + * 好友列表 | ||
| 643 | + * | ||
| 644 | + * @param friends 好友列表 | ||
| 645 | + */ | ||
| 646 | +typedef void (^TIMFriendSucc)(NSArray * friends); | ||
| 647 | + | ||
| 648 | +/** | ||
| 649 | + * 获取资料回调 | ||
| 650 | + * | ||
| 651 | + * @param profile 资料 | ||
| 652 | + */ | ||
| 653 | +typedef void (^TIMGetProfileSucc)(TIMUserProfile * profile); | ||
| 654 | + | ||
| 655 | +#pragma mark - 基本类型 | ||
| 656 | + | ||
| 657 | +@interface TIMCodingModel : NSObject <NSCoding> | ||
| 658 | + | ||
| 659 | +- (void)encodeWithCoder:(NSCoder *)encoder; | ||
| 660 | +- (id)initWithCoder:(NSCoder *)decoder; | ||
| 661 | + | ||
| 662 | +@end | ||
| 663 | + | ||
| 664 | +@interface TIMSdkConfig : NSObject | ||
| 665 | + | ||
| 666 | +/** | ||
| 667 | + * 用户标识接入SDK的应用ID,必填 | ||
| 668 | + */ | ||
| 669 | +@property(nonatomic,assign) int sdkAppId; | ||
| 670 | + | ||
| 671 | +/** | ||
| 672 | + * 用户的账号类型,必填 | ||
| 673 | + */ | ||
| 674 | +@property(nonatomic,strong) NSString * accountType; | ||
| 675 | + | ||
| 676 | +/** | ||
| 677 | + * 禁用crash上报,默认上报 | ||
| 678 | + */ | ||
| 679 | +@property(nonatomic,assign) BOOL disableCrashReport; | ||
| 680 | + | ||
| 681 | +/** | ||
| 682 | + * 禁止在控制台打印log | ||
| 683 | + */ | ||
| 684 | +@property(nonatomic,assign) BOOL disableLogPrint; | ||
| 685 | + | ||
| 686 | +/** | ||
| 687 | + * 本地写log文件的等级,默认DEBUG等级 | ||
| 688 | + */ | ||
| 689 | +@property(nonatomic,assign) TIMLogLevel logLevel; | ||
| 690 | + | ||
| 691 | +/** | ||
| 692 | + * log文件路径,不设置时为默认路径 | ||
| 693 | + */ | ||
| 694 | +@property(nonatomic,strong) NSString * logPath; | ||
| 695 | + | ||
| 696 | +/** | ||
| 697 | + * 回调给log函数的log等级,默认DEBUG等级 | ||
| 698 | + */ | ||
| 699 | +@property(nonatomic,assign) TIMLogLevel logFuncLevel; | ||
| 700 | + | ||
| 701 | +/** | ||
| 702 | + * log监听函数 | ||
| 703 | + */ | ||
| 704 | +@property(nonatomic,copy) TIMLogFunc logFunc; | ||
| 705 | + | ||
| 706 | +/** | ||
| 707 | + * 消息数据库路径,不设置时为默认路径 | ||
| 708 | + */ | ||
| 709 | +@property(nonatomic,strong) NSString * dbPath; | ||
| 710 | + | ||
| 711 | +/** | ||
| 712 | + * 网络监听器 | ||
| 713 | + */ | ||
| 714 | +@property(nonatomic,strong) id<TIMConnListener> connListener; | ||
| 715 | + | ||
| 716 | +@end | ||
| 717 | + | ||
| 718 | + | ||
| 719 | +@interface TIMUserConfig : NSObject | ||
| 720 | + | ||
| 721 | +/** | ||
| 722 | + * 禁用本地存储(加载消息扩展包有效) | ||
| 723 | + */ | ||
| 724 | +@property(nonatomic,assign) BOOL disableStorage; | ||
| 725 | + | ||
| 726 | +/** | ||
| 727 | + * 禁止自动上报(加载消息扩展包有效) | ||
| 728 | + */ | ||
| 729 | +@property(nonatomic,assign) BOOL disableAutoReport; | ||
| 730 | + | ||
| 731 | +/** | ||
| 732 | + * 开启C2C已读回执(加载消息扩展包有效) | ||
| 733 | + */ | ||
| 734 | +@property(nonatomic,assign) BOOL enableReadReceipt; | ||
| 735 | + | ||
| 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; | ||
| 750 | + | ||
| 751 | +///** | ||
| 752 | +// * 开启群组数据本地缓存功能(加载群组扩展包有效) | ||
| 753 | +// */ | ||
| 754 | +//@property(nonatomic,assign) BOOL enableGroupAssistant; | ||
| 755 | + | ||
| 756 | +/** | ||
| 757 | + * 设置默认拉取的群组资料 | ||
| 758 | + */ | ||
| 759 | +@property(nonatomic,strong) TIMGroupInfoOption * groupInfoOpt; | ||
| 760 | + | ||
| 761 | +/** | ||
| 762 | + * 设置默认拉取的群成员资料 | ||
| 763 | + */ | ||
| 764 | +@property(nonatomic,strong) TIMGroupMemberInfoOption * groupMemberInfoOpt; | ||
| 765 | + | ||
| 766 | +/** | ||
| 767 | + * 设置默认拉取的好友资料 | ||
| 768 | + */ | ||
| 769 | +@property(nonatomic,strong) TIMFriendProfileOption * friendProfileOpt; | ||
| 770 | + | ||
| 771 | +/** | ||
| 772 | + * 用户登录状态监听器 | ||
| 773 | + */ | ||
| 774 | +@property(nonatomic,strong) id<TIMUserStatusListener> userStatusListener; | ||
| 775 | + | ||
| 776 | +/** | ||
| 777 | + * 会话刷新监听器(未读计数、已读同步)(加载消息扩展包有效) | ||
| 778 | + */ | ||
| 779 | +@property(nonatomic,strong) id<TIMRefreshListener> refreshListener; | ||
| 780 | + | ||
| 781 | +/** | ||
| 782 | + * 消息已读回执监听器(加载消息扩展包有效) | ||
| 783 | + */ | ||
| 784 | +@property(nonatomic,strong) id<TIMMessageReceiptListener> messageReceiptListener; | ||
| 785 | + | ||
| 786 | +/** | ||
| 787 | + * 消息svr重写监听器(加载消息扩展包有效) | ||
| 788 | + */ | ||
| 789 | +@property(nonatomic,strong) id<TIMMessageUpdateListener> messageUpdateListener; | ||
| 790 | + | ||
| 791 | +/** | ||
| 792 | + * 消息撤回监听器(加载消息扩展包有效) | ||
| 793 | + */ | ||
| 794 | +@property(nonatomic,strong) id<TIMMessageRevokeListener> messageRevokeListener; | ||
| 795 | + | ||
| 796 | +/** | ||
| 797 | + * 文件上传进度监听器 | ||
| 798 | + */ | ||
| 799 | +@property(nonatomic,strong) id<TIMUploadProgressListener> uploadProgressListener; | ||
| 800 | + | ||
| 801 | +/** | ||
| 802 | + * 群组事件通知监听器 | ||
| 803 | + */ | ||
| 804 | +@property(nonatomic,strong) id<TIMGroupEventListener> groupEventListener; | ||
| 805 | + | ||
| 806 | +///** | ||
| 807 | +// * 关系链数据本地缓存监听器(加载好友扩展包、enableFriendshipProxy有效) | ||
| 808 | +// */ | ||
| 809 | +//@property(nonatomic,strong) id<TIMFriendshipListener> friendshipListener; | ||
| 810 | + | ||
| 811 | +///** | ||
| 812 | +// * 群组据本地缓存监听器(加载群组扩展包、enableGroupAssistant有效) | ||
| 813 | +// */ | ||
| 814 | +//@property(nonatomic,strong) id<TIMGroupListener> groupListener; | ||
| 815 | + | ||
| 816 | +@end | ||
| 817 | + | ||
| 818 | +/** | ||
| 819 | + * 登陆信息 | ||
| 820 | + */ | ||
| 821 | + | ||
| 822 | +@interface TIMLoginParam : NSObject | ||
| 823 | + | ||
| 824 | +/** | ||
| 825 | + * 用户名 | ||
| 826 | + */ | ||
| 827 | +@property(nonatomic,strong) NSString* identifier; | ||
| 828 | + | ||
| 829 | +/** | ||
| 830 | + * 鉴权Token | ||
| 831 | + */ | ||
| 832 | +@property(nonatomic,strong) NSString* userSig; | ||
| 833 | + | ||
| 834 | +/** | ||
| 835 | + * App用户使用OAuth授权体系分配的Appid | ||
| 836 | + */ | ||
| 837 | +@property(nonatomic,strong) NSString* appidAt3rd; | ||
| 838 | + | ||
| 839 | + | ||
| 840 | +@end | ||
| 841 | + | ||
| 842 | +/** | ||
| 843 | + * APNs 配置 | ||
| 844 | + */ | ||
| 845 | +@interface TIMAPNSConfig : NSObject | ||
| 846 | +/** | ||
| 847 | + * 是否开启推送:0-不进行设置 1-开启推送 2-关闭推送 | ||
| 848 | + */ | ||
| 849 | +@property(nonatomic,assign) uint32_t openPush; | ||
| 850 | +/** | ||
| 851 | + * C2C消息声音,不设置传入nil | ||
| 852 | + */ | ||
| 853 | +@property(nonatomic,strong) NSString * c2cSound; | ||
| 854 | + | ||
| 855 | +/** | ||
| 856 | + * Group消息声音,不设置传入nil | ||
| 857 | + */ | ||
| 858 | +@property(nonatomic,strong) NSString * groupSound; | ||
| 859 | + | ||
| 860 | +/** | ||
| 861 | + * Video声音,不设置传入nil | ||
| 862 | + */ | ||
| 863 | +@property(nonatomic,strong) NSString * videoSound; | ||
| 864 | + | ||
| 865 | +@end | ||
| 866 | + | ||
| 867 | +/** | ||
| 868 | + * SetToken 参数 | ||
| 869 | + */ | ||
| 870 | +@interface TIMTokenParam : NSObject | ||
| 871 | +/** | ||
| 872 | + * 获取的客户端Token信息 | ||
| 873 | + */ | ||
| 874 | +@property(nonatomic,strong) NSData* token; | ||
| 875 | +/** | ||
| 876 | + * 业务ID,传递证书时分配 | ||
| 877 | + */ | ||
| 878 | +@property(nonatomic,assign) uint32_t busiId; | ||
| 879 | + | ||
| 880 | +@end | ||
| 881 | + | ||
| 882 | + | ||
| 883 | +/** | ||
| 884 | + * 切后台参数 | ||
| 885 | + */ | ||
| 886 | +@interface TIMBackgroundParam : NSObject | ||
| 887 | + | ||
| 888 | +/** | ||
| 889 | + * C2C 未读计数 | ||
| 890 | + */ | ||
| 891 | +@property(nonatomic,assign) int c2cUnread; | ||
| 892 | + | ||
| 893 | +/** | ||
| 894 | + * 群 未读计数 | ||
| 895 | + */ | ||
| 896 | +@property(nonatomic,assign) int groupUnread; | ||
| 897 | + | ||
| 898 | +@end | ||
| 899 | + | ||
| 900 | +@interface TIMMessageLocator : NSObject | ||
| 901 | +/** | ||
| 902 | + * 所属会话的id | ||
| 903 | + */ | ||
| 904 | +@property(nonatomic,strong) NSString * sessId; | ||
| 905 | +/** | ||
| 906 | + * 所属会话的类型 | ||
| 907 | + */ | ||
| 908 | +@property(nonatomic,assign) TIMConversationType sessType; | ||
| 909 | +/** | ||
| 910 | + * 消息序列号 | ||
| 911 | + */ | ||
| 912 | +@property(nonatomic,assign) uint64_t seq; | ||
| 913 | +/** | ||
| 914 | + * 消息随机码 | ||
| 915 | + */ | ||
| 916 | +@property(nonatomic,assign) uint64_t rand; | ||
| 917 | +/** | ||
| 918 | + * 消息时间戳 | ||
| 919 | + */ | ||
| 920 | +@property(nonatomic,assign) time_t time; | ||
| 921 | +/** | ||
| 922 | + * 是否本人消息 | ||
| 923 | + */ | ||
| 924 | +@property(nonatomic,assign) BOOL isSelf; | ||
| 925 | + | ||
| 926 | +/** | ||
| 927 | + * 是否来自撤销通知 | ||
| 928 | + */ | ||
| 929 | +@property(nonatomic,assign) BOOL isFromRevokeNotify; | ||
| 930 | + | ||
| 931 | +@end | ||
| 932 | + | ||
| 933 | +/** | ||
| 934 | + * 已读回执 | ||
| 935 | + */ | ||
| 936 | +@interface TIMMessageReceipt : NSObject | ||
| 937 | +/** | ||
| 938 | + * 已读回执对应的会话(目前只支持C2C会话) | ||
| 939 | + */ | ||
| 940 | +@property(nonatomic,strong) TIMConversation * conversation; | ||
| 941 | +/** | ||
| 942 | + * 收到已读回执时,这个时间戳之前的消息都已读 | ||
| 943 | + */ | ||
| 944 | +@property(nonatomic,assign) time_t timestamp; | ||
| 945 | +@end | ||
| 946 | + | ||
| 947 | +@interface TIMAndroidOfflinePushConfig : NSObject | ||
| 948 | +/** | ||
| 949 | + * 离线推送时展示标签 | ||
| 950 | + */ | ||
| 951 | +@property(nonatomic,strong) NSString * title; | ||
| 952 | +/** | ||
| 953 | + * Android离线Push时声音字段信息 | ||
| 954 | + */ | ||
| 955 | +@property(nonatomic,strong) NSString * sound; | ||
| 956 | +/** | ||
| 957 | + * 离线推送时通知形式 | ||
| 958 | + */ | ||
| 959 | +@property(nonatomic,assign) TIMAndroidOfflinePushNotifyMode notifyMode; | ||
| 960 | + | ||
| 961 | +@end | ||
| 962 | + | ||
| 963 | +@interface TIMIOSOfflinePushConfig : NSObject | ||
| 964 | +/** | ||
| 965 | + * 离线Push时声音字段信息 | ||
| 966 | + */ | ||
| 967 | +@property(nonatomic,strong) NSString * sound; | ||
| 968 | +/** | ||
| 969 | + * 忽略badge计数 | ||
| 970 | + */ | ||
| 971 | +@property(nonatomic,assign) BOOL ignoreBadge; | ||
| 972 | + | ||
| 973 | +@end | ||
| 974 | + | ||
| 975 | +/** | ||
| 976 | + * 群组内的本人信息 | ||
| 977 | + */ | ||
| 978 | +@interface TIMGroupSelfInfo : NSObject | ||
| 979 | + | ||
| 980 | +/** | ||
| 981 | + * 加入群组时间 | ||
| 982 | + */ | ||
| 983 | +@property(nonatomic,assign) uint32_t joinTime; | ||
| 984 | + | ||
| 985 | +/** | ||
| 986 | + * 群组中的角色 | ||
| 987 | + */ | ||
| 988 | +@property(nonatomic,assign) TIMGroupMemberRole role; | ||
| 989 | + | ||
| 990 | +/** | ||
| 991 | + * 群组消息接收选项 | ||
| 992 | + */ | ||
| 993 | +@property(nonatomic,assign) TIMGroupReceiveMessageOpt recvOpt; | ||
| 994 | + | ||
| 995 | +/** | ||
| 996 | + * 群组中的未读消息数 | ||
| 997 | + */ | ||
| 998 | +@property(nonatomic,assign) uint32_t unReadMessageNum; | ||
| 999 | + | ||
| 1000 | +@end | ||
| 1001 | + | ||
| 1002 | +/** | ||
| 1003 | + * 群资料信息 | ||
| 1004 | + */ | ||
| 1005 | +@interface TIMGroupInfo : TIMCodingModel | ||
| 1006 | + | ||
| 1007 | +/** | ||
| 1008 | + * 群组Id | ||
| 1009 | + */ | ||
| 1010 | +@property(nonatomic,strong) NSString* group; | ||
| 1011 | +/** | ||
| 1012 | + * 群名 | ||
| 1013 | + */ | ||
| 1014 | +@property(nonatomic,strong) NSString* groupName; | ||
| 1015 | +/** | ||
| 1016 | + * 群创建人/管理员 | ||
| 1017 | + */ | ||
| 1018 | +@property(nonatomic,strong) NSString * owner; | ||
| 1019 | +/** | ||
| 1020 | + * 群类型:Private,Public,ChatRoom | ||
| 1021 | + */ | ||
| 1022 | +@property(nonatomic,strong) NSString* groupType; | ||
| 1023 | +/** | ||
| 1024 | + * 群创建时间 | ||
| 1025 | + */ | ||
| 1026 | +@property(nonatomic,assign) uint32_t createTime; | ||
| 1027 | +/** | ||
| 1028 | + * 最近一次群资料修改时间 | ||
| 1029 | + */ | ||
| 1030 | +@property(nonatomic,assign) uint32_t lastInfoTime; | ||
| 1031 | +/** | ||
| 1032 | + * 最近一次发消息时间 | ||
| 1033 | + */ | ||
| 1034 | +@property(nonatomic,assign) uint32_t lastMsgTime; | ||
| 1035 | +/** | ||
| 1036 | + * 最大成员数 | ||
| 1037 | + */ | ||
| 1038 | +@property(nonatomic,assign) uint32_t maxMemberNum; | ||
| 1039 | +/** | ||
| 1040 | + * 群成员数量 | ||
| 1041 | + */ | ||
| 1042 | +@property(nonatomic,assign) uint32_t memberNum; | ||
| 1043 | + | ||
| 1044 | +/** | ||
| 1045 | + * 入群类型 | ||
| 1046 | + */ | ||
| 1047 | +@property(nonatomic,assign) TIMGroupAddOpt addOpt; | ||
| 1048 | + | ||
| 1049 | +/** | ||
| 1050 | + * 群公告 | ||
| 1051 | + */ | ||
| 1052 | +@property(nonatomic,strong) NSString* notification; | ||
| 1053 | + | ||
| 1054 | +/** | ||
| 1055 | + * 群简介 | ||
| 1056 | + */ | ||
| 1057 | +@property(nonatomic,strong) NSString* introduction; | ||
| 1058 | + | ||
| 1059 | +/** | ||
| 1060 | + * 群头像 | ||
| 1061 | + */ | ||
| 1062 | +@property(nonatomic,strong) NSString* faceURL; | ||
| 1063 | + | ||
| 1064 | +/** | ||
| 1065 | + * 最后一条消息 | ||
| 1066 | + */ | ||
| 1067 | +@property(nonatomic,strong) TIMMessage* lastMsg; | ||
| 1068 | + | ||
| 1069 | +/** | ||
| 1070 | + * 在线成员数量 | ||
| 1071 | + */ | ||
| 1072 | +@property(nonatomic,assign) uint32_t onlineMemberNum; | ||
| 1073 | + | ||
| 1074 | +/** | ||
| 1075 | + * 群组是否被搜索类型 | ||
| 1076 | + */ | ||
| 1077 | +@property(nonatomic,assign) TIMGroupSearchableType isSearchable; | ||
| 1078 | + | ||
| 1079 | +/** | ||
| 1080 | + * 群组成员可见类型 | ||
| 1081 | + */ | ||
| 1082 | +@property(nonatomic,assign) TIMGroupMemberVisibleType isMemberVisible; | ||
| 1083 | + | ||
| 1084 | +/** | ||
| 1085 | + 是否全员禁言 | ||
| 1086 | + */ | ||
| 1087 | +@property(nonatomic,assign) BOOL allShutup; | ||
| 1088 | + | ||
| 1089 | +/** | ||
| 1090 | + * 群组中的本人信息 | ||
| 1091 | + */ | ||
| 1092 | +@property(nonatomic,strong) TIMGroupSelfInfo* selfInfo; | ||
| 1093 | + | ||
| 1094 | +/** | ||
| 1095 | + * 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 1096 | + */ | ||
| 1097 | +@property(nonatomic,strong) NSDictionary* customInfo; | ||
| 1098 | + | ||
| 1099 | +@end | ||
| 1100 | + | ||
| 1101 | +/** | ||
| 1102 | + * 事件上报信息 | ||
| 1103 | + */ | ||
| 1104 | +@interface TIMEventReportItem : NSObject | ||
| 1105 | +/** | ||
| 1106 | + * 事件id | ||
| 1107 | + */ | ||
| 1108 | +@property(nonatomic,assign) uint32_t event; | ||
| 1109 | +/** | ||
| 1110 | + * 错误码 | ||
| 1111 | + */ | ||
| 1112 | +@property(nonatomic,assign) uint32_t code; | ||
| 1113 | +/** | ||
| 1114 | + * 错误描述 | ||
| 1115 | + */ | ||
| 1116 | +@property(nonatomic,strong) NSString * desc; | ||
| 1117 | +/** | ||
| 1118 | + * 事件延迟(单位ms) | ||
| 1119 | + */ | ||
| 1120 | +@property(nonatomic,assign) uint32_t delay; | ||
| 1121 | + | ||
| 1122 | +@end | ||
| 1123 | + | ||
| 1124 | +@interface TIMGroupInfoOption : NSObject | ||
| 1125 | + | ||
| 1126 | +/** | ||
| 1127 | + * 需要获取的群组信息标志(TIMGetGroupBaseInfoFlag),默认为0xffffff | ||
| 1128 | + */ | ||
| 1129 | +@property(nonatomic,assign) uint64_t groupFlags; | ||
| 1130 | + | ||
| 1131 | +/** | ||
| 1132 | + * 需要获取群组资料的自定义信息(NSString*)列表 | ||
| 1133 | + */ | ||
| 1134 | +@property(nonatomic,strong) NSArray * groupCustom; | ||
| 1135 | + | ||
| 1136 | +@end | ||
| 1137 | + | ||
| 1138 | +@interface TIMGroupMemberInfoOption : NSObject | ||
| 1139 | + | ||
| 1140 | +/** | ||
| 1141 | + * 需要获取的群成员标志(TIMGetGroupMemInfoFlag),默认为0xffffff | ||
| 1142 | + */ | ||
| 1143 | +@property(nonatomic,assign) uint64_t memberFlags; | ||
| 1144 | + | ||
| 1145 | +/** | ||
| 1146 | + * 需要获取群成员资料的自定义信息(NSString*)列表 | ||
| 1147 | + */ | ||
| 1148 | +@property(nonatomic,strong) NSArray * memberCustom; | ||
| 1149 | + | ||
| 1150 | +@end | ||
| 1151 | + | ||
| 1152 | +/** | ||
| 1153 | + * 成员操作返回值 | ||
| 1154 | + */ | ||
| 1155 | +@interface TIMGroupMemberInfo : TIMCodingModel | ||
| 1156 | + | ||
| 1157 | +/** | ||
| 1158 | + * 被操作成员 | ||
| 1159 | + */ | ||
| 1160 | +@property(nonatomic,strong) NSString* member; | ||
| 1161 | + | ||
| 1162 | +/** | ||
| 1163 | + * 群名片 | ||
| 1164 | + */ | ||
| 1165 | +@property(nonatomic,strong) NSString* nameCard; | ||
| 1166 | + | ||
| 1167 | +/** | ||
| 1168 | + * 加入群组时间 | ||
| 1169 | + */ | ||
| 1170 | +@property(nonatomic,assign) time_t joinTime; | ||
| 1171 | + | ||
| 1172 | +/** | ||
| 1173 | + * 成员类型 | ||
| 1174 | + */ | ||
| 1175 | +@property(nonatomic,assign) TIMGroupMemberRole role; | ||
| 1176 | + | ||
| 1177 | +/** | ||
| 1178 | + * 禁言结束时间(时间戳) | ||
| 1179 | + */ | ||
| 1180 | +@property(nonatomic,assign) uint32_t silentUntil; | ||
| 1181 | + | ||
| 1182 | +/** | ||
| 1183 | + * 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 1184 | + */ | ||
| 1185 | +@property(nonatomic,strong) NSDictionary* customInfo; | ||
| 1186 | + | ||
| 1187 | +@end | ||
| 1188 | + | ||
| 1189 | +@interface TIMFriendProfileOption : NSObject | ||
| 1190 | + | ||
| 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; | ||
| 1205 | + | ||
| 1206 | +@end | ||
| 1207 | + | ||
| 1208 | +/** | ||
| 1209 | + * 好友资料 | ||
| 1210 | + */ | ||
| 1211 | +@interface TIMUserProfile : TIMCodingModel | ||
| 1212 | + | ||
| 1213 | +/** | ||
| 1214 | + * 用户identifier | ||
| 1215 | + */ | ||
| 1216 | +@property(nonatomic,strong) NSString* identifier; | ||
| 1217 | + | ||
| 1218 | +/** | ||
| 1219 | + * 用户昵称 | ||
| 1220 | + */ | ||
| 1221 | +@property(nonatomic,strong) NSString* nickname; | ||
| 1222 | + | ||
| 1223 | +/** | ||
| 1224 | + * 用户备注(最大96字节,获取自己资料时,该字段为空) | ||
| 1225 | + */ | ||
| 1226 | +@property(nonatomic,strong) NSString* remark; | ||
| 1227 | + | ||
| 1228 | +/** | ||
| 1229 | + * 好友验证方式 | ||
| 1230 | + */ | ||
| 1231 | +@property(nonatomic,assign) TIMFriendAllowType allowType; | ||
| 1232 | + | ||
| 1233 | +/** | ||
| 1234 | + * 用户头像 | ||
| 1235 | + */ | ||
| 1236 | +@property(nonatomic,strong) NSString* faceURL; | ||
| 1237 | + | ||
| 1238 | +/** | ||
| 1239 | + * 用户签名 | ||
| 1240 | + */ | ||
| 1241 | +@property(nonatomic,strong) NSData* selfSignature; | ||
| 1242 | + | ||
| 1243 | +/** | ||
| 1244 | + * 好友性别 | ||
| 1245 | + */ | ||
| 1246 | +@property(nonatomic,assign) TIMGender gender; | ||
| 1247 | + | ||
| 1248 | +/** | ||
| 1249 | + * 好友生日 | ||
| 1250 | + */ | ||
| 1251 | +@property(nonatomic,assign) uint32_t birthday; | ||
| 1252 | + | ||
| 1253 | +/** | ||
| 1254 | + * 好友区域 | ||
| 1255 | + */ | ||
| 1256 | +@property(nonatomic,strong) NSData* location; | ||
| 1257 | + | ||
| 1258 | +/** | ||
| 1259 | + * 好友语言 | ||
| 1260 | + */ | ||
| 1261 | +@property(nonatomic,assign) uint32_t language; | ||
| 1262 | + | ||
| 1263 | +/** | ||
| 1264 | + * 等级 | ||
| 1265 | + */ | ||
| 1266 | +@property(nonatomic,assign) uint32_t level; | ||
| 1267 | + | ||
| 1268 | +/** | ||
| 1269 | + * 角色 | ||
| 1270 | + */ | ||
| 1271 | +@property(nonatomic,assign) uint32_t role; | ||
| 1272 | + | ||
| 1273 | +/** | ||
| 1274 | + * 好友分组名称 NSString* 列表 | ||
| 1275 | + */ | ||
| 1276 | +@property(nonatomic,strong) NSArray* friendGroups; | ||
| 1277 | + | ||
| 1278 | +/** | ||
| 1279 | + * 自定义字段集合,key是NSString类型,value是NSData类型或者NSNumber类型 | ||
| 1280 | + * (key值按照后台配置的字符串传入) | ||
| 1281 | + */ | ||
| 1282 | +@property(nonatomic,strong) NSDictionary* customInfo; | ||
| 1283 | + | ||
| 1284 | +@end | ||
| 1285 | + | ||
| 1286 | +#endif |
| 1 | +// | ||
| 2 | +// TIMConversation+MsgExt.h | ||
| 3 | +// IMMessageExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2016/12/27. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TIMConversation_h | ||
| 10 | +#define TIMConversation_h | ||
| 11 | + | ||
| 12 | +#import "ImSDK.h" | ||
| 13 | +#import "TIMMessage+MsgExt.h" | ||
| 14 | + | ||
| 15 | +@interface TIMConversation (MsgExt) | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 保存消息到消息列表,这里只保存在本地 | ||
| 19 | + * | ||
| 20 | + * @param msg 消息体 | ||
| 21 | + * @param sender 发送方 | ||
| 22 | + * @param isReaded 是否已读,如果发送方是自己,默认已读 | ||
| 23 | + * | ||
| 24 | + * @return 0 成功 | ||
| 25 | + */ | ||
| 26 | +- (int)saveMessage:(TIMMessage*)msg sender:(NSString*)sender isReaded:(BOOL)isReaded; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 获取会话消息 | ||
| 30 | + * | ||
| 31 | + * @param count 获取数量 | ||
| 32 | + * @param last 上次最后一条消息 | ||
| 33 | + * @param succ 成功时回调 | ||
| 34 | + * @param fail 失败时回调 | ||
| 35 | + * | ||
| 36 | + * @return 0 本次操作成功 | ||
| 37 | + */ | ||
| 38 | +- (int)getMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | ||
| 39 | + | ||
| 40 | +/** | ||
| 41 | + * 向前获取会话消息 | ||
| 42 | + * | ||
| 43 | + * @param count 获取数量 | ||
| 44 | + * @param last 上次最后一条消息 | ||
| 45 | + * @param succ 成功时回调 | ||
| 46 | + * @param fail 失败时回调 | ||
| 47 | + * | ||
| 48 | + * @return 0 本次操作成功 | ||
| 49 | + */ | ||
| 50 | +- (int)getMessageForward:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | ||
| 51 | + | ||
| 52 | +/** | ||
| 53 | + * 获取本地会话消息 | ||
| 54 | + * | ||
| 55 | + * @param count 获取数量 | ||
| 56 | + * @param last 上次最后一条消息 | ||
| 57 | + * @param succ 成功时回调 | ||
| 58 | + * @param fail 失败时回调 | ||
| 59 | + * | ||
| 60 | + * @return 0 本次操作成功 | ||
| 61 | + */ | ||
| 62 | +- (int)getLocalMessage:(int)count last:(TIMMessage*)last succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | ||
| 63 | + | ||
| 64 | +/** | ||
| 65 | + * 获取会话消息 | ||
| 66 | + * | ||
| 67 | + * @param locators 消息定位符(TIMMessageLocator)数组 | ||
| 68 | + * @param succ 成功时回调 | ||
| 69 | + * @param fail 失败时回调 | ||
| 70 | + * | ||
| 71 | + * @return 0 本次操作成功 | ||
| 72 | + */ | ||
| 73 | +- (int)findMessages:(NSArray*)locators succ:(TIMGetMsgSucc)succ fail:(TIMFail)fail; | ||
| 74 | + | ||
| 75 | +/** | ||
| 76 | + * 撤回消息(仅C2C和GROUP会话有效、onlineMessage无效、AVChatRoom和BChatRoom无效) | ||
| 77 | + * | ||
| 78 | + * @param msg 被撤回的消息 | ||
| 79 | + * @param succ 成功时回调 | ||
| 80 | + * @param fail 失败时回调 | ||
| 81 | + * | ||
| 82 | + * @return 0 本次操作成功 | ||
| 83 | + */ | ||
| 84 | +- (int)revokeMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 85 | + | ||
| 86 | +/** | ||
| 87 | + * 同步本会话的消息撤回通知(仅GROUP会话有效) | ||
| 88 | + * | ||
| 89 | + * @param succ 成功时回调,同步的通知会通过TIMMessageRevokeListener抛出 | ||
| 90 | + * @param fail 失败时回调 | ||
| 91 | + * | ||
| 92 | + * @return 0 本次操作成功 | ||
| 93 | + */ | ||
| 94 | +- (int)syncRevokeNotify:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 95 | + | ||
| 96 | +/** | ||
| 97 | + * 删除本地会话消息 | ||
| 98 | + * | ||
| 99 | + * @param succ 成功时回调 | ||
| 100 | + * @param fail 失败时回调 | ||
| 101 | + * | ||
| 102 | + * @return 0 本次操作成功 | ||
| 103 | + */ | ||
| 104 | +- (int)deleteLocalMessage:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 105 | + | ||
| 106 | +/** | ||
| 107 | + * 设置已读消息 | ||
| 108 | + * | ||
| 109 | + * @param readed 会话内最近一条已读的消息,nil表示上报最新消息 | ||
| 110 | + * | ||
| 111 | + * @param succ 成功时回调 | ||
| 112 | + * @param fail 失败时回调 | ||
| 113 | + * | ||
| 114 | + * @return 0 表示成功 | ||
| 115 | + */ | ||
| 116 | +- (int)setReadMessage:(TIMMessage*)readed succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 117 | + | ||
| 118 | +/** | ||
| 119 | + * 获取该会话的未读计数 | ||
| 120 | + * | ||
| 121 | + * @return 返回未读计数 | ||
| 122 | + */ | ||
| 123 | +- (int)getUnReadMessageNum; | ||
| 124 | + | ||
| 125 | +/** | ||
| 126 | + * 获取最后一条消息 | ||
| 127 | + * | ||
| 128 | + * @return 最后一条消息 | ||
| 129 | + */ | ||
| 130 | +- (TIMMessage*)getLastMsg; | ||
| 131 | + | ||
| 132 | +/** | ||
| 133 | + * 将消息导入本地数据库 | ||
| 134 | + * | ||
| 135 | + * @param msgs 消息(TIMMessage*)列表 | ||
| 136 | + * | ||
| 137 | + * @return 0 成功 | ||
| 138 | + */ | ||
| 139 | +- (int)importMessages:(NSArray*)msgs; | ||
| 140 | + | ||
| 141 | +/** | ||
| 142 | + * 设置会话草稿 | ||
| 143 | + * | ||
| 144 | + * @param draft 草稿内容 | ||
| 145 | + * | ||
| 146 | + * @return 0 成功 | ||
| 147 | + */ | ||
| 148 | +- (int)setDraft:(TIMMessageDraft*)draft; | ||
| 149 | + | ||
| 150 | +/** | ||
| 151 | + * 获取会话草稿 | ||
| 152 | + * | ||
| 153 | + * @return 草稿内容,没有草稿返回nil | ||
| 154 | + */ | ||
| 155 | +- (TIMMessageDraft*)getDraft; | ||
| 156 | + | ||
| 157 | +/** | ||
| 158 | + * 禁用本会话的存储,只对当前初始化有效,重启后需要重新设置 | ||
| 159 | + * 需要 initSdk 之后调用 | ||
| 160 | + */ | ||
| 161 | +- (void)disableStorage; | ||
| 162 | + | ||
| 163 | +@end | ||
| 164 | + | ||
| 165 | +#endif /* TIMConversation_h */ |
| 1 | +// | ||
| 2 | +// TIMConversation.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 28/1/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_TIMConversation_h | ||
| 10 | +#define ImSDK_TIMConversation_h | ||
| 11 | + | ||
| 12 | +#import "TIMComm.h" | ||
| 13 | +#import "TIMCallback.h" | ||
| 14 | + | ||
| 15 | +@class TIMMessage; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 会话 | ||
| 19 | + */ | ||
| 20 | +@interface TIMConversation : NSObject | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * 发送消息 | ||
| 24 | + * | ||
| 25 | + * @param msg 消息体 | ||
| 26 | + * @param succ 发送成功时回调 | ||
| 27 | + * @param fail 发送失败时回调 | ||
| 28 | + * | ||
| 29 | + * @return 0 本次操作成功 | ||
| 30 | + */ | ||
| 31 | +- (int)sendMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 32 | + | ||
| 33 | +/** | ||
| 34 | + * 发送在线消息(服务器不保存消息) | ||
| 35 | + * | ||
| 36 | + * @param msg 消息体 | ||
| 37 | + * @param succ 成功回调 | ||
| 38 | + * @param fail 失败回调 | ||
| 39 | + * | ||
| 40 | + * @return 0 成功 | ||
| 41 | + */ | ||
| 42 | +- (int)sendOnlineMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 43 | + | ||
| 44 | +/** | ||
| 45 | + * 获取会话人,单聊为对方账号,群聊为群组Id | ||
| 46 | + * | ||
| 47 | + * @return 会话人 | ||
| 48 | + */ | ||
| 49 | +- (NSString*)getReceiver; | ||
| 50 | + | ||
| 51 | +/** | ||
| 52 | + * 获取群名称(只有群会话有效) | ||
| 53 | + * | ||
| 54 | + * @return 群名称 | ||
| 55 | + */ | ||
| 56 | +- (NSString*)getGroupName; | ||
| 57 | + | ||
| 58 | +/** | ||
| 59 | + * 获取会话类型 | ||
| 60 | + * | ||
| 61 | + * @return 会话类型 | ||
| 62 | + */ | ||
| 63 | +- (TIMConversationType)getType; | ||
| 64 | + | ||
| 65 | +/** | ||
| 66 | + * 获取该会话所属用户的id | ||
| 67 | + * | ||
| 68 | + * @return 用户id | ||
| 69 | + */ | ||
| 70 | +- (NSString*)getSelfIdentifier; | ||
| 71 | + | ||
| 72 | +@end | ||
| 73 | + | ||
| 74 | + | ||
| 75 | +#endif |
| 1 | +// | ||
| 2 | +// TIMGroupManager+Ext.h | ||
| 3 | +// IMGroupExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2017/2/9. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TIMGroupManager_Ext_h | ||
| 10 | +#define TIMGroupManager_Ext_h | ||
| 11 | + | ||
| 12 | +#import "ImSDK.h" | ||
| 13 | +#import "TIMComm+Group.h" | ||
| 14 | + | ||
| 15 | +@interface TIMGroupManager (Ext) | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 创建私有群 | ||
| 19 | + * | ||
| 20 | + * @param members 群成员,NSString* 数组 | ||
| 21 | + * @param groupName 群名 | ||
| 22 | + * @param succ 成功回调 | ||
| 23 | + * @param fail 失败回调 | ||
| 24 | + * | ||
| 25 | + * @return 0 成功 | ||
| 26 | + */ | ||
| 27 | +- (int)createPrivateGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 创建公开群 | ||
| 31 | + * | ||
| 32 | + * @param members 群成员,NSString* 数组 | ||
| 33 | + * @param groupName 群名 | ||
| 34 | + * @param succ 成功回调 | ||
| 35 | + * @param fail 失败回调 | ||
| 36 | + * | ||
| 37 | + * @return 0 成功 | ||
| 38 | + */ | ||
| 39 | +- (int)createPublicGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | ||
| 40 | + | ||
| 41 | +/** | ||
| 42 | + * 创建聊天室 | ||
| 43 | + * | ||
| 44 | + * @param members 群成员,NSString* 数组 | ||
| 45 | + * @param groupName 群名 | ||
| 46 | + * @param succ 成功回调 | ||
| 47 | + * @param fail 失败回调 | ||
| 48 | + * | ||
| 49 | + * @return 0 成功 | ||
| 50 | + */ | ||
| 51 | +- (int)createChatRoomGroup:(NSArray*)members groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | ||
| 52 | + | ||
| 53 | +/** | ||
| 54 | + * 创建音视频聊天室(可支持超大群,详情可参考wiki文档) | ||
| 55 | + * | ||
| 56 | + * @param groupName 群名 | ||
| 57 | + * @param succ 成功回调 | ||
| 58 | + * @param fail 失败回调 | ||
| 59 | + * | ||
| 60 | + * @return 0 成功 | ||
| 61 | + */ | ||
| 62 | +- (int)createAVChatRoomGroup:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | ||
| 63 | + | ||
| 64 | +/** | ||
| 65 | + * 创建群组 | ||
| 66 | + * | ||
| 67 | + * @param groupInfo 群组信息 | ||
| 68 | + * @param succ 成功回调 | ||
| 69 | + * @param fail 失败回调 | ||
| 70 | + * | ||
| 71 | + * @return 0 成功 | ||
| 72 | + */ | ||
| 73 | +- (int)createGroup:(TIMCreateGroupInfo*)groupInfo succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | ||
| 74 | + | ||
| 75 | +/** | ||
| 76 | + * 邀请好友入群 | ||
| 77 | + * | ||
| 78 | + * @param group 群组Id | ||
| 79 | + * @param members 要加入的成员列表(NSString* 类型数组) | ||
| 80 | + * @param succ 成功回调 | ||
| 81 | + * @param fail 失败回调 | ||
| 82 | + * | ||
| 83 | + * @return 0 成功 | ||
| 84 | + */ | ||
| 85 | +- (int)inviteGroupMember:(NSString*)group members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | ||
| 86 | + | ||
| 87 | +/** | ||
| 88 | + * 删除群成员 | ||
| 89 | + * | ||
| 90 | + * @param group 群组Id | ||
| 91 | + * @param reason 删除原因 | ||
| 92 | + * @param members 要删除的成员列表 | ||
| 93 | + * @param succ 成功回调 | ||
| 94 | + * @param fail 失败回调 | ||
| 95 | + * | ||
| 96 | + * @return 0 成功 | ||
| 97 | + */ | ||
| 98 | +- (int)deleteGroupMemberWithReason:(NSString*)group reason:(NSString*)reason members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | ||
| 99 | + | ||
| 100 | +/** | ||
| 101 | + * 获取群公开信息 | ||
| 102 | + * @param groups 群组Id | ||
| 103 | + * @param succ 成功回调 | ||
| 104 | + * @param fail 失败回调 | ||
| 105 | + * | ||
| 106 | + * @return 0 成功 | ||
| 107 | + */ | ||
| 108 | +- (int)getGroupPublicInfo:(NSArray*)groups succ:(TIMGroupListSucc)succ fail:(TIMFail)fail; | ||
| 109 | + | ||
| 110 | +/** | ||
| 111 | + * 获取群列表 | ||
| 112 | + * | ||
| 113 | + * @param succ 成功回调,NSArray列表为 TIMGroupInfo,结构体只包含 group\groupName\groupType\faceUrl\allShutup\selfInfo 信息 | ||
| 114 | + * @param fail 失败回调 | ||
| 115 | + * | ||
| 116 | + * @return 0 成功 | ||
| 117 | + */ | ||
| 118 | +- (int)getGroupList:(TIMGroupListSucc)succ fail:(TIMFail)fail; | ||
| 119 | + | ||
| 120 | +/** | ||
| 121 | + * 获取群信息 | ||
| 122 | + * | ||
| 123 | + * @param succ 成功回调,不包含 selfInfo信息 | ||
| 124 | + * @param fail 失败回调 | ||
| 125 | + * | ||
| 126 | + * @return 0 成功 | ||
| 127 | + */ | ||
| 128 | +- (int)getGroupInfo:(NSArray*)groups succ:(TIMGroupListSucc)succ fail:(TIMFail)fail; | ||
| 129 | + | ||
| 130 | +/** | ||
| 131 | + * 获取本人在群组内的成员信息 | ||
| 132 | + * | ||
| 133 | + * @param group 群组Id | ||
| 134 | + * @param succ 成功回调,返回信息 | ||
| 135 | + * @param fail 失败回调 | ||
| 136 | + * | ||
| 137 | + * @return 0 成功 | ||
| 138 | + */ | ||
| 139 | +- (int)getGroupSelfInfo:(NSString*)group succ:(TIMGroupSelfSucc)succ fail:(TIMFail)fail; | ||
| 140 | + | ||
| 141 | +/** | ||
| 142 | + * 获取接受消息选项 | ||
| 143 | + * | ||
| 144 | + * @param group 群组Id | ||
| 145 | + * @param succ 成功回调 | ||
| 146 | + * @param fail 失败回调 | ||
| 147 | + * | ||
| 148 | + * @return 0 成功 | ||
| 149 | + */ | ||
| 150 | +- (int)getReciveMessageOpt:(NSString*)group succ:(TIMGroupReciveMessageOptSucc)succ fail:(TIMFail)fail; | ||
| 151 | + | ||
| 152 | +/** | ||
| 153 | + * 获取群成员列表 | ||
| 154 | + * | ||
| 155 | + * @param group 群组Id | ||
| 156 | + * @param succ 成功回调(TIMGroupMemberInfo列表) | ||
| 157 | + * @param fail 失败回调 | ||
| 158 | + * | ||
| 159 | + * @return 0 成功 | ||
| 160 | + */ | ||
| 161 | +- (int)getGroupMembers:(NSString*)group succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | ||
| 162 | + | ||
| 163 | +/** | ||
| 164 | + * 获取群组指定成员的信息 | ||
| 165 | + * | ||
| 166 | + * @param group 群组Id | ||
| 167 | + * @param members 成员Id(NSString*)列表 | ||
| 168 | + * @param succ 成功回调(TIMGroupMemberInfo列表) | ||
| 169 | + * @param fail 失败回调 | ||
| 170 | + * | ||
| 171 | + * @return 0 成功 | ||
| 172 | + */ | ||
| 173 | +- (int)getGroupMembersInfo:(NSString*)group members:(NSArray*)members succ:(TIMGroupMemberSucc)succ fail:(TIMFail)fail; | ||
| 174 | + | ||
| 175 | +/** | ||
| 176 | + * 获取指定类型的成员列表(支持按字段拉取,分页) | ||
| 177 | + * | ||
| 178 | + * @param group 群组Id:(NSString*) 列表 | ||
| 179 | + * @param filter 群成员角色过滤方式 | ||
| 180 | + * @param flags 拉取资料标志 | ||
| 181 | + * @param custom 要获取的自定义key(NSString*)列表 | ||
| 182 | + * @param nextSeq 分页拉取标志,第一次拉取填0,回调成功如果不为零,需要分页,传入再次拉取,直至为0 | ||
| 183 | + * @param succ 成功回调 | ||
| 184 | + * @param fail 失败回调 | ||
| 185 | + */ | ||
| 186 | +- (int)getGroupMembers:(NSString*)group ByFilter:(TIMGroupMemberFilter)filter flags:(TIMGetGroupMemInfoFlag)flags custom:(NSArray*)custom nextSeq:(uint64_t)nextSeq succ:(TIMGroupMemberSuccV2)succ fail:(TIMFail)fail; | ||
| 187 | + | ||
| 188 | +/** | ||
| 189 | + * 修改群名 | ||
| 190 | + * | ||
| 191 | + * @param group 群组Id | ||
| 192 | + * @param groupName 新群名 | ||
| 193 | + * @param succ 成功回调 | ||
| 194 | + * @param fail 失败回调 | ||
| 195 | + * | ||
| 196 | + * @return 0 成功 | ||
| 197 | + */ | ||
| 198 | +- (int)modifyGroupName:(NSString*)group groupName:(NSString*)groupName succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 199 | + | ||
| 200 | +/** | ||
| 201 | + * 修改群简介 | ||
| 202 | + * | ||
| 203 | + * @param group 群组Id | ||
| 204 | + * @param introduction 群简介(最长120字节) | ||
| 205 | + * @param succ 成功回调 | ||
| 206 | + * @param fail 失败回调 | ||
| 207 | + * | ||
| 208 | + * @return 0 成功 | ||
| 209 | + */ | ||
| 210 | +- (int)modifyGroupIntroduction:(NSString*)group introduction:(NSString*)introduction succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 211 | + | ||
| 212 | +/** | ||
| 213 | + * 修改群公告 | ||
| 214 | + * | ||
| 215 | + * @param group 群组Id | ||
| 216 | + * @param notification 群公告(最长150字节) | ||
| 217 | + * @param succ 成功回调 | ||
| 218 | + * @param fail 失败回调 | ||
| 219 | + * | ||
| 220 | + * @return 0 成功 | ||
| 221 | + */ | ||
| 222 | +- (int)modifyGroupNotification:(NSString*)group notification:(NSString*)notification succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 223 | + | ||
| 224 | +/** | ||
| 225 | + * 修改群头像 | ||
| 226 | + * | ||
| 227 | + * @param group 群组Id | ||
| 228 | + * @param url 群头像地址(最长100字节) | ||
| 229 | + * @param succ 成功回调 | ||
| 230 | + * @param fail 失败回调 | ||
| 231 | + * | ||
| 232 | + * @return 0 成功 | ||
| 233 | + */ | ||
| 234 | +- (int)modifyGroupFaceUrl:(NSString*)group url:(NSString*)url succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 235 | + | ||
| 236 | +/** | ||
| 237 | + * 修改加群选项 | ||
| 238 | + * | ||
| 239 | + * @param group 群组Id | ||
| 240 | + * @param opt 加群选项,详见 TIMGroupAddOpt | ||
| 241 | + * @param succ 成功回调 | ||
| 242 | + * @param fail 失败回调 | ||
| 243 | + * | ||
| 244 | + * @return 0 成功 | ||
| 245 | + */ | ||
| 246 | +- (int)modifyGroupAddOpt:(NSString*)group opt:(TIMGroupAddOpt)opt succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 247 | + | ||
| 248 | +/** | ||
| 249 | + * 修改群自定义字段集合 | ||
| 250 | + * | ||
| 251 | + * @param group 群组Id | ||
| 252 | + * @param customInfo 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 253 | + * @param succ 成功回调 | ||
| 254 | + * @param fail 失败回调 | ||
| 255 | + * | ||
| 256 | + * @return 0 成功 | ||
| 257 | + */ | ||
| 258 | +- (int)modifyGroupCustomInfo:(NSString*)group customInfo:(NSDictionary*)customInfo succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 259 | + | ||
| 260 | +/** | ||
| 261 | + * 转让群给新群主 | ||
| 262 | + * | ||
| 263 | + * @param group 群组Id | ||
| 264 | + * @param identifier 新的群主Id | ||
| 265 | + * @param succ 成功回调 | ||
| 266 | + * @param fail 失败回调 | ||
| 267 | + * | ||
| 268 | + * @return 0 成功 | ||
| 269 | + */ | ||
| 270 | +- (int)modifyGroupOwner:(NSString*)group user:(NSString*)identifier succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 271 | + | ||
| 272 | +/** | ||
| 273 | + * 修改接受消息选项 | ||
| 274 | + * | ||
| 275 | + * @param group 群组Id | ||
| 276 | + * @param opt 接受消息选项,详见 TIMGroupReceiveMessageOpt | ||
| 277 | + * @param succ 成功回调 | ||
| 278 | + * @param fail 失败回调 | ||
| 279 | + * | ||
| 280 | + * @return 0 成功 | ||
| 281 | + */ | ||
| 282 | +- (int)modifyReciveMessageOpt:(NSString*)group opt:(TIMGroupReceiveMessageOpt)opt succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 283 | + | ||
| 284 | +/** | ||
| 285 | + * 修改群成员角色 | ||
| 286 | + * | ||
| 287 | + * @param group 群组Id | ||
| 288 | + * @param identifier 被修改角色的用户identifier | ||
| 289 | + * @param role 角色(注意:不能修改为群主),详见 TIMGroupMemberRole | ||
| 290 | + * @param succ 成功回调 | ||
| 291 | + * @param fail 失败回调 | ||
| 292 | + * | ||
| 293 | + * @return 0 成功 | ||
| 294 | + */ | ||
| 295 | +- (int)modifyGroupMemberInfoSetRole:(NSString*)group user:(NSString*)identifier role:(TIMGroupMemberRole)role succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 296 | + | ||
| 297 | +/** | ||
| 298 | + * 禁言用户(只有管理员或群主能够调用) | ||
| 299 | + * | ||
| 300 | + * @param group 群组Id | ||
| 301 | + * @param identifier 被禁言的用户identifier | ||
| 302 | + * @param stime 禁言时间 | ||
| 303 | + * @param succ 成功回调 | ||
| 304 | + * @param fail 失败回调 | ||
| 305 | + * | ||
| 306 | + * @return 0 成功 | ||
| 307 | + */ | ||
| 308 | +- (int)modifyGroupMemberInfoSetSilence:(NSString*)group user:(NSString*)identifier stime:(uint32_t)stime succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 309 | + | ||
| 310 | +/** | ||
| 311 | + * 修改群名片(只有本人、管理员或群主能够调用) | ||
| 312 | + * | ||
| 313 | + * @param group 群组Id | ||
| 314 | + * @param identifier 被操作用户identifier | ||
| 315 | + * @param nameCard 群名片 | ||
| 316 | + * @param succ 成功回调 | ||
| 317 | + * @param fail 失败回调 | ||
| 318 | + * | ||
| 319 | + * @return 0 成功 | ||
| 320 | + */ | ||
| 321 | +- (int)modifyGroupMemberInfoSetNameCard:(NSString*)group user:(NSString*)identifier nameCard:(NSString*)nameCard succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 322 | + | ||
| 323 | +/** | ||
| 324 | + * 修改群成员自定义字段集合 | ||
| 325 | + * | ||
| 326 | + * @param group 群组Id | ||
| 327 | + * @param identifier 被操作用户identifier | ||
| 328 | + * @param customInfo 自定义字段集合,key是NSString*类型,value是NSData*类型 | ||
| 329 | + * @param succ 成功回调 | ||
| 330 | + * @param fail 失败回调 | ||
| 331 | + * | ||
| 332 | + * @return 0 成功 | ||
| 333 | + */ | ||
| 334 | +- (int)modifyGroupMemberInfoSetCustomInfo:(NSString*)group user:(NSString*)identifier customInfo:(NSDictionary*)customInfo succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 335 | + | ||
| 336 | +/** | ||
| 337 | + * 修改群组是否可被搜索属性 | ||
| 338 | + * | ||
| 339 | + * @param group 群组Id | ||
| 340 | + * @param searchable 是否能被搜索 | ||
| 341 | + * @param succ 成功回调 | ||
| 342 | + * @param fail 失败回调 | ||
| 343 | + * | ||
| 344 | + * @return 0 成功 | ||
| 345 | + */ | ||
| 346 | +- (int)modifyGroupSearchable:(NSString*)group searchable:(BOOL)searchable succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 347 | + | ||
| 348 | +/** | ||
| 349 | + * 修改群组成员是否可见属性 | ||
| 350 | + * | ||
| 351 | + * @param group 群组Id | ||
| 352 | + * @param visible 是否可见 | ||
| 353 | + * @param succ 成功回调 | ||
| 354 | + * @param fail 失败回调 | ||
| 355 | + * | ||
| 356 | + * @return 0 成功 | ||
| 357 | + */ | ||
| 358 | +- (int)modifyGroupMemberVisible:(NSString*)group visible:(BOOL)visible succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 359 | + | ||
| 360 | +/** | ||
| 361 | + * 修改群组全员禁言属性 | ||
| 362 | + * | ||
| 363 | + * @param group 群组Id | ||
| 364 | + * @param shutup 是否禁言 | ||
| 365 | + * @param succ 成功回调 | ||
| 366 | + * @param fail 失败回调 | ||
| 367 | + * | ||
| 368 | + * @return 0 成功 | ||
| 369 | + */ | ||
| 370 | +- (int)modifyGroupAllShutup:(NSString*)group shutup:(BOOL)shutup succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 371 | + | ||
| 372 | +/** | ||
| 373 | + * 获取群组未决列表 | ||
| 374 | + * | ||
| 375 | + * @param option 未决参数配置 | ||
| 376 | + * @param succ 成功回调,返回未决列表 | ||
| 377 | + * @param fail 失败回调 | ||
| 378 | + * | ||
| 379 | + * @return 0 成功 | ||
| 380 | + */ | ||
| 381 | +- (int)getPendencyFromServer:(TIMGroupPendencyOption*)option succ:(TIMGetGroupPendencyListSucc)succ fail:(TIMFail)fail; | ||
| 382 | + | ||
| 383 | +/** | ||
| 384 | + * 群未决已读上报 | ||
| 385 | + * | ||
| 386 | + * @param timestamp 上报已读时间戳 | ||
| 387 | + * @param succ 成功回调 | ||
| 388 | + * @param fail 失败回调 | ||
| 389 | + * | ||
| 390 | + * @return 0 成功 | ||
| 391 | + */ | ||
| 392 | +- (int)pendencyReport:(uint64_t)timestamp succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 393 | + | ||
| 394 | +#pragma mark - 开启本地缓存后有效 | ||
| 395 | + | ||
| 396 | +/** | ||
| 397 | + * 获取用户所在群组信息 | ||
| 398 | + * | ||
| 399 | + * @param groups 群组id(NSString*)列表,nil时返回群组列表 | ||
| 400 | + * | ||
| 401 | + * @return 群组信息(TIMGroupInfo*)列表,assistant未同步时返回nil | ||
| 402 | + */ | ||
| 403 | +- (NSArray*)getGroupInfo:(NSArray*)groups; | ||
| 404 | + | ||
| 405 | +@end | ||
| 406 | + | ||
| 407 | +#endif /* TIMGroupManager_Ext_h */ |
| 1 | +// | ||
| 2 | +// TIMGroupManager.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 17/3/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_TIMGroupManager_h | ||
| 10 | +#define ImSDK_TIMGroupManager_h | ||
| 11 | + | ||
| 12 | +#import "TIMComm.h" | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +@interface TIMGroupManager : NSObject | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 获取群管理器实例 | ||
| 19 | + * | ||
| 20 | + * @return 管理器实例 | ||
| 21 | + */ | ||
| 22 | ++ (TIMGroupManager*)sharedInstance; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * 创建群组 | ||
| 26 | + * | ||
| 27 | + * @param type 群类型,Private,Public,ChatRoom,AVChatRoom | ||
| 28 | + * @param groupId 自定义群组id,为空时系统自动分配 | ||
| 29 | + * @param groupName 群组名称 | ||
| 30 | + * @param succ 成功回调 | ||
| 31 | + * @param fail 失败回调 | ||
| 32 | + * | ||
| 33 | + * @return 0 成功 | ||
| 34 | + */ | ||
| 35 | +- (int)createGroup:(NSString*)type groupId:(NSString*)groupId groupName:(NSString*)groupName succ:(TIMCreateGroupSucc)succ fail:(TIMFail)fail; | ||
| 36 | + | ||
| 37 | +/** | ||
| 38 | + * 解散群组 | ||
| 39 | + * | ||
| 40 | + * @param group 群组Id | ||
| 41 | + * @param succ 成功回调 | ||
| 42 | + * @param fail 失败回调 | ||
| 43 | + * | ||
| 44 | + * @return 0 成功 | ||
| 45 | + */ | ||
| 46 | +- (int)deleteGroup:(NSString*)group succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 47 | + | ||
| 48 | +/** | ||
| 49 | + * 申请加群 | ||
| 50 | + * | ||
| 51 | + * @param group 申请加入的群组Id | ||
| 52 | + * @param msg 申请消息 | ||
| 53 | + * @param succ 成功回调(申请成功等待审批) | ||
| 54 | + * @param fail 失败回调 | ||
| 55 | + * | ||
| 56 | + * @return 0 成功 | ||
| 57 | + */ | ||
| 58 | +- (int)joinGroup:(NSString*)group msg:(NSString*)msg succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 59 | + | ||
| 60 | +/** | ||
| 61 | + * 主动退出群组 | ||
| 62 | + * | ||
| 63 | + * @param group 群组Id | ||
| 64 | + * @param succ 成功回调 | ||
| 65 | + * @param fail 失败回调 | ||
| 66 | + * | ||
| 67 | + * @return 0 成功 | ||
| 68 | + */ | ||
| 69 | +- (int)quitGroup:(NSString*)group succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 70 | + | ||
| 71 | +@end | ||
| 72 | + | ||
| 73 | +#endif |
| 1 | +// | ||
| 2 | +// TIMManager+MsgExt.h | ||
| 3 | +// IMMessageExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2017/1/11. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TIMManager_MsgExt_h | ||
| 10 | +#define TIMManager_MsgExt_h | ||
| 11 | + | ||
| 12 | +#import "ImSDK.h" | ||
| 13 | +#import "TIMComm+MsgExt.h" | ||
| 14 | + | ||
| 15 | +@class TIMMessage; | ||
| 16 | + | ||
| 17 | +@interface TIMManager (MsgExt) | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * 发送消息给多个用户 | ||
| 21 | + * | ||
| 22 | + * @param msg 发送的消息 | ||
| 23 | + * @param users 目标用户的id列表 | ||
| 24 | + * @param succ 成功回调 | ||
| 25 | + * @param fail 失败回调 | ||
| 26 | + * | ||
| 27 | + * @return 0 发送成功 | ||
| 28 | + */ | ||
| 29 | +- (int)sendMessage:(TIMMessage*)msg toUsers:(NSArray*)users succ:(TIMSucc)succ fail:(TIMSendToUsersFail)fail; | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * 获取会话(TIMConversation*)列表 | ||
| 33 | + * | ||
| 34 | + * @return 会话列表 | ||
| 35 | + */ | ||
| 36 | +- (NSArray*)getConversationList; | ||
| 37 | + | ||
| 38 | +/** | ||
| 39 | + * 删除会话 | ||
| 40 | + * | ||
| 41 | + * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊 | ||
| 42 | + * @param receiver 用户identifier 或者 群组Id | ||
| 43 | + * | ||
| 44 | + * @return TRUE:删除成功 FALSE:删除失败 | ||
| 45 | + */ | ||
| 46 | +- (BOOL)deleteConversation:(TIMConversationType)type receiver:(NSString*)receiver; | ||
| 47 | + | ||
| 48 | +/** | ||
| 49 | + * 删除会话和消息 | ||
| 50 | + * | ||
| 51 | + * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊 | ||
| 52 | + * @param receiver 用户identifier 或者 群组Id | ||
| 53 | + * | ||
| 54 | + * @return TRUE:删除成功 FALSE:删除失败 | ||
| 55 | + */ | ||
| 56 | +- (BOOL)deleteConversationAndMessages:(TIMConversationType)type receiver:(NSString*)receiver; | ||
| 57 | + | ||
| 58 | +/** | ||
| 59 | + * 获取会话数量 | ||
| 60 | + * | ||
| 61 | + * @return 会话数量 | ||
| 62 | + */ | ||
| 63 | +- (int)conversationCount; | ||
| 64 | + | ||
| 65 | +/** | ||
| 66 | + * 初始化存储,仅查看历史消息时使用,如果要收发消息等操作,如login成功,不需要调用此函数 | ||
| 67 | + * | ||
| 68 | + * @param param 登陆参数(userSig 不用填写) | ||
| 69 | + * @param succ 成功回调,收到回调时,可以获取会话列表和消息 | ||
| 70 | + * @param fail 失败回调 | ||
| 71 | + * | ||
| 72 | + * @return 0 请求成功 | ||
| 73 | + */ | ||
| 74 | +- (int)initStorage:(TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; | ||
| 75 | + | ||
| 76 | +@end | ||
| 77 | + | ||
| 78 | + | ||
| 79 | +#endif /* TIMManager_MsgExt_h */ |
| 1 | +// | ||
| 2 | +// TIMManager.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 28/1/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_TIMManager_h | ||
| 10 | +#define ImSDK_TIMManager_h | ||
| 11 | + | ||
| 12 | +#import "TIMComm.h" | ||
| 13 | +#import "TIMCallback.h" | ||
| 14 | + | ||
| 15 | +@class TIMGroupManager; | ||
| 16 | +//@class TIMFriendshipManager; | ||
| 17 | + | ||
| 18 | +///////////////////////////////////////////////////////// | ||
| 19 | +/// Tencent 开放 SDK API | ||
| 20 | +///////////////////////////////////////////////////////// | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * 通讯管理 | ||
| 24 | + */ | ||
| 25 | +@interface TIMManager : NSObject | ||
| 26 | + | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 获取管理器实例 | ||
| 30 | + * | ||
| 31 | + * @return 管理器实例 | ||
| 32 | + */ | ||
| 33 | ++ (TIMManager*)sharedInstance; | ||
| 34 | + | ||
| 35 | +/** | ||
| 36 | + * 初始化SDK | ||
| 37 | + * | ||
| 38 | + * @param config 配置信息,全局有效 | ||
| 39 | + * | ||
| 40 | + * @return 0 成功 | ||
| 41 | + */ | ||
| 42 | +- (int)initSdk:(TIMSdkConfig*)config; | ||
| 43 | + | ||
| 44 | +/** | ||
| 45 | + * 获取全局配置 | ||
| 46 | + * | ||
| 47 | + * @return 全局配置 | ||
| 48 | + */ | ||
| 49 | +- (TIMSdkConfig*)getGlobalConfig; | ||
| 50 | + | ||
| 51 | +/** | ||
| 52 | + * 初始化当前manager,在initSdk:后调用,login:前调用 | ||
| 53 | + * | ||
| 54 | + * @param config 配置信息,对当前TIMManager有效 | ||
| 55 | + * | ||
| 56 | + * @return 0 成功 | ||
| 57 | + */ | ||
| 58 | +- (int)setUserConfig:(TIMUserConfig*)config; | ||
| 59 | + | ||
| 60 | +/** | ||
| 61 | + * 获取当前manager绑定用户的配置 | ||
| 62 | + * | ||
| 63 | + * @return 当前manager绑定用户的配置 | ||
| 64 | + */ | ||
| 65 | +- (TIMUserConfig*)getUserConfig; | ||
| 66 | + | ||
| 67 | +/** | ||
| 68 | + * 添加消息回调(重复添加无效) | ||
| 69 | + * | ||
| 70 | + * @param listener 回调 | ||
| 71 | + * | ||
| 72 | + * @return 成功 | ||
| 73 | + */ | ||
| 74 | +- (int)addMessageListener:(id<TIMMessageListener>)listener; | ||
| 75 | + | ||
| 76 | +/** | ||
| 77 | + * 移除消息回调 | ||
| 78 | + * | ||
| 79 | + * @param listener 回调 | ||
| 80 | + * | ||
| 81 | + * @return 成功 | ||
| 82 | + */ | ||
| 83 | +- (int)removeMessageListener:(id<TIMMessageListener>)listener; | ||
| 84 | + | ||
| 85 | +/** | ||
| 86 | + * 登陆 | ||
| 87 | + * | ||
| 88 | + * @param param 登陆参数 | ||
| 89 | + * @param succ 成功回调 | ||
| 90 | + * @param fail 失败回调 | ||
| 91 | + * | ||
| 92 | + * @return 0 请求成功 | ||
| 93 | + */ | ||
| 94 | +- (int)login: (TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail; | ||
| 95 | + | ||
| 96 | +/** | ||
| 97 | + * 获取当前登陆的用户 | ||
| 98 | + * | ||
| 99 | + * @return 如果登陆返回用户的identifier,如果未登录返回nil | ||
| 100 | + */ | ||
| 101 | +- (NSString*)getLoginUser; | ||
| 102 | + | ||
| 103 | +/** | ||
| 104 | + * 获取当前登录状态 | ||
| 105 | + * | ||
| 106 | + * @return 登录状态 | ||
| 107 | + */ | ||
| 108 | +- (TIMLoginStatus)getLoginStatus; | ||
| 109 | + | ||
| 110 | +/** | ||
| 111 | + * 登出 | ||
| 112 | + * | ||
| 113 | + * @param succ 成功回调,登出成功 | ||
| 114 | + * @param fail 失败回调,返回错误吗和错误信息 | ||
| 115 | + * | ||
| 116 | + * @return 0 发送登出包成功,等待回调 | ||
| 117 | + */ | ||
| 118 | +- (int)logout:(TIMLoginSucc)succ fail:(TIMFail)fail; | ||
| 119 | + | ||
| 120 | +#pragma mark - 消息会话操作 | ||
| 121 | + | ||
| 122 | +/** | ||
| 123 | + * 获取会话 | ||
| 124 | + * | ||
| 125 | + * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊 | ||
| 126 | + * TIM_SYSTEM 表示系统会话 | ||
| 127 | + * @param receiver C2C 为对方用户 identifier,GROUP 为群组Id,SYSTEM为@"" | ||
| 128 | + * | ||
| 129 | + * @return 会话对象 | ||
| 130 | + */ | ||
| 131 | +- (TIMConversation*)getConversation:(TIMConversationType)type receiver:(NSString*)receiver; | ||
| 132 | + | ||
| 133 | +#pragma mark - APNs推送 | ||
| 134 | + | ||
| 135 | +/** | ||
| 136 | + * 设置Token,需要登录后调用 | ||
| 137 | + * | ||
| 138 | + * @param token token信息 | ||
| 139 | + * @param succ 成功回调 | ||
| 140 | + * @param fail 失败回调 | ||
| 141 | + * | ||
| 142 | + * @return 0 成功 | ||
| 143 | + */ | ||
| 144 | +- (int)setToken:(TIMTokenParam*)token succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 145 | + | ||
| 146 | +/** | ||
| 147 | + * 设置APNS配置 | ||
| 148 | + * | ||
| 149 | + * @param config APNS配置 | ||
| 150 | + * @param succ 成功回调 | ||
| 151 | + * @param fail 失败回调 | ||
| 152 | + * | ||
| 153 | + * @return 0 成功 | ||
| 154 | + */ | ||
| 155 | +- (int)setAPNS:(TIMAPNSConfig*)config succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 156 | + | ||
| 157 | +/** | ||
| 158 | + * 获取APNS配置 | ||
| 159 | + * | ||
| 160 | + * @param succ 成功回调,返回配置信息 | ||
| 161 | + * @param fail 失败回调 | ||
| 162 | + * | ||
| 163 | + * @return 0 成功 | ||
| 164 | + */ | ||
| 165 | +- (int)getAPNSConfig:(TIMAPNSConfigSucc)succ fail:(TIMFail)fail; | ||
| 166 | + | ||
| 167 | +/** | ||
| 168 | + * app 切后台时调用 | ||
| 169 | + * | ||
| 170 | + * @param param 上报参数 | ||
| 171 | + * @param succ 成功时回调 | ||
| 172 | + * @param fail 失败时回调 | ||
| 173 | + * | ||
| 174 | + * @return 0 表示成功 | ||
| 175 | + */ | ||
| 176 | +- (int)doBackground:(TIMBackgroundParam*)param succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 177 | + | ||
| 178 | + | ||
| 179 | +/** | ||
| 180 | + * 切前台 | ||
| 181 | + * | ||
| 182 | + * @param succ 成功时回调 | ||
| 183 | + * @param fail 失败时回调 | ||
| 184 | + * | ||
| 185 | + * @return 0 表示成功 | ||
| 186 | + */ | ||
| 187 | +- (int)doForeground:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 188 | + | ||
| 189 | +#pragma mark - 调试使用 | ||
| 190 | + | ||
| 191 | +/** | ||
| 192 | + * 获取网络状态 | ||
| 193 | + */ | ||
| 194 | +- (TIMNetworkStatus)networkStatus; | ||
| 195 | + | ||
| 196 | +/** | ||
| 197 | + * 设置环境(在InitSdk之前调用,注意:除非是IM工作人员指定要求设置,否则不需要调用此接口) | ||
| 198 | + * | ||
| 199 | + * @param env 0 正式环境(默认) | ||
| 200 | + * 1 测试环境 | ||
| 201 | + */ | ||
| 202 | +- (void)setEnv:(int)env; | ||
| 203 | + | ||
| 204 | +/** | ||
| 205 | + * 获取环境类型 | ||
| 206 | + * | ||
| 207 | + * @return env 0 正式环境(默认) | ||
| 208 | + * 1 测试环境 | ||
| 209 | + * 2 beta 环境 | ||
| 210 | + */ | ||
| 211 | +- (int)getEnv; | ||
| 212 | + | ||
| 213 | +/** | ||
| 214 | + * 获取版本号 | ||
| 215 | + * | ||
| 216 | + * @return 返回版本号,字符串表示,例如v1.1.1 | ||
| 217 | + */ | ||
| 218 | +- (NSString*)GetVersion; | ||
| 219 | + | ||
| 220 | +/** | ||
| 221 | + * 获取联网SDK的版本号 | ||
| 222 | + * | ||
| 223 | + * @return 返回版本号 | ||
| 224 | + */ | ||
| 225 | +- (NSString*)GetQALVersion; | ||
| 226 | + | ||
| 227 | +/** | ||
| 228 | + * 打印日志,通过ImSDK提供的日志功能打印日志 | ||
| 229 | + * | ||
| 230 | + * @param level 日志级别 | ||
| 231 | + * @param tag 模块tag | ||
| 232 | + * @param msg 要输出的日志内容 | ||
| 233 | + */ | ||
| 234 | +- (void)log:(TIMLogLevel)level tag:(NSString*)tag msg:(NSString*)msg; | ||
| 235 | + | ||
| 236 | +#pragma mark - 登录多账号 | ||
| 237 | + | ||
| 238 | +/** | ||
| 239 | + * 创建新的管理器类型(多用户登陆时使用,否则可直接调用sharedInstance) | ||
| 240 | + * | ||
| 241 | + * @return 管理器实例 | ||
| 242 | + */ | ||
| 243 | ++ (TIMManager*)newManager; | ||
| 244 | + | ||
| 245 | +/** | ||
| 246 | + * 获取管理器类型(多用户登陆时使用,否则可直接调用sharedInstance) | ||
| 247 | + * | ||
| 248 | + * @param identifier 用户identifier | ||
| 249 | + * | ||
| 250 | + * @return 对应管理器类型,如果没有创建过,返回nil | ||
| 251 | + */ | ||
| 252 | ++ (TIMManager*)getManager:(NSString*)identifier; | ||
| 253 | + | ||
| 254 | +/** | ||
| 255 | + * 销毁管理器(多用户登陆时使用,否则可直接调用sharedInstance) | ||
| 256 | + * | ||
| 257 | + * @param manager 需要销毁的管理器 | ||
| 258 | + */ | ||
| 259 | ++ (void)deleteManager:(TIMManager*)manager; | ||
| 260 | + | ||
| 261 | +/** | ||
| 262 | + * 获取好友管理器 | ||
| 263 | + * | ||
| 264 | + * @return 好友管理器 | ||
| 265 | + */ | ||
| 266 | +//- (TIMFriendshipManager*)friendshipManager; | ||
| 267 | + | ||
| 268 | +/** | ||
| 269 | + * 获取群管理器 | ||
| 270 | + * | ||
| 271 | + * @return 群管理器 | ||
| 272 | + */ | ||
| 273 | +- (TIMGroupManager*)groupManager; | ||
| 274 | + | ||
| 275 | +#pragma mark - 内部使用的方法 | ||
| 276 | + | ||
| 277 | +/** | ||
| 278 | + * 获取日志文件路径 | ||
| 279 | + */ | ||
| 280 | +- (NSString*)getLogPath; | ||
| 281 | + | ||
| 282 | +/** | ||
| 283 | + * 是否开启sdk日志打印 | ||
| 284 | + */ | ||
| 285 | +- (BOOL)getIsLogPrintEnabled; | ||
| 286 | + | ||
| 287 | +/** | ||
| 288 | + * 获取日志级别 | ||
| 289 | + * | ||
| 290 | + * @return 返回日志级别 | ||
| 291 | + */ | ||
| 292 | +-(TIMLogLevel) getLogLevel; | ||
| 293 | +@end | ||
| 294 | +#endif |
| 1 | +// | ||
| 2 | +// TIMMessage+MsgExt.h | ||
| 3 | +// IMMessageExt | ||
| 4 | +// | ||
| 5 | +// Created by tomzhu on 2016/12/27. | ||
| 6 | +// | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TIMMessage_h | ||
| 10 | +#define TIMMessage_h | ||
| 11 | + | ||
| 12 | +#import "ImSDK.h" | ||
| 13 | +#import "TIMComm+MsgExt.h" | ||
| 14 | + | ||
| 15 | +#pragma mark - Elem类型 | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * 关系链变更消息 | ||
| 19 | + */ | ||
| 20 | +@interface TIMSNSSystemElem : TIMElem | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * 操作类型 | ||
| 24 | + */ | ||
| 25 | +@property(nonatomic,assign) TIM_SNS_SYSTEM_TYPE type; | ||
| 26 | + | ||
| 27 | +/** | ||
| 28 | + * 被操作用户列表:TIMSNSChangeInfo 列表 | ||
| 29 | + */ | ||
| 30 | +@property(nonatomic,strong) NSArray * users; | ||
| 31 | + | ||
| 32 | +/** | ||
| 33 | + * 未决已读上报时间戳 type=TIM_SNS_SYSTEM_PENDENCY_REPORT 有效 | ||
| 34 | + */ | ||
| 35 | +@property(nonatomic,assign) uint64_t pendencyReportTimestamp; | ||
| 36 | + | ||
| 37 | +/** | ||
| 38 | + * 推荐已读上报时间戳 type=TIM_SNS_SYSTEM_RECOMMEND_REPORT 有效 | ||
| 39 | + */ | ||
| 40 | +@property(nonatomic,assign) uint64_t recommendReportTimestamp; | ||
| 41 | + | ||
| 42 | +/** | ||
| 43 | + * 已决已读上报时间戳 type=TIM_SNS_SYSTEM_DECIDE_REPORT 有效 | ||
| 44 | + */ | ||
| 45 | +@property(nonatomic,assign) uint64_t decideReportTimestamp; | ||
| 46 | + | ||
| 47 | +@end | ||
| 48 | + | ||
| 49 | +/** | ||
| 50 | + * 资料变更系统消息 | ||
| 51 | + */ | ||
| 52 | +@interface TIMProfileSystemElem : TIMElem | ||
| 53 | + | ||
| 54 | +/** | ||
| 55 | + * 变更类型 | ||
| 56 | + */ | ||
| 57 | +@property(nonatomic,assign) TIM_PROFILE_SYSTEM_TYPE type; | ||
| 58 | + | ||
| 59 | +/** | ||
| 60 | + * 资料变更的用户 | ||
| 61 | + */ | ||
| 62 | +@property(nonatomic,strong) NSString * fromUser; | ||
| 63 | + | ||
| 64 | +/** | ||
| 65 | + * 资料变更的昵称(如果昵称没有变更,该值为nil) | ||
| 66 | + */ | ||
| 67 | +@property(nonatomic,strong) NSString * nickName; | ||
| 68 | + | ||
| 69 | +@end | ||
| 70 | + | ||
| 71 | +#pragma mark - 消息扩展 | ||
| 72 | + | ||
| 73 | +@interface TIMMessage (MsgExt) | ||
| 74 | + | ||
| 75 | +/** | ||
| 76 | + * 是否已读 | ||
| 77 | + * | ||
| 78 | + * @return TRUE 已读 FALSE 未读 | ||
| 79 | + */ | ||
| 80 | +- (BOOL)isReaded; | ||
| 81 | + | ||
| 82 | +/** | ||
| 83 | + * 对方是否已读(仅C2C消息有效) | ||
| 84 | + * | ||
| 85 | + * @return TRUE 已读 FALSE 未读 | ||
| 86 | + */ | ||
| 87 | +- (BOOL)isPeerReaded; | ||
| 88 | + | ||
| 89 | +/** | ||
| 90 | + * 删除消息 | ||
| 91 | + * | ||
| 92 | + * @return TRUE 成功 | ||
| 93 | + */ | ||
| 94 | +- (BOOL)remove; | ||
| 95 | + | ||
| 96 | +/** | ||
| 97 | + * 消息有断层,OnNewMessage回调收到消息,如果有断层,需要重新GetMessage补全(有C2C漫游的情况下使用) | ||
| 98 | + * | ||
| 99 | + * @return TRUE 有断层 | ||
| 100 | + * FALSE 无断层 | ||
| 101 | + */ | ||
| 102 | +- (BOOL)hasGap; | ||
| 103 | + | ||
| 104 | +/** | ||
| 105 | + * 设置自定义整数,默认为0 | ||
| 106 | + * | ||
| 107 | + * @param param 设置参数 | ||
| 108 | + * | ||
| 109 | + * @return TRUE 设置成功 | ||
| 110 | + */ | ||
| 111 | +- (BOOL)setCustomInt:(int32_t)param; | ||
| 112 | + | ||
| 113 | +/** | ||
| 114 | + * 设置自定义数据,默认为"" | ||
| 115 | + * | ||
| 116 | + * @param data 设置参数 | ||
| 117 | + * | ||
| 118 | + * @return TRUE 设置成功 | ||
| 119 | + */ | ||
| 120 | +- (BOOL)setCustomData:(NSData*)data; | ||
| 121 | + | ||
| 122 | +/** | ||
| 123 | + * 获取CustomInt | ||
| 124 | + * | ||
| 125 | + * @return CustomInt | ||
| 126 | + */ | ||
| 127 | +- (int32_t)customInt; | ||
| 128 | + | ||
| 129 | +/** | ||
| 130 | + * 获取CustomData | ||
| 131 | + * | ||
| 132 | + * @return CustomData | ||
| 133 | + */ | ||
| 134 | +- (NSData*)customData; | ||
| 135 | + | ||
| 136 | +/** | ||
| 137 | + * 获取消息定位符 | ||
| 138 | + * | ||
| 139 | + * @return locator | ||
| 140 | + */ | ||
| 141 | +- (TIMMessageLocator*)locator; | ||
| 142 | + | ||
| 143 | +/** | ||
| 144 | + * 是否为locator对应的消息 | ||
| 145 | + * | ||
| 146 | + * @param locator 消息定位符 | ||
| 147 | + * | ||
| 148 | + * @return YES 是对应的消息 | ||
| 149 | + */ | ||
| 150 | +- (BOOL)respondsToLocator:(TIMMessageLocator*)locator; | ||
| 151 | + | ||
| 152 | +/** | ||
| 153 | + * 设置消息时间戳,导入到本地时有效 | ||
| 154 | + * | ||
| 155 | + * @param time 时间戳 | ||
| 156 | + * | ||
| 157 | + * @return 0 成功 | ||
| 158 | + */ | ||
| 159 | +- (int)setTime:(time_t)time; | ||
| 160 | + | ||
| 161 | +/** | ||
| 162 | + * 设置消息发送方(需要先将消息到导入到本地,调用 convertToImportedMsg 方法) | ||
| 163 | + | ||
| 164 | + * | ||
| 165 | + * @param sender 发送方Id | ||
| 166 | + * | ||
| 167 | + * @return 0 成功 | ||
| 168 | + */ | ||
| 169 | +- (int)setSender:(NSString*)sender; | ||
| 170 | + | ||
| 171 | +/** | ||
| 172 | + * 将消息导入到本地 | ||
| 173 | + * | ||
| 174 | + * @return 0 成功 | ||
| 175 | + */ | ||
| 176 | +- (int)convertToImportedMsg; | ||
| 177 | + | ||
| 178 | +@end | ||
| 179 | + | ||
| 180 | +#pragma mark - 消息草稿 | ||
| 181 | + | ||
| 182 | +@interface TIMMessageDraft : NSObject | ||
| 183 | + | ||
| 184 | +/** | ||
| 185 | + * 设置自定义数据 | ||
| 186 | + * | ||
| 187 | + * @param userData 自定义数据 | ||
| 188 | + * | ||
| 189 | + * @return 0 成功 | ||
| 190 | + */ | ||
| 191 | +- (int)setUserData:(NSData*)userData; | ||
| 192 | + | ||
| 193 | +/** | ||
| 194 | + * 获取自定义数据 | ||
| 195 | + * | ||
| 196 | + * @return 自定义数据 | ||
| 197 | + */ | ||
| 198 | +- (NSData*)getUserData; | ||
| 199 | + | ||
| 200 | +/** | ||
| 201 | + * 增加Elem | ||
| 202 | + * | ||
| 203 | + * @param elem elem结构 | ||
| 204 | + * | ||
| 205 | + * @return 0 表示成功 | ||
| 206 | + * 1 禁止添加Elem(文件或语音多于两个Elem) | ||
| 207 | + * 2 未知Elem | ||
| 208 | + */ | ||
| 209 | +- (int)addElem:(TIMElem*)elem; | ||
| 210 | + | ||
| 211 | +/** | ||
| 212 | + * 获取对应索引的Elem | ||
| 213 | + * | ||
| 214 | + * @param index 对应索引 | ||
| 215 | + * | ||
| 216 | + * @return 返回对应Elem | ||
| 217 | + */ | ||
| 218 | +- (TIMElem*)getElem:(int)index; | ||
| 219 | + | ||
| 220 | +/** | ||
| 221 | + * 获取Elem数量 | ||
| 222 | + * | ||
| 223 | + * @return elem数量 | ||
| 224 | + */ | ||
| 225 | +- (int)elemCount; | ||
| 226 | + | ||
| 227 | +/** | ||
| 228 | + * 草稿生成对应的消息 | ||
| 229 | + * | ||
| 230 | + * @return 消息 | ||
| 231 | + */ | ||
| 232 | +- (TIMMessage*)transformToMessage; | ||
| 233 | + | ||
| 234 | +/** | ||
| 235 | + * 当前消息的时间戳 | ||
| 236 | + * | ||
| 237 | + * @return 时间戳 | ||
| 238 | + */ | ||
| 239 | +- (NSDate*)timestamp; | ||
| 240 | + | ||
| 241 | +@end | ||
| 242 | + | ||
| 243 | +#endif /* TIMMessage_h */ |
| 1 | +// | ||
| 2 | +// TIMMessage.h | ||
| 3 | +// ImSDK | ||
| 4 | +// | ||
| 5 | +// Created by bodeng on 28/1/15. | ||
| 6 | +// Copyright (c) 2015 tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef ImSDK_TIMMessage_h | ||
| 10 | +#define ImSDK_TIMMessage_h | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +#import <Foundation/Foundation.h> | ||
| 14 | + | ||
| 15 | +#import "TIMComm.h" | ||
| 16 | +#import "TIMCallback.h" | ||
| 17 | + | ||
| 18 | +@class TIMUserProfile; | ||
| 19 | +@class TIMGroupMemberInfo; | ||
| 20 | +@class TIMConversation; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * 消息Elem基类 | ||
| 24 | + */ | ||
| 25 | +@interface TIMElem : NSObject | ||
| 26 | +@end | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 文本消息Elem | ||
| 30 | + */ | ||
| 31 | +@interface TIMTextElem : TIMElem | ||
| 32 | +/** | ||
| 33 | + * 消息文本 | ||
| 34 | + */ | ||
| 35 | +@property(nonatomic,strong) NSString * text; | ||
| 36 | +@end | ||
| 37 | + | ||
| 38 | +#pragma mark - 普通消息类型 | ||
| 39 | + | ||
| 40 | +@interface TIMImage : NSObject | ||
| 41 | +/** | ||
| 42 | + * 图片ID,内部标识,可用于外部缓存key | ||
| 43 | + */ | ||
| 44 | +@property(nonatomic,strong) NSString * uuid; | ||
| 45 | +/** | ||
| 46 | + * 图片类型 | ||
| 47 | + */ | ||
| 48 | +@property(nonatomic,assign) TIM_IMAGE_TYPE type; | ||
| 49 | +/** | ||
| 50 | + * 图片大小 | ||
| 51 | + */ | ||
| 52 | +@property(nonatomic,assign) int size; | ||
| 53 | +/** | ||
| 54 | + * 图片宽度 | ||
| 55 | + */ | ||
| 56 | +@property(nonatomic,assign) int width; | ||
| 57 | +/** | ||
| 58 | + * 图片高度 | ||
| 59 | + */ | ||
| 60 | +@property(nonatomic,assign) int height; | ||
| 61 | +/** | ||
| 62 | + * 下载URL | ||
| 63 | + */ | ||
| 64 | +@property(nonatomic, strong) NSString * url; | ||
| 65 | + | ||
| 66 | +/** | ||
| 67 | + * 获取图片 | ||
| 68 | + * | ||
| 69 | + * @param path 图片保存路径 | ||
| 70 | + * @param succ 成功回调,返回图片数据 | ||
| 71 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 72 | + */ | ||
| 73 | +- (void)getImage:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 74 | +- (void)getImage:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 75 | + | ||
| 76 | +@end | ||
| 77 | + | ||
| 78 | + | ||
| 79 | +/** | ||
| 80 | + * 图片消息Elem | ||
| 81 | + */ | ||
| 82 | +@interface TIMImageElem : TIMElem | ||
| 83 | + | ||
| 84 | +/** | ||
| 85 | + * 要发送的图片路径 | ||
| 86 | + */ | ||
| 87 | +@property(nonatomic,strong) NSString * path; | ||
| 88 | + | ||
| 89 | +/** | ||
| 90 | + * 所有类型图片,只读 | ||
| 91 | + */ | ||
| 92 | +@property(nonatomic,strong) NSArray * imageList; | ||
| 93 | + | ||
| 94 | +/** | ||
| 95 | + * 上传时任务Id,可用来查询上传进度 | ||
| 96 | + */ | ||
| 97 | +@property(nonatomic,assign) uint32_t taskId; | ||
| 98 | + | ||
| 99 | +/** | ||
| 100 | + * 图片压缩等级,详见 TIM_IMAGE_COMPRESS_TYPE(仅对jpg格式有效) | ||
| 101 | + */ | ||
| 102 | +@property(nonatomic,assign) TIM_IMAGE_COMPRESS_TYPE level; | ||
| 103 | + | ||
| 104 | +/** | ||
| 105 | + * 图片格式,详见 TIM_IMAGE_FORMAT | ||
| 106 | + */ | ||
| 107 | +@property(nonatomic,assign) TIM_IMAGE_FORMAT format; | ||
| 108 | + | ||
| 109 | +@end | ||
| 110 | + | ||
| 111 | +/** | ||
| 112 | + * 文件消息Elem | ||
| 113 | + */ | ||
| 114 | +@interface TIMFileElem : TIMElem | ||
| 115 | +/** | ||
| 116 | + * 上传时任务Id,可用来查询上传进度 | ||
| 117 | + */ | ||
| 118 | +@property(nonatomic,assign) uint32_t taskId; | ||
| 119 | +/** | ||
| 120 | + * 上传时,文件的路径(设置path时,优先上传文件) | ||
| 121 | + */ | ||
| 122 | +@property(nonatomic,strong) NSString * path; | ||
| 123 | +/** | ||
| 124 | + * 文件内部ID | ||
| 125 | + */ | ||
| 126 | +@property(nonatomic,strong) NSString * uuid; | ||
| 127 | +/** | ||
| 128 | + * 文件大小 | ||
| 129 | + */ | ||
| 130 | +@property(nonatomic,assign) int fileSize; | ||
| 131 | +/** | ||
| 132 | + * 文件显示名,发消息时设置 | ||
| 133 | + */ | ||
| 134 | +@property(nonatomic,strong) NSString * filename; | ||
| 135 | + | ||
| 136 | +/** | ||
| 137 | + * 获取文件数据到指定路径的文件中 | ||
| 138 | + * | ||
| 139 | + * @param path 文件保存路径 | ||
| 140 | + * @param succ 成功回调,返回数据 | ||
| 141 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 142 | + */ | ||
| 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; | ||
| 145 | + | ||
| 146 | +@end | ||
| 147 | + | ||
| 148 | +/** | ||
| 149 | + * 语音消息Elem | ||
| 150 | + */ | ||
| 151 | +@interface TIMSoundElem : TIMElem | ||
| 152 | +/** | ||
| 153 | + * 上传时任务Id,可用来查询上传进度 | ||
| 154 | + */ | ||
| 155 | +@property(nonatomic,assign) uint32_t taskId; | ||
| 156 | +/** | ||
| 157 | + * 上传时,语音文件的路径,接收时使用getSound获得数据 | ||
| 158 | + */ | ||
| 159 | +@property(nonatomic,strong) NSString * path; | ||
| 160 | +/** | ||
| 161 | + * 语音消息内部ID | ||
| 162 | + */ | ||
| 163 | +@property(nonatomic,strong) NSString * uuid; | ||
| 164 | +/** | ||
| 165 | + * 语音数据大小 | ||
| 166 | + */ | ||
| 167 | +@property(nonatomic,assign) int dataSize; | ||
| 168 | +/** | ||
| 169 | + * 语音长度(秒),发送消息时设置 | ||
| 170 | + */ | ||
| 171 | +@property(nonatomic,assign) int second; | ||
| 172 | + | ||
| 173 | +/** | ||
| 174 | + * 获取语音数据到指定路径的文件中 | ||
| 175 | + * | ||
| 176 | + * @param path 语音保存路径 | ||
| 177 | + * @param succ 成功回调 | ||
| 178 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 179 | + */ | ||
| 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; | ||
| 182 | + | ||
| 183 | +@end | ||
| 184 | + | ||
| 185 | +/** | ||
| 186 | + * 地理位置Elem | ||
| 187 | + */ | ||
| 188 | +@interface TIMLocationElem : TIMElem | ||
| 189 | +/** | ||
| 190 | + * 地理位置描述信息,发送消息时设置 | ||
| 191 | + */ | ||
| 192 | +@property(nonatomic,strong) NSString * desc; | ||
| 193 | +/** | ||
| 194 | + * 纬度,发送消息时设置 | ||
| 195 | + */ | ||
| 196 | +@property(nonatomic,assign) double latitude; | ||
| 197 | +/** | ||
| 198 | + * 经度,发送消息时设置 | ||
| 199 | + */ | ||
| 200 | +@property(nonatomic,assign) double longitude; | ||
| 201 | +@end | ||
| 202 | + | ||
| 203 | + | ||
| 204 | +/** | ||
| 205 | + * 自定义消息类型 | ||
| 206 | + */ | ||
| 207 | +@interface TIMCustomElem : TIMElem | ||
| 208 | + | ||
| 209 | +/** | ||
| 210 | + * 自定义消息二进制数据 | ||
| 211 | + */ | ||
| 212 | +@property(nonatomic,strong) NSData * data; | ||
| 213 | +/** | ||
| 214 | + * 自定义消息描述信息,做离线Push时文本展示(已废弃,请使用TIMMessage中offlinePushInfo进行配置) | ||
| 215 | + */ | ||
| 216 | +@property(nonatomic,strong) NSString * desc DEPRECATED_ATTRIBUTE; | ||
| 217 | +/** | ||
| 218 | + * 离线Push时扩展字段信息(已废弃,请使用TIMMessage中offlinePushInfo进行配置) | ||
| 219 | + */ | ||
| 220 | +@property(nonatomic,strong) NSString * ext DEPRECATED_ATTRIBUTE; | ||
| 221 | +/** | ||
| 222 | + * 离线Push时声音字段信息(已废弃,请使用TIMMessage中offlinePushInfo进行配置) | ||
| 223 | + */ | ||
| 224 | +@property(nonatomic,strong) NSString * sound DEPRECATED_ATTRIBUTE; | ||
| 225 | +@end | ||
| 226 | + | ||
| 227 | +/** | ||
| 228 | + * 表情消息类型 | ||
| 229 | + */ | ||
| 230 | +@interface TIMFaceElem : TIMElem | ||
| 231 | + | ||
| 232 | +/** | ||
| 233 | + * 表情索引,用户自定义 | ||
| 234 | + */ | ||
| 235 | +@property(nonatomic, assign) int index; | ||
| 236 | +/** | ||
| 237 | + * 额外数据,用户自定义 | ||
| 238 | + */ | ||
| 239 | +@property(nonatomic,strong) NSData * data; | ||
| 240 | + | ||
| 241 | +@end | ||
| 242 | + | ||
| 243 | +@interface TIMVideo : NSObject | ||
| 244 | +/** | ||
| 245 | + * 视频ID,不用设置 | ||
| 246 | + */ | ||
| 247 | +@property(nonatomic,strong) NSString * uuid; | ||
| 248 | +/** | ||
| 249 | + * 视频文件类型,发送消息时设置 | ||
| 250 | + */ | ||
| 251 | +@property(nonatomic,strong) NSString * type; | ||
| 252 | +/** | ||
| 253 | + * 视频大小,不用设置 | ||
| 254 | + */ | ||
| 255 | +@property(nonatomic,assign) int size; | ||
| 256 | +/** | ||
| 257 | + * 视频时长,发送消息时设置 | ||
| 258 | + */ | ||
| 259 | +@property(nonatomic,assign) int duration; | ||
| 260 | + | ||
| 261 | +/** | ||
| 262 | + * 获取视频 | ||
| 263 | + * | ||
| 264 | + * @param path 视频保存路径 | ||
| 265 | + * @param succ 成功回调 | ||
| 266 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 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 | + | ||
| 273 | +@interface TIMSnapshot : NSObject | ||
| 274 | +/** | ||
| 275 | + * 图片ID,不用设置 | ||
| 276 | + */ | ||
| 277 | +@property(nonatomic,strong) NSString * uuid; | ||
| 278 | +/** | ||
| 279 | + * 截图文件类型,发送消息时设置 | ||
| 280 | + */ | ||
| 281 | +@property(nonatomic,strong) NSString * type; | ||
| 282 | +/** | ||
| 283 | + * 图片大小,不用设置 | ||
| 284 | + */ | ||
| 285 | +@property(nonatomic,assign) int size; | ||
| 286 | +/** | ||
| 287 | + * 图片宽度,发送消息时设置 | ||
| 288 | + */ | ||
| 289 | +@property(nonatomic,assign) int width; | ||
| 290 | +/** | ||
| 291 | + * 图片高度,发送消息时设置 | ||
| 292 | + */ | ||
| 293 | +@property(nonatomic,assign) int height; | ||
| 294 | + | ||
| 295 | +/** | ||
| 296 | + * 获取图片 | ||
| 297 | + * | ||
| 298 | + * @param path 图片保存路径 | ||
| 299 | + * @param succ 成功回调,返回图片数据 | ||
| 300 | + * @param fail 失败回调,返回错误码和错误描述 | ||
| 301 | + */ | ||
| 302 | +- (void)getImage:(NSString*)path succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 303 | +- (void)getImage:(NSString*)path progress:(TIMProgress)progress succ:(TIMSucc)succ fail:(TIMFail)fail; | ||
| 304 | + | ||
| 305 | +@end | ||
| 306 | + | ||
| 307 | +/** | ||
| 308 | + * 微视频消息 | ||
| 309 | + */ | ||
| 310 | +@interface TIMVideoElem : TIMElem | ||
| 311 | + | ||
| 312 | +/** | ||
| 313 | + * 上传时任务Id,可用来查询上传进度 | ||
| 314 | + */ | ||
| 315 | +@property(nonatomic,assign) uint32_t taskId; | ||
| 316 | + | ||
| 317 | +/** | ||
| 318 | + * 视频文件路径,发送消息时设置 | ||
| 319 | + */ | ||
| 320 | +@property(nonatomic,strong) NSString * videoPath; | ||
| 321 | + | ||
| 322 | +/** | ||
| 323 | + * 视频信息,发送消息时设置 | ||
| 324 | + */ | ||
| 325 | +@property(nonatomic,strong) TIMVideo * video; | ||
| 326 | + | ||
| 327 | +/** | ||
| 328 | + * 截图文件路径,发送消息时设置 | ||
| 329 | + */ | ||
| 330 | +@property(nonatomic,strong) NSString * snapshotPath; | ||
| 331 | + | ||
| 332 | +/** | ||
| 333 | + * 视频截图,发送消息时设置 | ||
| 334 | + */ | ||
| 335 | +@property(nonatomic,strong) TIMSnapshot * snapshot; | ||
| 336 | + | ||
| 337 | +@end | ||
| 338 | + | ||
| 339 | +#pragma mark - 群系统消息和tip消息 | ||
| 340 | + | ||
| 341 | +/** | ||
| 342 | + * 群tips,成员变更信息 | ||
| 343 | + */ | ||
| 344 | +@interface TIMGroupTipsElemMemberInfo : NSObject | ||
| 345 | + | ||
| 346 | +/** | ||
| 347 | + * 变更用户 | ||
| 348 | + */ | ||
| 349 | +@property(nonatomic,strong) NSString * identifier; | ||
| 350 | +/** | ||
| 351 | + * 禁言时间(秒,表示还剩多少秒可以发言) | ||
| 352 | + */ | ||
| 353 | +@property(nonatomic,assign) uint32_t shutupTime; | ||
| 354 | + | ||
| 355 | +@end | ||
| 356 | + | ||
| 357 | +/** | ||
| 358 | + * 群tips,群变更信息 | ||
| 359 | + */ | ||
| 360 | +@interface TIMGroupTipsElemGroupInfo : NSObject | ||
| 361 | + | ||
| 362 | +/** | ||
| 363 | + * 变更类型 | ||
| 364 | + */ | ||
| 365 | +@property(nonatomic, assign) TIM_GROUP_INFO_CHANGE_TYPE type; | ||
| 366 | + | ||
| 367 | +/** | ||
| 368 | + * 根据变更类型表示不同含义 | ||
| 369 | + */ | ||
| 370 | +@property(nonatomic,strong) NSString * value; | ||
| 371 | +@end | ||
| 372 | + | ||
| 373 | +/** | ||
| 374 | + * 群Tips | ||
| 375 | + */ | ||
| 376 | +@interface TIMGroupTipsElem : TIMElem | ||
| 377 | + | ||
| 378 | +/** | ||
| 379 | + * 群组Id | ||
| 380 | + */ | ||
| 381 | +@property(nonatomic,strong) NSString * group; | ||
| 382 | + | ||
| 383 | +/** | ||
| 384 | + * 群Tips类型 | ||
| 385 | + */ | ||
| 386 | +@property(nonatomic,assign) TIM_GROUP_TIPS_TYPE type; | ||
| 387 | + | ||
| 388 | +/** | ||
| 389 | + * 操作人用户名 | ||
| 390 | + */ | ||
| 391 | +@property(nonatomic,strong) NSString * opUser; | ||
| 392 | + | ||
| 393 | +/** | ||
| 394 | + * 被操作人列表 NSString* 数组 | ||
| 395 | + */ | ||
| 396 | +@property(nonatomic,strong) NSArray * userList; | ||
| 397 | + | ||
| 398 | +/** | ||
| 399 | + * 在群名变更时表示变更后的群名,否则为 nil | ||
| 400 | + */ | ||
| 401 | +@property(nonatomic,strong) NSString * groupName; | ||
| 402 | + | ||
| 403 | +/** | ||
| 404 | + * 群信息变更: TIM_GROUP_TIPS_TYPE_INFO_CHANGE 时有效,为 TIMGroupTipsElemGroupInfo 结构体列表 | ||
| 405 | + */ | ||
| 406 | +@property(nonatomic,strong) NSArray * groupChangeList; | ||
| 407 | + | ||
| 408 | +/** | ||
| 409 | + * 成员变更: TIM_GROUP_TIPS_TYPE_MEMBER_INFO_CHANGE 时有效,为 TIMGroupTipsElemMemberInfo 结构体列表 | ||
| 410 | + */ | ||
| 411 | +@property(nonatomic,strong) NSArray * memberChangeList; | ||
| 412 | + | ||
| 413 | +/** | ||
| 414 | + * 操作者用户资料 | ||
| 415 | + */ | ||
| 416 | +@property(nonatomic,strong) TIMUserProfile * opUserInfo; | ||
| 417 | +/** | ||
| 418 | + * 操作者群成员资料 | ||
| 419 | + */ | ||
| 420 | +@property(nonatomic,strong) TIMGroupMemberInfo * opGroupMemberInfo; | ||
| 421 | +/** | ||
| 422 | + * 变更成员资料 | ||
| 423 | + */ | ||
| 424 | +@property(nonatomic,strong) NSDictionary * changedUserInfo; | ||
| 425 | +/** | ||
| 426 | + * 变更成员群内资料 | ||
| 427 | + */ | ||
| 428 | +@property(nonatomic,strong) NSDictionary * changedGroupMemberInfo; | ||
| 429 | + | ||
| 430 | +/** | ||
| 431 | + * 当前群人数: TIM_GROUP_TIPS_TYPE_INVITE、TIM_GROUP_TIPS_TYPE_QUIT_GRP、 | ||
| 432 | + * TIM_GROUP_TIPS_TYPE_KICKED时有效 | ||
| 433 | + */ | ||
| 434 | +@property(nonatomic,assign) uint32_t memberNum; | ||
| 435 | + | ||
| 436 | + | ||
| 437 | +/** | ||
| 438 | + * 操作方平台信息 | ||
| 439 | + * 取值: iOS Android Windows Mac Web RESTAPI Unknown | ||
| 440 | + */ | ||
| 441 | +@property(nonatomic,strong) NSString * platform; | ||
| 442 | + | ||
| 443 | +@end | ||
| 444 | + | ||
| 445 | + | ||
| 446 | +/** | ||
| 447 | + * 群系统消息 | ||
| 448 | + */ | ||
| 449 | +@interface TIMGroupSystemElem : TIMElem | ||
| 450 | + | ||
| 451 | +/** | ||
| 452 | + * 操作类型 | ||
| 453 | + */ | ||
| 454 | +@property(nonatomic,assign) TIM_GROUP_SYSTEM_TYPE type; | ||
| 455 | + | ||
| 456 | +/** | ||
| 457 | + * 群组Id | ||
| 458 | + */ | ||
| 459 | +@property(nonatomic,strong) NSString * group; | ||
| 460 | + | ||
| 461 | +/** | ||
| 462 | + * 操作人 | ||
| 463 | + */ | ||
| 464 | +@property(nonatomic,strong) NSString * user; | ||
| 465 | + | ||
| 466 | +/** | ||
| 467 | + * 操作理由 | ||
| 468 | + */ | ||
| 469 | +@property(nonatomic,strong) NSString * msg; | ||
| 470 | + | ||
| 471 | + | ||
| 472 | +/** | ||
| 473 | + * 消息标识,客户端无需关心 | ||
| 474 | + */ | ||
| 475 | +@property(nonatomic,assign) uint64_t msgKey; | ||
| 476 | + | ||
| 477 | +/** | ||
| 478 | + * 消息标识,客户端无需关心 | ||
| 479 | + */ | ||
| 480 | +@property(nonatomic,strong) NSData * authKey; | ||
| 481 | + | ||
| 482 | +/** | ||
| 483 | + * 用户自定义透传消息体(type=TIM_GROUP_SYSTEM_CUSTOM_INFO时有效) | ||
| 484 | + */ | ||
| 485 | +@property(nonatomic,strong) NSData * userData; | ||
| 486 | + | ||
| 487 | +/** | ||
| 488 | + * 操作人资料 | ||
| 489 | + */ | ||
| 490 | +@property(nonatomic,strong) TIMUserProfile * opUserInfo; | ||
| 491 | + | ||
| 492 | +/** | ||
| 493 | + * 操作人群成员资料 | ||
| 494 | + */ | ||
| 495 | +@property(nonatomic,strong) TIMGroupMemberInfo * opGroupMemberInfo; | ||
| 496 | + | ||
| 497 | +/** | ||
| 498 | + * 操作方平台信息 | ||
| 499 | + * 取值: iOS Android Windows Mac Web RESTAPI Unknown | ||
| 500 | + */ | ||
| 501 | +@property(nonatomic,strong) NSString * platform; | ||
| 502 | + | ||
| 503 | +@end | ||
| 504 | + | ||
| 505 | +#pragma mark - 消息体TIMMessage | ||
| 506 | + | ||
| 507 | +/** | ||
| 508 | + 填入sound字段表示接收时不会播放声音 | ||
| 509 | + */ | ||
| 510 | +extern NSString * const kIOSOfflinePushNoSound; | ||
| 511 | + | ||
| 512 | +@interface TIMOfflinePushInfo : NSObject | ||
| 513 | +/** | ||
| 514 | + * 自定义消息描述信息,做离线Push时文本展示 | ||
| 515 | + */ | ||
| 516 | +@property(nonatomic,strong) NSString * desc; | ||
| 517 | +/** | ||
| 518 | + * 离线Push时扩展字段信息 | ||
| 519 | + */ | ||
| 520 | +@property(nonatomic,strong) NSString * ext; | ||
| 521 | +/** | ||
| 522 | + * 推送规则标志 | ||
| 523 | + */ | ||
| 524 | +@property(nonatomic,assign) TIMOfflinePushFlag pushFlag; | ||
| 525 | +/** | ||
| 526 | + * iOS离线推送配置 | ||
| 527 | + */ | ||
| 528 | +@property(nonatomic,strong) TIMIOSOfflinePushConfig * iosConfig; | ||
| 529 | +/** | ||
| 530 | + * Android离线推送配置 | ||
| 531 | + */ | ||
| 532 | +@property(nonatomic,strong) TIMAndroidOfflinePushConfig * androidConfig; | ||
| 533 | +@end | ||
| 534 | + | ||
| 535 | + | ||
| 536 | +/** | ||
| 537 | + * 消息 | ||
| 538 | + */ | ||
| 539 | +@interface TIMMessage : NSObject | ||
| 540 | + | ||
| 541 | +/** | ||
| 542 | + * 增加Elem | ||
| 543 | + * | ||
| 544 | + * @param elem elem结构 | ||
| 545 | + * | ||
| 546 | + * @return 0 表示成功 | ||
| 547 | + * 1 禁止添加Elem(文件或语音多于两个Elem) | ||
| 548 | + * 2 未知Elem | ||
| 549 | + */ | ||
| 550 | +- (int)addElem:(TIMElem*)elem; | ||
| 551 | + | ||
| 552 | +/** | ||
| 553 | + * 获取对应索引的Elem | ||
| 554 | + * | ||
| 555 | + * @param index 对应索引 | ||
| 556 | + * | ||
| 557 | + * @return 返回对应Elem | ||
| 558 | + */ | ||
| 559 | +- (TIMElem*)getElem:(int)index; | ||
| 560 | + | ||
| 561 | +/** | ||
| 562 | + * 获取Elem数量 | ||
| 563 | + * | ||
| 564 | + * @return elem数量 | ||
| 565 | + */ | ||
| 566 | +- (int)elemCount; | ||
| 567 | + | ||
| 568 | +/** | ||
| 569 | + * 设置离线推送配置信息 | ||
| 570 | + * | ||
| 571 | + * @param info 配置信息 | ||
| 572 | + * | ||
| 573 | + * @return 0 成功 | ||
| 574 | + */ | ||
| 575 | +- (int)setOfflinePushInfo:(TIMOfflinePushInfo*)info; | ||
| 576 | + | ||
| 577 | +/** | ||
| 578 | + * 获得本消息离线推送配置信息 | ||
| 579 | + * | ||
| 580 | + * @return 配置信息,没设置返回nil | ||
| 581 | + */ | ||
| 582 | +- (TIMOfflinePushInfo*)getOfflinePushInfo; | ||
| 583 | + | ||
| 584 | +/** | ||
| 585 | + * 设置业务命令字 | ||
| 586 | + * | ||
| 587 | + * @param buzCmds 业务命令字列表 | ||
| 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" 表示不实时下发给用户 | ||
| 592 | + * | ||
| 593 | + * @return 0 成功 | ||
| 594 | + */ | ||
| 595 | +-(int) setBusinessCmd:(NSArray*)buzCmds; | ||
| 596 | + | ||
| 597 | +/** | ||
| 598 | + * 获取会话 | ||
| 599 | + * | ||
| 600 | + * @return 该消息所对应会话 | ||
| 601 | + */ | ||
| 602 | +- (TIMConversation*)getConversation; | ||
| 603 | + | ||
| 604 | +/** | ||
| 605 | + * 消息状态 | ||
| 606 | + * | ||
| 607 | + * @return TIMMessageStatus 消息状态 | ||
| 608 | + */ | ||
| 609 | +- (TIMMessageStatus)status; | ||
| 610 | + | ||
| 611 | +/** | ||
| 612 | + * 是否发送方 | ||
| 613 | + * | ||
| 614 | + * @return TRUE 表示是发送消息 FALSE 表示是接收消息 | ||
| 615 | + */ | ||
| 616 | +- (BOOL)isSelf; | ||
| 617 | + | ||
| 618 | +/** | ||
| 619 | + * 获取发送方 | ||
| 620 | + * | ||
| 621 | + * @return 发送方标识 | ||
| 622 | + */ | ||
| 623 | +- (NSString*)sender; | ||
| 624 | + | ||
| 625 | +/** | ||
| 626 | + * 消息Id | ||
| 627 | + */ | ||
| 628 | +- (NSString*)msgId; | ||
| 629 | + | ||
| 630 | +/** | ||
| 631 | + * 获取消息uniqueId | ||
| 632 | + * | ||
| 633 | + * @return uniqueId | ||
| 634 | + */ | ||
| 635 | +- (uint64_t)uniqueId; | ||
| 636 | + | ||
| 637 | +/** | ||
| 638 | + * 当前消息的时间戳 | ||
| 639 | + * | ||
| 640 | + * @return 时间戳 | ||
| 641 | + */ | ||
| 642 | +- (NSDate*)timestamp; | ||
| 643 | + | ||
| 644 | + | ||
| 645 | +/** | ||
| 646 | + * 获取发送者资料(发送者为自己时可能为空) | ||
| 647 | + * | ||
| 648 | + * @return 发送者资料,nil 表示没有获取资料,目前只有字段:identifier、nickname、faceURL、customInfo | ||
| 649 | + */ | ||
| 650 | +- (TIMUserProfile*)getSenderProfile; | ||
| 651 | + | ||
| 652 | +/** | ||
| 653 | + * 获取发送者群内资料(发送者为自己时可能为空) | ||
| 654 | + * | ||
| 655 | + * @return 发送者群内资料,nil 表示没有获取资料或者不是群消息,目前只有字段:member、nameCard、role、customInfo | ||
| 656 | + */ | ||
| 657 | +- (TIMGroupMemberInfo*)getSenderGroupMemberProfile; | ||
| 658 | + | ||
| 659 | +/** | ||
| 660 | + * 设置消息的优先级 | ||
| 661 | + * | ||
| 662 | + * @param priority 优先级 | ||
| 663 | + * | ||
| 664 | + * @return TRUE 设置成功 | ||
| 665 | + */ | ||
| 666 | +- (BOOL)setPriority:(TIMMessagePriority)priority; | ||
| 667 | + | ||
| 668 | +/** | ||
| 669 | + * 获取消息的优先级 | ||
| 670 | + * | ||
| 671 | + * @return 优先级 | ||
| 672 | + */ | ||
| 673 | +- (TIMMessagePriority)getPriority; | ||
| 674 | + | ||
| 675 | +/** | ||
| 676 | + * 获取消息所属会话的接收消息选项(仅对群组消息有效) | ||
| 677 | + * | ||
| 678 | + * @return 接收消息选项 | ||
| 679 | + */ | ||
| 680 | +- (TIMGroupReceiveMessageOpt)getRecvOpt; | ||
| 681 | + | ||
| 682 | +/** | ||
| 683 | + * 拷贝消息中的属性(ELem、priority、online、offlinePushInfo) | ||
| 684 | + * | ||
| 685 | + * @param srcMsg 源消息 | ||
| 686 | + * | ||
| 687 | + * @return 0 成功 | ||
| 688 | + */ | ||
| 689 | +- (int)copyFrom:(TIMMessage*)srcMsg; | ||
| 690 | + | ||
| 691 | +@end | ||
| 692 | + | ||
| 693 | +#endif |
HHVDoctorSDK/ImSDK.framework/ImSDK
0 → 100755
This file is too large to display.
HHVDoctorSDK/ImSDK.framework/Info.plist
0 → 100755
No preview for this file type
| 1 | +// | ||
| 2 | +// NTESSecurityKit.h | ||
| 3 | +// NTESSecurityKit | ||
| 4 | +// | ||
| 5 | +// Created by NetEase on 17/5/30. | ||
| 6 | +// Copyright © 2017年 NetEase. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | +typedef NS_ENUM(NSInteger, NSSKSecurityError){ | ||
| 12 | + NSSKSecurityInvalidParameterError = 1, // 输入无效参数 | ||
| 13 | + NSSKSecurityBundleIDMismatchError , // Bundle Identifier不匹配 | ||
| 14 | + NSSKSecurityProtocolError , // 数据格式错误 | ||
| 15 | + NSSKSecurityInvalidSeverDataError , // 服务器的数据被篡改 | ||
| 16 | + NSSKSecurityUnkownError , | ||
| 17 | + NSSKSecurityKeyExistError , // 本地数据索引已存在 | ||
| 18 | + NSSKSecurityKeyDoesNotExistError , // 本地数据索引不存在 | ||
| 19 | + NSSKSecurityFileOperationError , // 本地数据文件操作失败 | ||
| 20 | + NSSKSecurityDataEncryptDecryptError , // 数据加解密失败 | ||
| 21 | + NSSKSecurityKeyError , // 密钥错误 | ||
| 22 | + NSSKSecurityOutofValidPeriodError , // 超出使用期错误 | ||
| 23 | + NSSKSecurityWhiteBoxEncryptError , // 白盒加密错误 | ||
| 24 | + NSSKSecurityWhiteBoxDecryptError , // 白盒解密错误 | ||
| 25 | +}; | ||
| 26 | + | ||
| 27 | +@interface NTESSecurityKit : NSObject | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 单例 | ||
| 31 | + * | ||
| 32 | + * @return NTESSecurityKit对象 | ||
| 33 | + */ | ||
| 34 | ++ (NTESSecurityKit *)sharedInstance; | ||
| 35 | + | ||
| 36 | +/** | ||
| 37 | + * 客户端对输入的明文数据进行加密,然后返回密文,这个密文是发送到服务器的 | ||
| 38 | + * | ||
| 39 | + * @param input 需要加密保护的字符串数据 | ||
| 40 | + * @param error 如果加密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 41 | + * | ||
| 42 | + * @return 加密的结果,UTF-8编码 | ||
| 43 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance | ||
| 44 | + */ | ||
| 45 | +- (NSString *)encryptStringToServer:(NSString *)input error:(NSError **)error; | ||
| 46 | + | ||
| 47 | +/** | ||
| 48 | + * 客户端对输入的密文数据(密文来自服务器)进行解密,然后返回明文 | ||
| 49 | + * | ||
| 50 | + * @param input 需要解密还原的字符串数据 | ||
| 51 | + * @param error 如果解密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 52 | + * | ||
| 53 | + * @return 解密的结果,UTF-8编码 | ||
| 54 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; (2)输入参数input是来自服务器返回的加密结果 | ||
| 55 | + */ | ||
| 56 | +- (NSString *)decryptStringFromServer:(NSString *)input error:(NSError **)error; | ||
| 57 | + | ||
| 58 | +/** | ||
| 59 | + * 客户端对输入的Binary数据进行加密,然后返回密文,该密文用于发送至服务端 | ||
| 60 | + * | ||
| 61 | + * @param input 需要加密保护的Binary数据 | ||
| 62 | + * @param error 如果加密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 63 | + | ||
| 64 | + * @return 加密的结果,UTF-8编码 | ||
| 65 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance | ||
| 66 | + */ | ||
| 67 | +- (NSString *)encryptBinaryToServer:(NSData *)input error:(NSError **)error; | ||
| 68 | + | ||
| 69 | +/** | ||
| 70 | + * 客户端对输入的密文数据(密文来自服务器)进行解密,然后返回解密后的Binary | ||
| 71 | + * | ||
| 72 | + * @param input 需要解密还原的字符串数据 | ||
| 73 | + * @param error 如果解密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 74 | + * | ||
| 75 | + * @return 解密的结果,Binary数据 | ||
| 76 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; (2)输入参数input是来自服务器返回的加密结果 | ||
| 77 | + */ | ||
| 78 | +- (NSData *)decryptBinaryFromServer:(NSString *)input error:(NSError **)error; | ||
| 79 | + | ||
| 80 | +/** | ||
| 81 | + * SDK将需要加密存储的字符串进行加密,并存储在本地 | ||
| 82 | + * | ||
| 83 | + * @param input 需要加密存储的字符串 | ||
| 84 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 85 | + * @param error 如果加密或存储出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回NO | ||
| 86 | + * | ||
| 87 | + * @return 加密存储是否成功,成功返回YES,失败返回NO | ||
| 88 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 89 | + */ | ||
| 90 | +- (BOOL)putString:(NSString *)input key:(NSString *)key error:(NSError **)error; | ||
| 91 | + | ||
| 92 | +/** | ||
| 93 | + * 取出存储在本地的字符串,返回解密后的明文 | ||
| 94 | + * | ||
| 95 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 96 | + * @param error 如果取出本地存储的数据出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回nil | ||
| 97 | + * | ||
| 98 | + * @return 本地存储的对应于key的数据,数据将被解密,返回解密后的明文 | ||
| 99 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 100 | + */ | ||
| 101 | +- (NSString *)getString:(NSString *)key error:(NSError **)error; | ||
| 102 | + | ||
| 103 | +/** | ||
| 104 | + * 更新本地存储的字符串数据 | ||
| 105 | + * | ||
| 106 | + * @param input 更新的字符串 | ||
| 107 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 108 | + * @param error 如果加密或存储出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回NO | ||
| 109 | + * | ||
| 110 | + * @return 加密存储是否成功,成功返回YES,失败返回NO | ||
| 111 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 112 | + */ | ||
| 113 | +- (BOOL)updateString:(NSString *)input key:(NSString *)key error:(NSError **)error; | ||
| 114 | +/** | ||
| 115 | + * 删除存储在本地的字符串 | ||
| 116 | + * | ||
| 117 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 118 | + * @param error 如果删除本地存储的数据出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回NO | ||
| 119 | + * | ||
| 120 | + * @return 删除本地存储的数据是否成功,成功返回YES,失败返回NO | ||
| 121 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 122 | + */ | ||
| 123 | +- (BOOL)removeString:(NSString *)key error:(NSError **)error; | ||
| 124 | + | ||
| 125 | +/** | ||
| 126 | + * SDK将需要加密存储的Binary进行加密,并存储在本地 | ||
| 127 | + * | ||
| 128 | + * @param input 需要加密存储的Binary | ||
| 129 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 130 | + * @param error 如果加密或存储出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回NO | ||
| 131 | + * | ||
| 132 | + * @return 加密存储是否成功,成功返回YES,失败返回NO | ||
| 133 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 134 | + */ | ||
| 135 | +- (BOOL)putBinary:(NSData *)input key:(NSString *)key error:(NSError **)error; | ||
| 136 | + | ||
| 137 | +/** | ||
| 138 | + * 取出存储在本地的Binary数据,返回解密后的明文 | ||
| 139 | + * | ||
| 140 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 141 | + * @param error 如果取出本地存储的数据出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回nil | ||
| 142 | + * | ||
| 143 | + * @return 本地存储的对应于key的数据,数据将被解密,返回解密后的明文 | ||
| 144 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 145 | + */ | ||
| 146 | +- (NSData *)getBinary:(NSString *)key error:(NSError **)error; | ||
| 147 | + | ||
| 148 | +/** | ||
| 149 | + * 更新本地存储的Binary数据 | ||
| 150 | + * | ||
| 151 | + * @param input 更新的Binary | ||
| 152 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 153 | + * @param error 如果加密或存储出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回NO | ||
| 154 | + * | ||
| 155 | + * @return 加密存储是否成功,成功返回YES,失败返回NO | ||
| 156 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 157 | + */ | ||
| 158 | +- (BOOL)updateBinary:(NSData *)input key:(NSString *)key error:(NSError **)error; | ||
| 159 | +/** | ||
| 160 | + * 删除存储在本地的Binary数据 | ||
| 161 | + * | ||
| 162 | + * @param key 用户自定义的key,用于索引本地数据 | ||
| 163 | + * @param error 如果删除本地存储的数据出现错误,error将会被设置,error的code对应 NSSKSecurityError;接口返回NO | ||
| 164 | + * | ||
| 165 | + * @return 删除本地存储的数据是否成功,成功返回YES,失败返回NO | ||
| 166 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 167 | + */ | ||
| 168 | +- (BOOL)removeBinary:(NSString *)key error:(NSError **)error; | ||
| 169 | + | ||
| 170 | +/** | ||
| 171 | + * SDK将明文白盒加密,返回密文 | ||
| 172 | + * @param input 需要加密保护的字符串数据 | ||
| 173 | + * @param error 如果加密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil | ||
| 174 | + * | ||
| 175 | + * @return 加密的结果 | ||
| 176 | +* @说明 (1)在调用该接口前,确定已调用 sharedInstance | ||
| 177 | + */ | ||
| 178 | +- (NSString *)getWBEncryptString:(NSString *)input error:(NSError **)error; | ||
| 179 | + | ||
| 180 | +/** | ||
| 181 | + * SDK将白盒加密的密文,通过白盒解密,返回解密后的明文 | ||
| 182 | + * | ||
| 183 | + * @param input 需要解密还原的字符串数据 | ||
| 184 | + * @param error 如果解密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 185 | + * | ||
| 186 | + * @return 解密的结果 | ||
| 187 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; | ||
| 188 | + */ | ||
| 189 | +- (NSString *)getWBDecryptString:(NSString *)input error:(NSError **)error; | ||
| 190 | + | ||
| 191 | +/** | ||
| 192 | + * 客户端对输入的Binary数据进行白盒加密,返回白盒密文 | ||
| 193 | + * | ||
| 194 | + * @param input 需要加密保护的Binary数据 | ||
| 195 | + * @param error 如果加密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 196 | + | ||
| 197 | + * @return 加密的结果 | ||
| 198 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance | ||
| 199 | + */ | ||
| 200 | +- (NSString *)getWBEncryptBinary:(NSData *)input error:(NSError **)error; | ||
| 201 | + | ||
| 202 | +/** | ||
| 203 | + * 客户端对输入的白盒密文进行解密,然后返回解密后的Binary | ||
| 204 | + * | ||
| 205 | + * @param input 需要解密还原的字符串数据 | ||
| 206 | + * @param error 如果解密出现错误,error会被设置, error的code对应 NSSKSecurityError;接口返回值为nil。 | ||
| 207 | + * | ||
| 208 | + * @return 解密的结果,Binary数据 | ||
| 209 | + * @说明 (1)在调用该接口前,确定已调用 sharedInstance; (2)输入参数input是来自服务器返回的加密结果 | ||
| 210 | + */ | ||
| 211 | +- (NSData *)getWBDecryptBinary:(NSString *)input error:(NSError **)error; | ||
| 212 | + | ||
| 213 | +/* 查看SDK的版本号 | ||
| 214 | + * | ||
| 215 | + * @return SDK的版本信息 | ||
| 216 | + */ | ||
| 217 | +- (NSString *)sdkVersion; | ||
| 218 | + | ||
| 219 | +/* 判断设备是否越狱 | ||
| 220 | + * | ||
| 221 | + * @return, BOOL YES:越狱;NO:非越狱 | ||
| 222 | + */ | ||
| 223 | +- (BOOL)isJailbreak; | ||
| 224 | + | ||
| 225 | +@end |
No preview for this file type
No preview for this file type
| 1 | +// | ||
| 2 | +// TXAudioCustomProcessDelegate.h | ||
| 3 | +// TXLiteAVSDK | ||
| 4 | +// | ||
| 5 | +// Created by realingzhou on 2018/1/15. | ||
| 6 | +// Copyright © 2018年 Tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TXAudioCustomProcessDelegate_h | ||
| 10 | +#define TXAudioCustomProcessDelegate_h | ||
| 11 | +#import <Foundation/Foundation.h> | ||
| 12 | + | ||
| 13 | +@protocol TXAudioCustomProcessDelegate <NSObject> | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 原始声音的回调 | ||
| 17 | + * @prarm data pcm数据 | ||
| 18 | + * @prarm timeStamp 时间戳 | ||
| 19 | + * @prarm sampleRate 采样率 | ||
| 20 | + * @prarm channels 声道数 | ||
| 21 | + * @prarm withBgm 回调的数据是否包含bgm,当不开启回声消除时,回调的raw pcm会包含bgm | ||
| 22 | + */ | ||
| 23 | +@optional | ||
| 24 | +- (void)onRecordRawPcmData:(NSData *)data timeStamp:(unsigned long long)timeStamp sampleRate:(int)sampleRate channels:(int)channels withBgm:(BOOL)withBgm; | ||
| 25 | + | ||
| 26 | +/** | ||
| 27 | + * 经过特效处理的声音回调 | ||
| 28 | + * @prarm data pcm数据 | ||
| 29 | + * @prarm timeStamp 时间戳 | ||
| 30 | + * @prarm sampleRate 采样率 | ||
| 31 | + * @prarm channels 声道数 | ||
| 32 | + */ | ||
| 33 | +@optional | ||
| 34 | +- (void)onRecordPcmData:(NSData *)data timeStamp:(unsigned long long)timeStamp sampleRate:(int)sampleRate channels:(int)channels; | ||
| 35 | + | ||
| 36 | +@end | ||
| 37 | + | ||
| 38 | +#endif /* TXAudioCustomProcessDelegate_h */ |
| 1 | +// | ||
| 2 | +// TXAudioRawDataDelegate.h | ||
| 3 | +// TXLiteAVSDK | ||
| 4 | +// | ||
| 5 | +// Created by realingzhou on 2018/2/24. | ||
| 6 | +// Copyright © 2018年 Tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TXAudioRawDataDelegate_h | ||
| 10 | +#define TXAudioRawDataDelegate_h | ||
| 11 | + | ||
| 12 | +@protocol TXAudioRawDataDelegate <NSObject> | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 音频播放信息回调 | ||
| 16 | + * | ||
| 17 | + * @param sampleRate 采样率 | ||
| 18 | + * @param channels 声道数 | ||
| 19 | + */ | ||
| 20 | +@optional | ||
| 21 | +- (void)onAudioInfoChanged:(int)sampleRate channels:(int)channels; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * 音频播放数据回调,数据格式 :PCM | ||
| 25 | + * | ||
| 26 | + * <!!!注意!!!> 该函数内不要做耗时操作<!!!注意!!!> | ||
| 27 | + * 音频播放器会在播放数据的前一刻,调用此函数,同步回调将要播放的数据。因此在函数内部做耗时操作可能会影响播放 | ||
| 28 | + * | ||
| 29 | + * | ||
| 30 | + * @param data pcm数据 | ||
| 31 | + * @param timestamp 时间戳。注 :会有连续相同的时间戳回调出来,超过2048字节,时间戳才会变化。 | ||
| 32 | + */ | ||
| 33 | +@optional | ||
| 34 | +- (void)onPcmDataAvailable:(NSData *)data pts:(unsigned long long)timestamp; | ||
| 35 | + | ||
| 36 | +@end | ||
| 37 | + | ||
| 38 | +#endif /* TXAudioRawDataDelegate_h */ |
| 1 | +// | ||
| 2 | +// TXBitrateItem.h | ||
| 3 | +// TXLiteAVSDK | ||
| 4 | +// | ||
| 5 | +// Created by annidyfeng on 2017/11/15. | ||
| 6 | +// Copyright © 2017年 Tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef TXBitrateItem_h | ||
| 10 | +#define TXBitrateItem_h | ||
| 11 | + | ||
| 12 | +/// HLS多码率信息 | ||
| 13 | +@interface TXBitrateItem : NSObject | ||
| 14 | +@property (nonatomic, assign) NSInteger index; /// m3u8文件中的序号 | ||
| 15 | +@property (nonatomic, assign) NSInteger width; /// 此流的视频宽度 | ||
| 16 | +@property (nonatomic, assign) NSInteger height; /// 此流的视频高度 | ||
| 17 | +@property (nonatomic, assign) NSInteger bitrate; /// 此流的视频码率 | ||
| 18 | +@end | ||
| 19 | +#endif /* TXBitrateItem_h */ |
| 1 | +// | ||
| 2 | +// TXImageSprite.h | ||
| 3 | +// TXLiteAVSDK | ||
| 4 | +// | ||
| 5 | +// Created by annidyfeng on 2018/8/23. | ||
| 6 | +// Copyright © 2018年 Tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <Foundation/Foundation.h> | ||
| 10 | +#import <UIKit/UIKit.h> | ||
| 11 | + | ||
| 12 | +/// 雪碧图解析工具 | ||
| 13 | +@interface TXImageSprite : NSObject | ||
| 14 | +/** | ||
| 15 | + * 设置雪碧图地址 | ||
| 16 | + * @param vttUrl VTT链接 | ||
| 17 | + * @param images 雪碧图大图列表 | ||
| 18 | + */ | ||
| 19 | +- (void)setVTTUrl:(NSURL *)vttUrl imageUrls:(NSArray<NSURL *> *)images; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * 获取缩略图 | ||
| 23 | + * @param time 时间点,单位秒 | ||
| 24 | + * @return 获取失败返回nil | ||
| 25 | + */ | ||
| 26 | +- (UIImage *)getThumbnail:(GLfloat)time; | ||
| 27 | +@end |
| 1 | +// | ||
| 2 | +// TXLiteAVSDK.h | ||
| 3 | +// TXLiteAVSDK | ||
| 4 | +// | ||
| 5 | +// Created by alderzhang on 2017/6/9. | ||
| 6 | +// Copyright © 2017年 Tencent. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +#import <TXLiteAVSDK_Smart/TXAudioCustomProcessDelegate.h> | ||
| 12 | +#import <TXLiteAVSDK_Smart/TXAudioRawDataDelegate.h> | ||
| 13 | +#import <TXLiteAVSDK_Smart/TXBitrateItem.h> | ||
| 14 | +#import <TXLiteAVSDK_Smart/TXImageSprite.h> | ||
| 15 | +#import <TXLiteAVSDK_Smart/TXLiveAudioSessionDelegate.h> | ||
| 16 | +#import <TXLiteAVSDK_Smart/TXLiveBase.h> | ||
| 17 | +#import <TXLiteAVSDK_Smart/TXLivePlayConfig.h> | ||
| 18 | +#import <TXLiteAVSDK_Smart/TXLivePlayListener.h> | ||
| 19 | +#import <TXLiteAVSDK_Smart/TXLivePlayer.h> | ||
| 20 | +#import <TXLiteAVSDK_Smart/TXLivePush.h> | ||
| 21 | +#import <TXLiteAVSDK_Smart/TXLivePushConfig.h> | ||
| 22 | +#import <TXLiteAVSDK_Smart/TXLivePushListener.h> | ||
| 23 | +#import <TXLiteAVSDK_Smart/TXLiveRecordListener.h> | ||
| 24 | +#import <TXLiteAVSDK_Smart/TXLiveRecordTypeDef.h> | ||
| 25 | +#import <TXLiteAVSDK_Smart/TXLiveSDKEventDef.h> | ||
| 26 | +#import <TXLiteAVSDK_Smart/TXLiveSDKTypeDef.h> | ||
| 27 | +#import <TXLiteAVSDK_Smart/TXPlayerAuthParams.h> | ||
| 28 | +#import <TXLiteAVSDK_Smart/TXVideoCustomProcessDelegate.h> | ||
| 29 | +#import <TXLiteAVSDK_Smart/TXVodPlayConfig.h> | ||
| 30 | +#import <TXLiteAVSDK_Smart/TXVodPlayListener.h> | ||
| 31 | +#import <TXLiteAVSDK_Smart/TXVodPlayer.h> |
| 1 | +#ifndef TXLiveAudioSessionDelegate_h | ||
| 2 | +#define TXLiveAudioSessionDelegate_h | ||
| 3 | + | ||
| 4 | +#import <AVFoundation/AVFoundation.h> | ||
| 5 | + | ||
| 6 | +@protocol TXLiveAudioSessionDelegate <NSObject> | ||
| 7 | + | ||
| 8 | +@optional | ||
| 9 | +- (BOOL)setActive:(BOOL)active error:(NSError **)outError; | ||
| 10 | + | ||
| 11 | +@optional | ||
| 12 | +- (BOOL)setMode:(NSString *)mode error:(NSError **)outError; | ||
| 13 | + | ||
| 14 | +@optional | ||
| 15 | +- (BOOL)setCategory:(NSString *)category error:(NSError **)outError; | ||
| 16 | + | ||
| 17 | +@optional | ||
| 18 | +- (BOOL)setCategory:(NSString *)category withOptions:(AVAudioSessionCategoryOptions)options error:(NSError **)outError; | ||
| 19 | + | ||
| 20 | +@optional | ||
| 21 | +- (BOOL)setCategory:(NSString *)category mode:(NSString *)mode options:(AVAudioSessionCategoryOptions)options error:(NSError **)outError; | ||
| 22 | + | ||
| 23 | +@optional | ||
| 24 | +- (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError **)outError; | ||
| 25 | + | ||
| 26 | +@optional | ||
| 27 | +- (BOOL)setPreferredSampleRate:(double)sampleRate error:(NSError **)outError; | ||
| 28 | + | ||
| 29 | +@optional | ||
| 30 | +- (BOOL)overrideOutputAudioPort:(AVAudioSessionPortOverride)portOverride error:(NSError **)outError; | ||
| 31 | + | ||
| 32 | +@end | ||
| 33 | +#endif /* TXLiveAudioSessionDelegate_h */ |
-
Please register or login to post a comment