Skip to content

QIMSDK iOS接口文档说明

Lidalu edited this page Oct 17, 2019 · 6 revisions

QIMSDK iOS接口文档说明

QIMSDKHelper+UI.h UI接口说明

//SDK中初始化UI栈,务必初始化
- (void)initWithRootNav:(UINavigationController *)rootNav WithRootVc:(UIViewController *)rootVc;

//获取消息列表View
- (UIView *)getQIMSessionListViewWithBaseFrame:(CGRect)frame;

//发送email给用户
- (void)sendMailWithRootVc:(UIViewController *)rootVc ByUserId:(NSString *)userId;

//获取单人个人信息VC -> scheme : "/openSingleChatInfo"
- (UIViewController *)getUserChatInfoByUserId:(NSString *)userId;

//打开用户的个人信息页面
+ (void)openUserChatInfoByUserId:(NSString *)userId;

//获取单人名片VC -> scheme : "/openUserCard"
- (UIViewController *)getUserCardVCByUserId:(NSString *)userId;

//打开用户的名片页面
+ (void)openUserCardVCByUserId:(NSString *)userId;

//获取群名片VC -> scheme : "/openGroupChatInfo"
- (UIViewController *)getQIMGroupCardVCByGroupId:(NSString *)groupId;

//打开群名片
+ (void)openQIMGroupCardVCByGroupId:(NSString *)groupId;

//获取Consult会话VC
- (UIViewController *)getConsultChatByChatType:(NSInteger)chatType UserId:(NSString *)userId WithVirtualId:(NSString *)virtualId;

//打开Consult会话
+ (void)openConsultChatByChatType:(NSInteger)chatType UserId:(NSString *)userId WithVirtualId:(NSString *)virtualId;

//获取单人会话VC -> scheme : "/openSingleChat"
- (UIViewController *)getSingleChatVCByUserId:(NSString *)userId;

//打开单人聊天对话框
+ (void)openSingleChatVCByUserId:(NSString *)userId;

//获取群会话VC -> scheme : "/openGroupChat"
- (UIViewController *)getGroupChatVCByGroupId:(NSString *)groupId;

//打开群组聊天对话框
+ (void)openGroupChatVCByGroupId:(NSString *)groupId;

//获取HeadLine系统消息会话VC -> scheme : "/headLine"
- (UIViewController *)getHeaderLineVCByJid:(NSString *)jid;

//打开Headline对话框
+ (void)openHeaderLineVCByJid:(NSString *)jid;

//获取RNVC -> scheme : "rnservice", 参数来自scheme
- (UIViewController *)getVCWithNavigation:(UINavigationController *)navVC
                            WithHiddenNav:(BOOL)hiddenNav
                               WithModule:(NSString *)module
                           WithProperties:(NSDictionary *)properties;
+ (void)openQIMRNVCWithModuleName:(NSString *)moduleName WithProperties:(NSDictionary *)properties;

//获取机器人名片VC
- (UIViewController *)getRobotCard:(NSString *)robotJid;

//打开机器人名片
+ (void)openRobotCard:(NSString *)robotJId;

//打开WebView,使用html片段
+ (void)openWebViewWithHtmlStr:(NSString *)htmlStr showNavBar:(BOOL)showNavBar;

//打开WebView
+ (void)openWebViewForUrl:(NSString *)url showNavBar:(BOOL)showNavBar;

//获取RN搜索VC -> scheme : "rnsearch"
- (UIViewController *)getRNSearchVC;

//打开RN搜索VC
+ (void)openRNSearchVC;

//获取我的好友列表VC
- (UIViewController *)getUserFriendsVC;

//打开我的好友列表
+ (void)openUserFriendsVC;

//获取我的群组列表VC
- (UIViewController *)getQIMGroupListVC;

//打开我的群组列表
+ (void)openQIMGroupListVC;

//获取未读消息列表VC -> scheme : "/unreadList"
- (UIViewController *)getNotReadMessageVC;

//打开未读消息列表
+ (void)openNotReadMessageVC;

// scheme : "/publicNumber"
- (UIViewController *)getQIMPublicNumberVC;

//打开公众号
+ (void)openQIMPublicNumberVC;

//获取我的文件VC -> scheme : "/myfile"
- (UIViewController *)getMyFileVC;

//打开我的文件
+ (void)openMyFileVC;

//获取组织架构VC -> scheme : "/openOrganizational"
- (UIViewController *)getOrganizationalVC;

//打开组织架构
+ (void)openOrganizationalVC;

+ (void)openQRCodeVC;

- (UIViewController *)getRobotChatVC:(NSString *)robotJid;
+ (void)openRobotChatVC:(NSString *)robotJid;

- (UIViewController *)getQTalkNotesVC;
+ (void)openQTalkNotesVC;

//获取我的红包VC -> scheme : "/hongbao"
- (UIViewController *)getMyRedPack;

//获取余额查询VC -> scheme : "/hongbao_balance"
- (UIViewController *)getMyRedPackageBalance;


+ (void)openTransferConversation:(NSString *)shopId withVistorId:(NSString *)realJid;

+ (void)openMyAccountInfo;

- (UIViewController *)getQRCodeWithUserId:(NSString *)userId withName:(NSString *)name withType:(NSInteger)qrcodeType;

+ (void)showQRCodeWithUserId:(NSString *)userId withName:(NSString *)name withType:(NSInteger)qrcodeType;

//退出登录-> scheme : logout
+ (void)signOut;

QIMKit 接口说明

//认证
/**
 UK,登录之后服务器下发下来,用作旧接口的验证
 */
- (NSString *)remoteKey;

/**
 get remote key
 
 @return 返回remote key
 */
- (NSString *)myRemotelogginKey;


/**
 第三方认证的key - Ckey/q_ckey
 
 @return 返回Base64后的Key
 */
- (NSString *) thirdpartKeywithValue;


/**
 手动设置客服状态

 @param isMerchant 客服状态
 */
- (void)setIsMerchant:(BOOL)isMerchant;

/**
 客服状态
 */
- (BOOL)isMerchant;

/**
 *  UserName Ex: san.zhang
 *
 *  @return UserName
 */
+ (NSString *)getLastUserName;

/**
 *  PWD
 *
 *  @return 无用
 */
- (NSString *)getLastPassword;

/**
 *  JID  Ex: san.zhang@ejabhost1
 *
 *  @return JID
 */
- (NSString *)getLastJid;

/**
 *  nickName  Ex: 
 *
 *  @return MyNickName
 */
- (NSString *)getMyNickName;

/**
 获取当前登录的domain
 */
- (NSString *)getDomain;
	
- (long long)getCurrentServerTime;


- (int)getServerTimeDiff;

- (NSHTTPCookie *)cookie;

// 更新导航配置
- (void)updateNavigationConfig;

- (void)checkClientConfig;

/**
 获取trdExtendInfo
 
 @return 返回trdExtendInfo
 */
- (NSArray *)trdExtendInfo;

/**
 获取AA收款URL

 @return 返回aaCollectionUrlHost
 */
- (NSString *)aaCollectionUrlHost;

/**
 获取红包URL

 @return 返回redPackageUrlHost
 */
- (NSString *)redPackageUrlHost;

/**
 获取余额URL

 @return 返回redPackageBalanceUrl
 */
- (NSString *)redPackageBalanceUrl;

/**
 获取我的红包URL

 @return 返回myRedpackageUrl
 */
- (NSString *)myRedpackageUrl;

/**
 新消息通知?
 
 @return bool值
 */
- (BOOL)isNewMsgNotify;

/**
 设置新消息通知?
 
 @param flag bool值
 */
- (void)setNewMsgNotify:(BOOL)flag;
//相册是否发送原图
- (BOOL)pickerPixelOriginal;

- (void)setPickerPixelOriginal:(BOOL)flag;

//是否优先展示对方个性签名
- (BOOL)moodshow;

/**
 设置 mood show
 
 @param flag bool值
 */
- (void)setMoodshow:(BOOL)flag;

/**
 获取At me的
 
 @param jid 会话id
 @return 返回结果
 */
- (NSArray *)getHasAtMeByJid:(NSString *)jid ;

- (void)addAtMeByJid:(NSString *)jid WithNickName:(NSString *)nickName;

- (void)removeAtMeByJid:(NSString *)jid;

- (void)addAtALLByJid:(NSString *)jid WithMsgId:(NSString *)msgId WihtMsg:(Message *)message WithNickName:(NSString *)nickName;

/**
 移除atall
 
 @param jid 用户id
 */
- (void)removeAtAllByJid:(NSString *)jid;

/**
 获取atall
 
 @param jid user id
 @return 返回atall信息
 */
- (NSDictionary *)getAtAllInfoByJid:(NSString *)jid;

- (NSDictionary *)getNotSendTextByJid:(NSString *)jid ;

- (void)setNotSendText:(NSString *)text inputItems:(NSArray *)inputItems ForJid:(NSString *)jid;

/**
 qchat获取token
 
 @return 返回token
 */
- (NSDictionary *)getQChatToken;

- (NSDictionary *)getQVTForQChat;

- (void)removeQVTForQChat;

- (NSString *)getDownloadFilePath;

/**
 清空缓存
 */
- (void)clearcache;

/**
 置顶/ 移除置顶
 
 @param jid 需要置顶的jid
 */
- (BOOL)setStickWithJid:(NSString *)jid;


/**
 置顶/ 移除置顶
 
 @param jid 需要置顶的jid
 @param chatType 会话类型
 */
- (void)removeStickWithJid:(NSString *)jid WithChatType:(ChatType)chatType;

/**
 是否已置顶
 
 @param jid session id
 @return 返回判定结果
 */
- (BOOL)isStickWithJid:(NSString *)jid;

/**
 获取置顶列表
 
 @return 置顶的会话列表
 */
- (NSDictionary *)stickList;

- (BOOL)setMsgNotifySettingWithIndex:(QIMMSGSETTING)setting WithSwitchOn:(BOOL)switchOn;

- (BOOL)getLocalMsgNotifySettingWithIndex:(QIMMSGSETTING)setting;

- (void)getMsgNotifyRemoteSettings;

/**
 关闭通知
 */
- (void)sendNoPush;


/**
 上传推送Token到服务器

 @param notificationToken 注册的通知Token
 @param username 用户名
 @param paramU 用户ming
 @param paramK 用户验证的key
 @param deleteFlag 是否删除服务器推送Token
 @return 上传是否成功
 */
- (BOOL)sendServer:(NSString *)notificationToken withUsername:(NSString *)username withParamU:(NSString *)paramU withParamK:(NSString *)paramK WithDelete:(BOOL)deleteFlag;

/**
 发送push Token

 @param myToken 注册的通知token
 @param deleteFlag 是否删除
 */
- (BOOL)sendPushTokenWithMyToken:(NSString *)myToken WithDeleteFlag:(BOOL)deleteFlag;

- (void)checkClearCache;

QIMKit+QIMLogin.h -> 登录

/**
 设置是否为后台登录
 */
- (void)setIsBackgroundLogin:(BOOL)isBackgroundLogin;

/**
 是否为后台登录 (YES为后台重新登录,NO为前台人工登录)
 */
- (BOOL)isBackgroundLogin;

/**
 设置取消登录状态
 */
- (void)setWillCancelLogin:(BOOL)willCancelLogin;

/**
 获取取消登录状态
 */
- (BOOL)willCancelLogin;

/**
 设置登录重试
 */
- (void)setNeedTryRelogin:(BOOL)needTryRelogin;

/**
 获取登录重试
 */
- (BOOL)needTryRelogin;

/**
 获取当前登录状态
 */
- (BOOL)isLogin;

/**
 缓存用户登录

 @param userName 用户名称
 @param pwd 用户密码
 @param navDict 用户导航信息缓存
 */
- (void)loginWithUserName:(NSString *)userName WithPassWord:(NSString *)pwd WithLoginNavDict:(NSDictionary *)navDict;
- (void)addUserCacheWithUserId:(NSString *)userId WithUserFullJid:(NSString *)userFullJid WithNavDict:(NSDictionary *)navDict;

/**
 用户登录

 @param userName 用户名
 @param pwd 用户密码
 */
- (void)loginWithUserName:(NSString *)userName WithPassWord:(NSString *)pwd;


/**
 获取本地已缓存用户列表
 */
- (NSArray *)getLoginUsers;


/**
 清空KeyChain中用户缓存信息
 */
- (void)clearLogginUser;

/**
 save 用户名 and 密码
 
 @param userName 用户名
 @param pwd 密码
 */
- (void)saveUserInfoWithName:(NSString *)userName passWord:(NSString *)pwd;

/**
 退出登录
 */
- (void)quitLogin;

/**
 前台登录
 */
- (BOOL)forgelogin;

/**
 重新登录
 */
- (void)relogin;

/**
 取消登录
 */
- (void)cancelLogin;

/**
 QChat rsa登录
 
 @param userId 用户id
 @param password rsa密码
 @param type 用户名的类型,值为:@"username"、@"email"、@"mobile"
 @return 返回结果
 */
- (NSDictionary *)QChatLoginWithUserId:(NSString *)userId rsaPassword:(NSString *)password type:(NSString *)type;

- (NSString *)getFormStringByDiction:(NSDictionary *)diction;

QIMKit+QIMAppInfo.h -> App信息

+ (void)setQIMProjectType:(QIMProjectType)appType;
    
+ (QIMProjectType)getQIMProjectType;

/**
 获取推送的Token

 @return PushToken
 */
- (NSString *)getPushToken;

/**
 设置推送的Token

 @param pushToken pushToken
 */
- (void)setPushToken:(NSString *)pushToken;

/**
 网卡地址
 */
- (NSString *)macAddress;

/**
 终端
 */
- (NSString *)Platform;

/**
 设备名称
 */
- (NSString *)deviceName;

/**
 机器码(唯一标识)
 */
- (NSString *)appAID;

/**
 判断是不是iPad
 */
- (BOOL)getIsIpad;

/**
 系统版本
 */
- (NSString *)SystemVersion;

/**
 运营商
 */
- (NSString *)carrierName;

/**
 App版本号
 */
- (NSString *)AppVersion;

/**
 App Build版本号
 */
- (NSString *)AppBuildVersion;

QIMKit+QIMAppSetting.h App环境配置 /** 判断是否为第一次安装 */ - (BOOL)isFirstLauched;

/**
 设置当前App环境配置
 */
+ (void)setAppConfigurationMode:(QIMAppConfigurationMode)mode;


/**
 获取当前App环境配置
 */
+ (QIMAppConfigurationMode)getCurrentAppConfigurationMode;

/**
 判断是否为Debug模式
 */
- (BOOL)debugMode;

/**
 获取当前系统语言
 */
- (NSString *)currentLanguage;

/**
 设置高德地图的Key
 */
- (void)setGAODE_APIKEY:(NSString *)key;

/**
 获取高德地图的Key
 */
- (NSString *)GAODE_APIKEY;

QIMKit+QIMCollection.h -> 代收账号

- (NSString *)getCollectionUserHeaderUrlWithXmppId:(NSString *)userId;

/**
 获取代收账号名片信息

 @param myId 用户Id
 @return 代收账号名片信息
 */
- (NSDictionary *)getCollectionUserInfoByUserId:(NSString *)myId;

- (void)updateCollectionUserCardByUserIds:(NSArray *)userIds;

/**
 获取已代收账号列表
 
 @return 已代收账号列表
 */
- (NSArray *)getMyCollectionAccountList;

/**
 http接口获取我的绑定账号列表
 */
- (void)getRemoteCollectionAccountList;


#pragma mark - 代收Group

/**
 根据群Id获取群名片信息

 @param groupId 群Id
 @return 群名片信息
 */
- (NSDictionary *)getCollectionGroupCardByGroupId:(NSString *)groupId;

/**
 主动根据群Id更新群名片信息

 @param groupId 群Id
 */
- (void)updateCollectionGroupCardByGroupId:(NSString *)groupId;


- (NSString *)getCollectionGroupHeaderUrlWithCollectionGroupId:(NSString *)groupId;


#pragma mark - 代收Message

/**
 根据绑定账号BindId获取该账号下的消息列表

 @param bindId 绑定账号BindId
 */
- (NSArray *)getCollectionSessionListWithBindId:(NSString *)bindId;

/**
 根据MsgId获取代收消息
 
 @param lastMsgId lastMsgId
 */
- (NSDictionary *)getLastCollectionMsgByMsgId:(NSString *)lastMsgId;


- (NSArray *)getCollectionMsgListWithBindId:(NSString *)bindId;

/**
 保存代收消息到数据库

 @param collectionMsgDic 代收消息Dic
 */
- (void)saveCollectionMessage:(NSDictionary *)collectionMsgDic;

/**
 根据MsgId获取代收消息

 @param msgId msgId
 */
- (Message *)getCollectionMsgListForMsgId:(NSString *)msgId;

/**
 根据绑定用户Id及消息来源Id获取代收消息列表

 @param userId 消息来源人Id
 @param originUserId 绑定用户Id
 */
- (NSArray *)getCollectionMsgListForUserId:(NSString *)userId originUserId:(NSString *)originUserId;


#pragma mark - 代收未读

/**
 根据Jid清空代收未读消息
 
 @param jid Jid
 */
- (void)clearNotReadCollectionMsgByJid:(NSString *)jid;

/**
 根据绑定账号 & 用户Id清空代收 未读消息
 
 @param bindId 绑定账号Id
 @param userId 用户Id
 */
- (void)clearNotReadCollectionMsgByBindId:(NSString *)bindId WithUserId:(NSString *)userId;

/**
 获取代收总未读消息数
 */
- (NSInteger)getNotReadCollectionMsgCount;

/**
 获取某绑定账号下的代收未读消息数
 
 @param bindId 绑定账号Id
 */
- (NSInteger)getNotReadCollectionMsgCountByBindId:(NSString *)bindId;

/**
 获取某绑定账号下 单一账号来的代收 未读消息
 
 @param bindId 绑定账号Id
 @param userId 用户Id
 */
- (NSInteger)getNotReadCollectionMsgCountByBindId:(NSString *)bindId WithUserId:(NSString *)userId;

QIMKit+QIMConsult.h -> Consult消息

	/**
 虚拟账号的RealJid列表
 */
@property (nonatomic, strong) NSMutableDictionary *virtualRealJidDic;

/**
 虚拟账号列表
 */
@property (nonatomic, strong) NSArray *virtualList;

/**
 获取虚拟账号列表
 */
- (NSArray *)getVirtualList;

/**
 根据虚拟Id获取真实RealJid

 @param virtualJid 虚拟Id
 */
- (NSString *)getRealJidForVirtual:(NSString *)virtualJid;

/**
 发送Consult消息

 @param msgId MsgId
 @param msg 消息Body内容
 @param info 消息ExtendInfo
 @param toJid 消息
 @param realToJid 真实RealJid
 @param chatType 会话类型
 @param msgType 消息类型
 @return 消息对象Message
 */
- (Message *)sendConsultMessageId:(NSString *)msgId WithMessage:(NSString *)msg WithInfo:(NSString *)info toJid:(NSString *)toJid realToJid:(NSString *)realToJid WithChatType:(ChatType)chatType WithMsgType:(int)msgType;

- (void)chatTransferTo:(NSString *)user message:(NSString *)message chatId:(NSString *)chatId;

/**
 会话转移
 
 @param from from
 @param to to
 @param user user
 @param reson 原因
 @param chatId chat id
 @param msgId msgId
 */
- (void)chatTransferFrom:(NSString *)from To:(NSString *)to User:(NSString *)user Reson:(NSString *)reson chatId:(NSString *)chatId WithMsgId:(NSString *)msgId;

- (void)customerConsultServicesayHelloWithUser:(NSString *)user WithVirtualId:(NSString *)virtualId WithFromUser:(NSString *)fromUser;

/**
 欢迎语接口?
 
 @param user 客服id
 */
- (void)customerServicesayHelloWithUser:(NSString *)user;

/**
 输入预测
 
 @param keyword 关键词
 @return 返回预测结果
 */
- (NSArray *)searchSuggestWithKeyword:(NSString *)keyword;

/**
 organization预测
 
 @param suggestId 输入id
 @return 返回预测结果
 */
- (NSArray *)getSuggestOrganizationBySuggestId:(NSString *)suggestId;

/**
 根据店铺Id 设置服务模式

 @param shopId 店铺Id
 @param shopServiceStatus 服务模式
 @return 是否设置成功
 */
- (BOOL)updateSeatSeStatusWithShopId:(NSInteger)shopId WithStatus:(NSInteger)shopServiceStatus;

/**
 根据服务模式获取基础信息

 @param userStatus 服务模式
 */
- (NSDictionary *)userSeatStatusDict:(int)userStatus;


- (NSString *)userStatusTitleWithStatus:(int)userStatus;

/**
 获取坐席状态
 
 @return 返回坐席状态
 */
- (NSArray *)getSeatSeStatus;

/**
 获取状态坐席状态列表
 */
- (NSArray *)availableUserSeatStatus;

/**
 关闭会话
 
 @param shopId ShopId
 @param visitorId 客人Id
 @return 关闭之后的提示语
 */
- (NSString *)closeSessionWithShopId:(NSString *)shopId WithVisitorId:(NSString *)visitorId;

QIMKit+QIMFileManager.h 文件管理

/**
 根据文件URL获取文件后缀

 @param url 文件URL
 @return 文件后缀
 */
+ (NSString *) urlpathExtension:(NSString *) url;

+ (NSString *) documentsofPath:(QIMFileCacheType) type;

/**
 文件上传
 
 @param filePath 文件路径
 @param message 消息
 @param jid user id
 @param flag 是文件还是图片
 @return 文件url
 */
- (NSString *)uploadFileForPath:(NSString *)filePath forMessage:(Message *)message withJid:(NSString *)jid isFile:(BOOL)flag;

/**
 文件上传

 @param fileData 文件二进制
 @param message 消息
 @param jid 用户Id
 @param flag 是文件还是图片
 @return 文件URL
 */
- (NSString *)uploadFileForData:(NSData *)fileData forMessage:(Message *)message withJid:(NSString *)jid isFile:(BOOL)flag;

- (void)uploadFileForData:(NSData *)fileData forCacheType:(QIMFileCacheType)type isFile:(BOOL)flag completionBlock:(QIMFileManagerUploadCompletionBlock)completionBlock;

- (void)uploadFileForData:(NSData *)fileData forCacheType:(QIMFileCacheType)type isFile:(BOOL)flag fileExt:(NSString *)fileExt completionBlock:(QIMFileManagerUploadCompletionBlock)completionBlock;

- (void )downloadFileWithUrl:(NSString *)url isFile:(BOOL)flag forCacheType:(QIMFileCacheType)type;


/**
 下载图片

 @param url 图片URL
 @param width 图片width
 @param height 图片height
 @param type 图片缓存类型
 */
-(void)downloadImage:(NSString *)url width:(CGFloat) width height:(CGFloat) height  forCacheType:(QIMFileCacheType)type;


/**
 下载图片

 @param url 图片URL
 @param width 图片width
 @param height 图片height
 @param type 图片缓存类型
 @param complation 下载成功的回调
 */
-(void)downloadImage:(NSString *)url
               width:(CGFloat) width
              height:(CGFloat) height
        forCacheType:(QIMFileCacheType)type
          complation:(void(^)(NSData *)) complation;

-(void)downloadCollectionEmoji:(NSString *)url
                         width:(CGFloat) width
                        height:(CGFloat) height
                  forCacheType:(QIMFileCacheType)type
                    complation:(void(^)(NSData *)) complation;

//- (NSData *) getSmallFileDataFromUrl:(NSString *)url forCacheType:(QIMFileCacheType)type;

/**
 缓存文件
 
 @param data 文件data
 @param fileName 文件名称
 @param type 缓存类型
 @return 返回path
 */
- (NSString *) saveFileData:(NSData *)data withFileName:(NSString *)fileName forCacheType:(QIMFileCacheType)type;

- (NSString *) saveFileData:(NSData *)data url:(NSString *)httpUrl forCacheType:(QIMFileCacheType)type;

/**
 缓存文件
 
 @param data 文件data
 @param httpUrl 远程链接
 @param width 宽
 @param height 高
 @param type 缓存类型
 @return 返回path
 */
- (NSString *) saveFileData:(NSData *)data url:(NSString *)httpUrl  width:(CGFloat) width height:(CGFloat) height forCacheType:(QIMFileCacheType)type;

/**
 获取文件path
 
 @param fileName 文件名
 @param type 缓存类型
 @return 返回path
 */
- (NSString *) getFilePathForFileName:(NSString *)fileName forCacheType:(QIMFileCacheType)type;

/**
 获取文件path

 @param fileName 文件名
 @param type 缓存类型
 @param careExist 是否关心文件已存在
 @return 返回Path
 */
- (NSString *) getFilePathForFileName:(NSString *)fileName forCacheType:(QIMFileCacheType)type careExist:(BOOL) careExist;

/**
 文件是否存在
 
 @param url 文件url
 @param width 宽
 @param height 高
 @param type 缓存类型
 @return 返回是否存在
 */
- (BOOL)isFileExistForUrl:(NSString *)url width:(float)width height:(float)height forCacheType:(QIMFileCacheType)type;

- (NSString *)fileExistLocalPathForUrl:(NSString *)url width:(float)width height:(float)height forCacheType:(QIMFileCacheType)type;

- (NSString *)getNewMd5ForMd5:(NSString *)oldMd5 withWidth:(float)width height:(float)height;

/**
 获取file data
 
 @param fileName file名称
 @param type file缓存类型
 @return 返回file data
 */
- (NSData *) getFileDataForFileName:(NSString *)fileName forCacheType:(QIMFileCacheType)type;

- (NSData *) getFileDataFromUrl:(NSString *)url forCacheType:(QIMFileCacheType)type;

- (NSData *) getFileDataFromUrl:(NSString *)url forCacheType:(QIMFileCacheType)type needUpdate:(BOOL)update;

- (NSData *) getFileDataFromUrl:(NSString *)url width:(float)width height:(float)height forCacheType:(QIMFileCacheType)type;

- (CGSize)getImageSizeFromUrl:(NSString *)url;

- (NSString *) getFileNameFromKey:(NSString *)url;

/**
 *  根据URL获得文件名
 *
 *  @param url URL
 */
- (NSString *) getFileNameFromUrl:(NSString *)url;

- (NSString *) getFileExtFromUrl:(NSString *) url;

- (NSString *) md5fromUrl:(NSString *) url;

/**
 根据URL获得文件名

 @param url 图片URL
 @param width 图片width
 @param height 图片height
 @return 图片文件名
 */
- (NSString *) getFileNameFromUrl:(NSString *)url width:(CGFloat) width height:(CGFloat) height;

/**
 获取图片后缀
 
 @param data data
 @return 返回图片后缀
 */
- (NSString *)getImageFileExt:(NSData *)data;

- (NSString *)getMD5FromFileData:(NSData *)fileData;

/**
 获取图片size
 
 @param imgSize 原图片size
 @return 缩略图size
 */
- (CGSize)getFitSizeForImgSize:(CGSize)imgSize;

QIMKit+QIMFriend.h 好友

- (NSMutableDictionary *)getFriendListDict;

- (void)updateFriendList;

- (void)updateFriendInviteList;

#pragma mark - friend

/**
 获取某人好友验证的类型
 
 @param userId user id
 @return 返回验证类型信息
 */
- (NSDictionary *)getVerifyFreindModeWithXmppId:(NSString *)userId;

/**
 设置我的好友验证类型(带问题答案的)
 
 @param mode 好友验证类型
 @param question 问题
 @param answer 答案
 @return 是否成功
 */
- (BOOL)setVerifyFreindMode:(int)mode WithQuestion:(NSString *)question WithAnswer:(NSString *)answer;

/**
 get friends 信息?
 
 @return 返回friends信息
 */
- (NSString *)getFriendsJson;

/**
 请求添加好友
 
 @param xmppId 请求好友id
 @param answer 答案(如果需要有)
 */
- (void)addFriendPresenceWithXmppId:(NSString *)xmppId WithAnswer:(NSString *)answer;

/**
 回复好友请求
 
 @param xmppId 请求好友id
 @param reason 原因
 */
- (void)validationFriendWihtXmppId:(NSString *)xmppId WithReason:(NSString *)reason;

/**
 同意好友请求
 
 @param xmppId 对方id
 */
- (void)agreeFriendRequestWithXmppId:(NSString *)xmppId;

/**
 拒绝好友请求
 
 @param xmppId 对方id
 */
- (void)refusedFriendRequestWithXmppId:(NSString *)xmppId;

/**
 删除好友
 
 @param xmppId 对方id
 @param mode mode1为单项删除,mode为2为双项删除
 @return 返回处理结果
 */
- (BOOL)deleteFriendWithXmppId:(NSString *)xmppId WithMode:(int)mode;

/**
 获取好友验证类型
 
 @param xmppId 对方id
 @return 返回好友验证type
 */
- (int)getReceiveMsgLimitWithXmppId:(NSString *)xmppId;

/**
 设置好友验证类型
 
 @param mode QIMVerifyMode
 @return 返回处理结果
 */
- (BOOL)setReceiveMsgLimitWithMode:(int)mode;

// Black List
- (void)updateBlackList;

/**
 获取黑名单
 
 @return 返回黑名单
 */
- (NSArray *)getBlackList;

/**
 加入黑名单
 
 @param userId 用户id
 @return 是否成功
 */
- (BOOL)addToBlackListWithUserId:(NSString *)userId;

/**
 移除黑名单
 
 @param userId 用户id
 @return 是否成功
 */
- (BOOL)removeFromBlackListWithUserId:(NSString *)userId;

/**
 某人是否在黑名单里面
 
 @param userId 用户id
 @return 返回救过
 */
- (BOOL)isBlackListWithUserId:(NSString *)userId;

- (NSDictionary *)getLastFriendNotify;

- (NSInteger)getFriendNotifyCount;

QIMKit+QIMGroup.h

	/**
 更新群消息时间戳
 */
- (void)updateLastGroupMsgTime;

/**
 根据昵称获取群消息来源方向
 
 @param sendJid 昵称
 @return MessageDirection
 */
- (MessageDirection)getGroupMsgDirectionWithSendJid:(NSString *)sendJid;

- (NSArray *)getGroupIdList;

/**
 获取我的群组列表
 */
- (NSArray *)getGroupList;

/**
 获取我的群组列表
 */
- (NSArray *)getMyGroupList;

#pragma mark - 群名片

- (NSDictionary *)getUserInfoByGroupName:(NSString *)groupName;

/**
 根据群Id获取群组名片
 
 @param groupId 群组Id
 @return 群组名片Dic
 */
- (NSDictionary *)getGroupCardByGroupId:(NSString *)groupId;


/**
 根据群Id更新群组名片
 
 @param groupId 群组Id
 */
- (void)updateGroupCardByGroupId:(NSString *)groupId;


/**
 根据群Id列表更新群组名片
 
 @param groupIds 群组Id列表
 */
- (void)updateGroupCard:(NSArray *)groupIds;

/**
 设置群名片信息
 
 @param groupId 群Id
 @param nickName 我的昵称
 @param title 群Title
 @param desc 群公告
 @param headerSrc 群头像地址
 @return 设置群名片是否成功
 */
- (BOOL)setMucVcardForGroupId:(NSString *)groupId
                 WithNickName:(NSString *)nickName
                    WithTitle:(NSString *)title
                     WithDesc:(NSString *)desc
                WithHeaderSrc:(NSString *)headerSrc;

/**
 更新群公告
 
 @param topic 公告信息
 @param groupId 群Id
 @return 更新群公告是否成功
 */
- (BOOL)updateGroupTopic:(NSString *)topic WithGroupId:(NSString *)groupId;

#pragma mark - 群成员

/**
 根据群Id同步群成员列表
 
 @param groupId 群Id
 @return 群成员列表
 */
- (NSArray *)syncgroupMember:(NSString *)groupId;


/**
 根据群Id获取群成员列表
 
 @param groupId 群Id
 @return 群成员列表
 */
- (NSArray *)getGroupMembersByGroupId:(NSString *)groupId;

/**
 根据群Id获取群组公告信息
 
 @param groupId 群Id
 @return 群公告信息
 */
- (NSString *)getGroupTopicByGroupId:(NSString *)groupId;


/**
 判断本人是否为群成员
 
 @param groupId 群Id
 */
- (BOOL)isGroupMemberByGroupId:(NSString *)groupId;


/**
 判断本人是否为群主
 
 @param groupId 群组Id
 */
- (BOOL)isGroupOwner:(NSString *)groupId;


/**
 指定的user在群众的身份
 
 @param userId 指定的user(userId为nil,默认为登录用户)
 @param groupId 群id
 @return 返回在群众的身份 QIMGroupIdentity
 */
- (QIMGroupIdentity)GroupIdentityForUser:(NSString *)userId byGroup:(NSString *)groupId;

#pragma mark - 群头像

/**
 群默认头像
 */
+ (UIImage *)defaultGroupHeaderImage;

/**
 根据GroupId从远程拉取群头像
 */
- (void)getGroupHeaderImageFromRemoteWithGroupId:(NSString *)groupId;


/**
 根据群Id获取群组头像本地路径
 
 @param groupId 群Id
 @return 本地路径
 */
- (NSString *)getGroupImagePathFromLocalByGroupId:(NSString *)groupId;

/**
 根据GroupId从本地取群头像
 
 @param groupId 群Id
 */
- (UIImage *)getGroupImageFromLocalByGroupId:(NSString *)groupId;

#pragma mark - 群设置

/**
 根据群组Id获取群免打扰状态
 
 @param groupId 群组Id
 @return 群组免打扰状态
 */
- (BOOL)groupPushState:(NSString *)groupId;

/**
 根据群Id更新群组免打扰状态
 
 @param groupId 群组Id
 @param on 是否免打扰
 @return 更新群组免打扰状态是否成功
 */
- (BOOL)updateGroupPushState:(NSString *)groupId withOn:(BOOL)on;

- (void)addGroupMemberChange:(NSString *)groupId;
- (void)removeGroupMemberChange:(NSString *)groupId;
- (BOOL)isGroupMemberChangeByGroupId:(NSString *)groupId;

/**
 默认群组设置
 */
- (NSDictionary *) defaultGroupSetting;

#pragma mark - 创建群 & 邀请人入群

/**
 创建群聊
 
 @param groupName 群名称
 @param nickName 我的昵称
 @param members 群成员列表
 @param settingDic 群设置
 @param desc 群公告
 @param groupNickName 群昵称
 @param complate complate回调
 */
- (void)createGroupByGroupName:(NSString *)groupName
                WithMyNickName:(NSString *)nickName
              WithInviteMember:(NSArray *)members
                   WithSetting:(NSDictionary *)settingDic
                      WithDesc:(NSString *)desc
             WithGroupNickName:(NSString *)groupNickName
                  WithComplate:(void (^)(BOOL,NSString *))complate;

/**
 群组邀请users
 
 @param groupID 群ID
 @param groupName 群名
 @param members 邀请的成员userIDs
 @param block 回调
 */
-(void)joinGroupWithBuddies:(NSString *)groupID  groupName:(NSString *)groupName WithInviteMember:(NSArray *)members withCallback:(dispatch_block_t) block;


/**
 将群成员踢出群组
 
 @param name name
 @param memberJid memberJid
 @param groupId 群组Id
 @return 踢除是否成功
 */
- (BOOL)removeGroupMemberWithName:(NSString *)name WithJid:(NSString *)memberJid ForGroupId:(NSString *)groupId;

/**
 邀请成员进群
 
 @param members 成员列表
 @param groupId 群组Id
 @return 邀请入群是否成功
 */
- (BOOL)inviteMember:(NSArray *)members ToGroupId:(NSString *)groupId;

/**
 加入群聊
 
 @param groupId 群组Id
 @param name name
 @param initiative initiative
 @return 加入群聊是否成功
 */
- (BOOL)joinGroupId:(NSString *)groupId ByName:(NSString *)name isInitiative:(BOOL)initiative;


/**
 使用密码加入群聊
 
 @param groupId 群组Id
 @param name name
 @param password 入群密码
 @return 加入群聊是否成功
 */
- (BOOL)joinGroupId:(NSString *)groupId ByName:(NSString *)name WithPassword:(NSString *)password;


/**
 退出群聊
 
 @param groupId 群组Id
 @return 退出是否成功
 */
- (BOOL)quitGroupId:(NSString *)groupId;

- (void)updateChatRoomList;

/**
 快速入群
 */
- (void)quickJoinAllGroup;

- (void)joinGroupList;


/**
 增量群列表
 
 @param lastTime 增量时间戳
 */
- (void)getIncrementMucList:(NSTimeInterval)lastTime;


#pragma mark - SearchGroup

/**
 根据关键字搜索群组总数
 
 @param searchStr 关键字
 @return 群组总数
 */
- (NSInteger)searchGroupTotalCountBySearchStr:(NSString *)searchStr;


/**
 根据关键字搜索群组
 
 @param searchStr 关键字
 @param limit limit
 @param offset offset
 @return 搜索出来的群组列表
 */
- (NSArray *)searchGroupBySearchStr:(NSString *)searchStr WithLimit:(NSInteger)limit WithOffset:(NSInteger)offset;

/**
 根据关键字搜索在同一个群的用户
 
 @param searchStr 关键字
 @param groupId 群组Id
 @return 结果群成员列表
 */
- (NSArray *)searchGroupUserBySearchStr:(NSString *) searchStr inGroup:(NSString *) groupId;

- (NSArray *)searchUserBySearchStr:(NSString *)searchStr notInGroup:(NSString *)groupId;

QIMKit+QIMGroupMessage.h 群组消息

- (void)updateLastGroupMsgTime;

- (void)checkGroupChatMsg;

- (void)updateOfflineGroupMessages;

- (NSArray *)getMucMsgListWihtGroupId:(NSString *)groupId WithDirection:(int)direction WithLimit:(int)limit WithVersion:(long long)version;

- (void)updateMucReadMark;

QIMKit+QIMHelper.h -> 工具类

/**
 红包提示音
 */
- (void)playHongBaoSound;

/**
 新消息提示音
 */
- (void)playSound;

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;

/**
 窗口抖动
 */
- (void)shockWindow;

QIMKit+QIMMessage.h 消息

/**
 获取指定类型消息
 
 @param msgType 指定消息类型
 @return 返回消息组
 */
- (NSArray *)getMsgsForMsgType:(QIMMessageType)msgType;

- (NSDictionary *)getMsgDictByMsgId:(NSString *)msgId;

- (Message *)getMsgByMsgId:(NSString *)msgId;

- (void)checkMsgTimeWithJid:(NSString *)jid WithRealJid:(NSString *)realJid WithMsgDate:(long long)msgDate WithGroup:(BOOL)flag;

- (void)checkMsgTimeWithJid:(NSString *)jid WithMsgDate:(long long)msgDate WithGroup:(BOOL)flag;

#pragma mark - 公共消息

/**
 根据用户Id设置Message附加属性 {'cctext', 'bu'}
 
 @param appendInfoDict 附加字典
 @param userId 用户Id
 */
- (void)setAppendInfo:(NSDictionary *)appendInfoDict ForUserId:(NSString *)userId;

/**
 根据用户Id获取Message附加属性  {'cctext', 'bu'}
 
 @param userId 用户Id
 */
- (NSDictionary *)getAppendInfoForUserId:(NSString *)userId;

/**
 根据用户Id设置ChannelId
 
 @param channelId channelId
 @param userId 用户Id
 */
- (void)setChannelInfo:(NSString *)channelId ForUserId:(NSString *)userId;

/**
 根据用户Id获取ChannelId
 
 @param userId 用户Id
 */
- (NSString *)getChancelInfoForUserId:(NSString *)userId;


/**
 根据用户Id设置 点击聊天内容中的URL务必拼接的参数 (众包需求)
 
 @param param param
 @param jid 用户Id
 */
- (void)setConversationParam:(NSDictionary *)param WithJid:(NSString *)jid;

/**
 根据用户Id获取 点击聊天内容中的URL务必拼接的参数 (众包需求)
 
 @param jid 用户Id
 */
- (NSDictionary *)conversationParamWithJid:(NSString *)jid;

/**
 发送正在输入消息
 
 @param userId to 给谁?
 */
- (void)sendTypingToUserId:(NSString *)userId;

/**
 消息入库
 
 @param msg message
 @param sid 会话ID(单人为to,群为群id)
 */
- (void)saveMsg:(Message *)msg ByJid:(NSString *)sid;

//更新消息
- (void)updateMsg:(Message *)msg ByJid:(NSString *)sid;

- (void)deleteMsg:(Message *)msg ByJid:(NSString *)sid;

/**
 发送已读状态(单人会话专用)
 
 @param messages 消息集
 @param xmppId 跟谁的消息对话 to值
 @return 是否成功
 */
- (BOOL)sendReadStateWithMessagesIdArray:(NSArray *)messages WithXmppId:(NSString *)xmppId;

/**
 发送已读状态(Consult会话专用)
 
 @param messages 消息集
 @param xmppId 跟谁的消息对话 to值
 @param realJid 真实 to值(consult消息用,普通消息此值传nil)
 @return 是否成功
 */
- (BOOL)sendReadStateWithMessagesIdArray:(NSArray *)messages WithXmppId:(NSString *)xmppId WithRealJid:(NSString *)realJid;

/**
 发送已读状态(群消息用)
 
 @param lastTime 已读截止时间,一般为最后一条消息时间
 @param groupId 群ID
 @return 是否成功
 */
- (BOOL)sendReadstateWithGroupLastMessageTime:(long long) lastTime withGroupId:(NSString *) groupId;


#pragma mark - 单人消息

/**
 发送窗口抖动
 
 @param userId 对方用户Id
 */
- (Message *)sendShockToUserId:(NSString *)userId;


/**
 撤销单人消息
 
 @param messageId messageId
 @param message message
 @param jid jid
 */
- (void)revokeMessageWithMessageId:(NSString *)messageId message:(NSString *)message ToJid:(NSString *)jid;

/**
 发送文件消息
 
 @param fileJson 文件URL
 @param userId 对方UserId
 @param msgId 消息Id
 */
- (void)sendFileJson:(NSString *)fileJson ToUserId:(NSString *)userId WithMsgId:(NSString *)msgId;
	
/**
 发送消息
 
 @param msg 消息Message对象
 @param userId 接收方Id
 */
- (Message *)sendMessage:(Message *)msg ToUserId:(NSString *)userId;

/**
 发送单人消息
 
 @param msg 消息Body
 @param info 消息ExtendInfo
 @param userId 接收Id
 @param msgType 消息Type
 */
- (Message *)sendMessage:(NSString *)msg WithInfo:(NSString *)info ToUserId:(NSString *)userId WihtMsgType:(int)msgType;


// Note消息自动回复消息(您好,我是在线客服xxx,很高兴为您服务)
- (Message *)createNoteReplyMessage:(NSString *)msg ToUserId:(NSString *)user;

#pragma mark - 群消息


/**
 发送群消息
 
 @param msg 消息Body
 @param groupId 群Id
 */
- (Message *)sendMessage:(NSString *)msg ToGroupId:(NSString *)groupId ;


/**
 发送群消息
 
 @param msg 消息Body
 @param info 消息ExtendInfo
 @param groupId 群Id
 @param msgType 消息Type
 */
- (Message *)sendMessage:(NSString *)msg WithInfo:(NSString *)info ToGroupId:(NSString *)groupId WihtMsgType:(int)msgType;


/**
 发送群消息
 
 @param msg 消息Body
 @param info 消息ExtendInfo
 @param groupId 群Id
 @param msgType 消息Type
 @param msgId 消息Id
 */
- (Message *)sendMessage:(NSString *)msg WithInfo:(NSString *)info ToGroupId:(NSString *)groupId WihtMsgType:(int)msgType WithMsgId:(NSString *)msgId;

/**
 发送群窗口抖动
 
 @param groupId 群Id
 */
- (Message *)sendGroupShockToGroupId:(NSString *)groupId;

/**
 回复群消息
 
 @param replyMsgId 回复消息id
 @param replyUser 回复userid
 @param msgId 消息id
 @param message 消息
 @param groupId 群id
 @return 是否成功
 */
- (BOOL)sendReplyMessageId:(NSString *)replyMsgId WithReplyUser:(NSString *)replyUser WithMessageId:(NSString *)msgId WithMessage:(NSString *)message ToGroupId:(NSString *)groupId;

/**
 撤销群消息
 
 @param messageId messageId
 @param message message
 @param jid jid
 */
- (void)revokeGroupMessageWithMessageId:(NSString *)messageId message:(NSString *)message ToJid:(NSString *)jid;

/**
 发送群文件
 
 @param fileJson 文件地址
 @param groupId 群Id
 @param msgId 消息Id
 */
- (void)sendFileJson:(NSString *)fileJson ToGroupId:(NSString *)groupId WihtMsgId:(NSString *)msgId;


/**
 发送群语音消息
 
 @param voiceUrl 语音文件地址
 @param voiceName 语音文件名称
 @param seconds 语音时长
 @param groupId 群Id
 */
- (Message *)sendGroupVoiceUrl:(NSString *)voiceUrl withVoiceName:(NSString *)voiceName withSeconds:(int)seconds ToGroupId:(NSString *)groupId;

// Note消息自动回复消息(您好,我是在线客服xxx,很高兴为您服务)
- (Message *)createNoteReplyMessage:(NSString *)msg ToGroupId:(NSString *)groupId;

// 发送音视频消息
- (void)sendAudioVideoWithType:(int)msgType WithBody:(NSString *)body WithExtentInfo:(NSString *)extentInfo WithMsgId:(NSString *)msgId ToJid:(NSString *)jid;

/**
 创建消息
 
 @param msg 消息文本
 @param extendInfo 扩展消息
 @param userId 用户id(单人id/群id/虚拟id)
 @param userType 会话类型 ChatType
 @param msgType 消息类型 MessageType
 @param mId 消息id,传nil会默认生成
 @param willSave 是否入库
 @return 返回创建的消息
 */
- (Message *)createMessageWithMsg:(NSString *)msg extenddInfo:(NSString *)extendInfo userId:(NSString *)userId userType:(ChatType)userType msgType:(QIMMessageType)msgType forMsgId:(NSString *)mId willSave:(BOOL)willSave;

- (Message *)createMessageWithMsg:(NSString *)msg extenddInfo:(NSString *)extendInfo userId:(NSString *)userId realJid:(NSString *)realJid userType:(ChatType)userType msgType:(QIMMessageType)msgType forMsgId:(NSString *)mId msgState:(MessageState)msgState willSave:(BOOL)willSave;

- (Message *)createMessageWithMsg:(NSString *)msg extenddInfo:(NSString *)extendInfo userId:(NSString *)userId realJid:(NSString *)realJid userType:(ChatType)userType msgType:(QIMMessageType)msgType forMsgId:(NSString *)mId willSave:(BOOL)willSave;

- (Message *)sendMessage:(Message *)msg withChatType:(NSString *)chatType channelInfo:(NSString *)channelInfo realFrom:(NSString *)realFrom realTo:(NSString *)realTo ochatJson:(NSString *)ochatJson;

- (Message *)createMessageWithMsg:(NSString *)msg extenddInfo:(NSString *)extendInfo userId:(NSString *)userId userType:(ChatType)userType msgType:(QIMMessageType)msgType;

- (Message *)createMessageWithMsg:(NSString *)msg extenddInfo:(NSString *)extendInfo userId:(NSString *)userId userType:(ChatType)userType msgType:(QIMMessageType)msgType backinfo:(NSString *)backInfo;

- (Message *)createMessageWithMsg:(NSString *)msg extenddInfo:(NSString *)extendInfo userId:(NSString *)userId userType:(ChatType)userType msgType:(QIMMessageType)msgType forMsgId:(NSString *)mId;

- (void)synchronizeChatSessionWithUserId:(NSString *)userId WithChatType:(ChatType)chatType WithRealJid:(NSString *)realJid;

#pragma mark - 位置共享

/**
 发送共享位置消息
 
 @param msg 消息描述
 @param info 扩展消息
 @param jid 对象id
 @param msgType 消息类型
 @return 返回消息本身
 */
- (Message *)sendShareLocationMessage:(NSString *)msg WithInfo:(NSString *)info ToJid:(NSString *)jid WihtMsgType:(int)msgType;

/**
 共享位置开始
 
 @param userId 用户id
 @param shareLocationId 共享位置标识
 @return 返回消息本身
 */
- (Message *)beginShareLocationToUserId:(NSString *)userId WithShareLocationId:(NSString *)shareLocationId;

/**
 共享位置开始(群)
 
 @param GroupId 群id
 @param shareLocationId 共享位置标识
 @return 返回消息本身
 */
- (Message *)beginShareLocationToGroupId:(NSString *)GroupId WithShareLocationId:(NSString *)shareLocationId;

/**
 加入消息共享
 
 @param users 共享消息的用户组
 @param shareLocationId 共享消息标识
 @return 是否成功
 */
- (BOOL)joinShareLocationToUsers:(NSArray *)users WithShareLocationId:(NSString *)shareLocationId;

/**
 发送我的位置给其他用户
 
 @param users 共享位置的用户组
 @param locationInfo 位置信息
 @param shareLocationId 共享消息标识
 @return 是否成功
 */
- (BOOL)sendMyLocationToUsers:(NSArray *)users WithLocationInfo:(NSString *)locationInfo ByShareLocationId:(NSString *)shareLocationId;

/**
 退出位置共享
 
 @param users 共享位置的用户组
 @param shareLocationId 共享消息标识
 @return 是否成功
 */
- (BOOL)quitShareLocationToUsers:(NSArray *)users WithShareLocationId:(NSString *)shareLocationId;

/**
 获取共享标识
 
 @param jid jid
 @return 返回共享消息标识
 */
- (NSString *)getShareLocationIdByJid:(NSString *)jid;

/**
 获取共享位置信息
 
 @param shareLocationId 共享位置标识
 @return 返回共享位置信息
 */
- (NSString *)getShareLocationFromIdByShareLocationId:(NSString *)shareLocationId;

/**
 获取共享位置用户组
 
 @param shareLocationId 共享位置标识
 @return 返回用户组
 */
- (NSArray *)getShareLocationUsersByShareLocationId:(NSString *)shareLocationId;


#pragma mark - 未读数

- (void)updateMsgReadCompensateSetWithMsgId:(NSString *)msgId WithAddFlag:(BOOL)flag WithState:(MessageState)state;

- (NSMutableSet *)getLastMsgCompensateReadSet;

/**
 *  返回未读消息数组
 */
- (NSArray *)getNotReaderMsgList;

/**
 清空所有未读消息
 */
- (void) clearAllNoRead;

/**
 清空HeadLine未读消息
 */
- (void)clearSystemMsgNotReadWithJid:(NSString *)jid;

/**
 根据Jid清空未读消息
 
 @param jid 用户Id
 */
- (void)clearNotReadMsgByJid:(NSString *)jid;

/**
 根据Jid & RealJid清空未读消息
 
 @param jid 用户Id
 @param realJid 真实用户Id
 */
- (void)clearNotReadMsgByJid:(NSString *)jid ByRealJid:(NSString *)realJid;

/**
 根据群Id清空未读消息
 
 @param groupId 群id
 */
- (void)clearNotReadMsgByGroupId:(NSString *)groupId;

/**
 获取Jid下的未读消息数
 
 @param jid Jid
 */
- (NSInteger)getNotReadMsgCountByJid:(NSString *)jid;

/**
 获取Jid & 真实Id下的未读消息数
 
 @param jid 用户Id
 @param realJid 真实用户Id
 */
- (NSInteger)getNotReadMsgCountByJid:(NSString *)jid WithRealJid:(NSString *)realJid;

- (void)updateAppNotReadCount;

/**
 获取App总未读数
 */
- (NSInteger)getAppNotReaderCount;

/**
 获取接收但不提醒的未读数
 */
- (NSInteger)getNotRemindNotReaderCount;

/**
 获取骆驼帮未读消息数
 */
- (void)getExploreNotReaderCount;

/**
 获取QChat商家未回复留言数
 */
- (NSInteger)getLeaveMsgNotReaderCount;

- (void)updateNotReadCountCacheByJid:(NSString *)jid WithRealJid:(NSString *)realJid;
- (void)updateMessageStateWithNewState:(MessageState)state ByMsgIdList:(NSArray *)MsgIdList;

- (void)updateNotReadCountCacheByJid:(NSString *)jid;

- (void)sendNoteToUserId:(NSString *)userId WihtLine:(NSString *)line WithType:(NSString *)serviceType WihtUrl:(NSString *)url WithIp:(NSString *)ip WithProductInfo:(NSDictionary *)productInfo;
- (NSString *)beginChatWithStrId:(NSString *)strId WithPid:(NSString *)pid WithIp:(NSString *)userIp WithLine:(NSString *)line WithType:(NSString *)type WithSeatId:(NSString *)seatId;
- (void)endChatByChatId:(NSString *)chatId WithUserId:(NSString *)toUserId;
- (void)saveChatId:(NSString *)chatId ForUserId:(NSString *)userId;

- (void)setMsgSentFaild;


- (NSDictionary *)parseMessageByMsgRaw:(id)msgRaw;

- (NSDictionary *)parseOriginMessageByMsgRaw:(id)msgRaw;

- (NSArray *)getNotReadMsgIdListByUserId:(NSString *)userId WithRealJid:(NSString *)realJid;

/**
 获取消息列表
 
 @param userId   用户名
 @param limit    获取条数
 @param realJid  真实jid
 @param offset   偏移量
 @param complete 回调block
 */
- (void)getMsgListByUserId:(NSString *)userId WithRealJid:(NSString *)realJid WihtLimit:(int)limit WithOffset:(int)offset WihtComplete:(void (^)(NSArray *))complete;

/**
 获取消息列表
 
 @param userId 虚拟id
 @param timeStamp 时间戳
 @param complete 回调block
 */
- (void)getMsgListByUserId:(NSString *)userId FromTimeStamp:(long long)timeStamp WihtComplete:(void (^)(NSArray *))complete;

/**
 获取消息列表
 
 @param userId 虚拟id
 @param realJid 真实id
 
 @param timeStamp 时间戳
 @param complete 回调block
 */
- (void)getMsgListByUserId:(NSString *)userId WithRealJid:(NSString *)realJid FromTimeStamp:(long long)timeStamp WihtComplete:(void (^)(NSArray *))complete;

- (void)getConsultServerMsgLisByUserId:(NSString *)userId WithVirtualId:(NSString *)virtualId WithLimit:(int)limit WithOffset:(int)offset WithComplete:(void (^)(NSArray *))complete;

/**
 FS msg
 
 @param xmppId user id
 @return 返回结果
 */
- (NSArray *)getFSMsgByXmppId:(NSString *)xmppId;

/**
 FS msg
 
 @param msgId 消息表示
 @return 返回结果
 */
- (NSDictionary *)getFSMsgByMsgId:(NSString *)msgId;

- (void)checkOfflineMsg;

QIMKit+QIMMySelfStatus.h -> 用户状态

/**
 上线
 */
- (void)goOnline;

/**
 离开
 */
- (void)goAway;

/**
 忙碌
 */
- (void)goDnd;

/**
 下线
 */
- (void)goOffline;

- (void) deactiveReconnect;

/**
 active reconnect
 */
- (void) activeReconnect;

QIMKit+QIMNavConfig.h -> 导航

- (NSString *)qimNav_HttpHost;
- (NSString *)qimNav_TakeSmsUrl;
- (NSString *)qimNav_CheckSmsUrl;
- (NSString *)qimNav_NewHttpUrl;
- (NSString *)qimNav_WikiUrl;
- (NSString *)qimNav_TokenSmsUrl;
- (NSString *)qimNav_Javaurl;
- (NSString *)qimNav_Pubkey;
- (NSString *)qimNav_Domain;
- (QTLoginType)qimNav_LoginType; //登录方式
- (NSString *)qimNav_XmppHost;

/**
 文件服务HTTP接口 Host
 
 @return 返回接口Host
 */
- (NSString *)qimNav_InnerFileHttpHost;
- (NSString *)qimNav_Port;  //xmpp端口
- (NSString *)qimNav_ProtobufPort;   //Pb端口


//hosts
- (NSString *)qimNav_HashHosts;
- (NSString *)qimNav_QCHost;

/**
 获取广告内容
 
 @return 返回广告数据
 */
- (NSArray *)qimNav_AdItems;

/**
 ad sec
 
 @return ad sec
 */
- (int)qimNav_AdSec;

/**
 是否展示广告
 
 @return 返回开关值
 */
- (BOOL)qimNav_AdShown;

/**
 is ad carousel
 
 @return 返回bool值
 */
- (BOOL)qimNav_AdCarousel;

/**
 延迟
 
 @return 延迟
 */
- (int)qimNav_AdCarouselDelay;

/**
 是否允许跳过
 
 @return 返回是否允许跳过
 */
- (BOOL)qimNav_AdAllowSkip;
- (long long)qimNav_AdInterval;   //两次广告的间隔之间

/**
 跳过提示
 
 @return 返回跳过提示语
 */
- (NSString *)qimNav_AdSkipTips;

//imConfig
- (BOOL)qimNav_ShowOA;                //展示OA
- (BOOL)qimNav_ShowOrganizational;    //展示组织架构

//ability
- (NSString *)qimNav_GetPushState;
- (NSString *)qimNav_SetPushState;
- (NSString *)qimNav_QCloudHost;
- (NSString *)qimNav_Resetpwd;
- (NSString *)qimNav_Mconfig;
- (NSString *)qimNav_SearchUrl;
- (NSString *)qimNav_QcGrabOrder;
- (NSString *)qimNav_QcOrderManager;
- (BOOL)qimNav_NewPush;
- (BOOL)qimNav_Showmsgstat;

//RN Ability
- (BOOL)qimNav_RNMineView;      //展示RNMineView
- (BOOL)qimNav_RNAboutView;     //展示RNAboutView
- (BOOL)qimNav_RNGroupCardView; //展示RNGroupCardView
- (BOOL)qimNav_RNContactView;   //展示RNContactView
- (BOOL)qimNav_RNSettingView;   //展示RNSettingView
- (BOOL)qimNav_RNUserCardView;  //展示RNUserCardView
- (BOOL)qimNav_RNGroupListView;   //展示RN 群组列表
- (BOOL)qimNav_RNPublicNumberListView;    //展示RN 公众号列表

//OPS
- (NSString *)qimNav_OpsHost;

//Video
- (NSString *)qimNav_Group_room_host;
- (NSString *)qimNav_Signal_host;
- (NSString *)qimNav_WssHost;
- (NSString *)qimNav_VideoApiHost;

//Versions
- (long long)qimNav_NavVersion;
- (long long)qimNav_CheckConfigVersion;

- (NSString *)qimNav_NavUrl;

- (NSString *)qimNav_NavTitle;

- (BOOL)qimNav_Debug;

- (NSArray *)qimNav_getDebugers;

- (NSString *)qimNav_HealthcheckUrl;

- (BOOL)qimNav_updateNavigationConfigWithCheck:(BOOL)check;

/**
 清除广告
 */
- (void)qimNav_clearAdvertSource;

- (void)qimNav_swicthLocalNavConfigWithNavDict:(NSDictionary *)navDict;

- (NSString *)qimNav_getAdvertImageFilePath;

- (void)qimNav_updateAdvertConfigWithCheck:(BOOL)check;

- (BOOL)qimNav_updateNavigationConfigWithDomain:(NSString *)domain WithUserName:(NSString *)userName;

- (BOOL)qimNav_updateNavigationConfigWithNavDict:(NSDictionary *)navDict WithUserName:(NSString *)userName Check:(BOOL)check WithForcedUpdate:(BOOL)forcedUpdate;

QIMKit+QIMNetWork.h -> IM网络状态

/**
 获取当前网络状态

 @return appWorkState
 */
- (AppWorkState)appWorkState;


/**
 检查网络是否能够连接到互联网

 @return YES / NO
 */
- (BOOL)checkNetworkCanUser;


/**
 检查用户是否掉线,是否需要重新登录
 */
- (void)checkNetworkStatus;


/**
 接收网络变更通知

 @param notify 网络变更通知
 */
- (void)onNetworkChange:(NSNotification *)notify;


/**
 更新当前网络状态

 @param appWorkState 网络状态
 */
- (void)updateAppWorkState:(AppWorkState)appWorkState;


/**
 更新当前网络状态为“未登录”
 */
- (void)onDisconnect;

QIMKit+QIMSession.h -> 会话

/**
 set 当前的会话id
 
 @param userId 当前的会话id
 */
- (void)setCurrentSessionUserId:(NSString *)userId;

/**
 获取当前会话Id
 */
- (NSString *)getCurrentSessionUserId;

/**
 获取最近的单人会话session
 
 @return 返回session信息
 */
- (NSDictionary *)getLastedSingleChatSession;

/**
 获取最近对话列表
 
 @return 最近对话列表
 */
- (NSArray *)getSessionList;

/**
 *  清除会话列表
 */
- (void)deleteSessionList;

/**
 根据XmppId移除某一会话

 @param sid xmppId
 */
- (void)removeSessionById:(NSString *)sid;

/**
 根据虚拟账号Id 及 用户RealJid 移除某一Consult会话

 @param sid 虚拟账号Id
 @param realJid 用户真实Id
 */
- (void)removeConsultSessionById:(NSString *)sid RealId:(NSString *)realJid;


/**
 根据用户Id & 名称打开一个单人会话

 @param userId 用户Id
 @param name 用户名称
 */
- (ChatType)openChatSessionByUserId:(NSString *)userId ByName:(NSString *)name;

/**
 根据群Id & 群名称打开一个群会话

 @param groupId 群Id
 @param name 群名称
 */
- (void)openGroupSessionByGroupId:(NSString *)groupId ByName:(NSString *)name;


/**
 根据虚拟账号Id & 用户真实Id RealJid 及会话类型打开一个会话

 @param userId 虚拟账号Id
 @param realJid 用户真实Id
 @param chatType 会话类型
 */
- (void)openChatSessionByUserId:(NSString *)userId ByRealJid:(NSString *)realJid WithChatType:(ChatType)chatType;


/**
 新增一个Consult会话

 @param sessionId sessionId
 @param realJid 用户真实Id
 @param userId 虚拟账号Id
 @param msgId msgId
 @param open 是否打开
 @param lastUpdateTime lastUpdateTime
 @param chatType 会话类型
 */
- (void)addConsultSessionById:(NSString *)sessionId ByRealJid:(NSString *)realJid WithUserId:(NSString *)userId ByMsgId:(NSString *)msgId WithOpen:(BOOL)open WithLastUpdateTime:(long long)lastUpdateTime WithChatType:(ChatType)chatType;


/**
 新增一个普通会话

 @param type 会话类型
 @param jid 会话Id
 @param msgId 消息Id
 @param msgTime 消息时间戳
 */
- (void)addSessionByType:(ChatType)type ById:(NSString *)jid ByMsgId:(NSString *)msgId WithMsgTime:(long long)msgTime WithNeedUpdate:(BOOL)needUpdate;

QIMKit+QIMUserCard.h -> 用户名片

/**
 更新用户备注信息
 
 @param userId 用户Id
 @param markUpName 用户备注
 */
- (void)updateUserMarkupNameWithUserId:(NSString *)userId WithMarkupName:(NSString *)markUpName;

/**
 获取用户备注信息
 
 @param userId 用户Id
 @return 用户备注
 */
- (NSString *)getUserMarkupNameWithUserId:(NSString *)userId;

/**
 更新用户名片

 @param xmppIds 用户Id数组
 */
- (void)updateUserCard:(NSArray *)xmppIds;

/**
 *  通过userId获取用户大头像
 *
 *  @param userId 头像url
 */
- (NSString *)getUserBigHeaderImageUrlWihtUserId:(NSString *)userId;

- (void)updateUserBigHeaderImageUrl:(NSString *)url WihtVersion:(NSString *)version ForUserId:(NSString *)userId ;


/**
 更新我的名片信息
 */
- (void)updateMyCard;

/**
 更新QChat群成员
 
 @param groupId 群id
 */
- (void)updateQChatGroupMembersCardForGroupId:(NSString *)groupId;

/**
 更新我的头像

 @param photoData 头像二进制
 */
- (void)updateMyPhoto:(NSData *)photoData;

/**
 *  根据用户Id获取用户信息
 *
 *  @param myId 用户Id
 *
 *  @return 用户信息Info
 */
- (NSDictionary *)getUserInfoByUserId:(NSString *)myId;

/**
 + 根据用户Id获取WorkInfo
 + */
- (NSDictionary *)getUserWorkInfoByUserId:(NSString *)userId;


/**
 获取远端用户职工信息

 @param userId 用户Id
 */
- (NSDictionary *)getRemoteUserWorkInfoWithUserId:(NSString *)userId;


/**
 获取用户手机号

 @param qtalkId qtalkId
 */
- (NSString *)getPhoneNumberWithUserId:(NSString *)qtalkId;

/**
 *  通过nickName获取用户信息
 *
 *  @param nickName 昵称
 *
 */
//TODO 先本地获取名片,若无再取数据库
- (NSDictionary *)getUserInfoByName:(NSString *)nickName;

#pragma mark - 用户头像

/**
 *  根据用户Id更新用户头像
 *
 *  @param userId 用户Id
 */
/*
- (void)takeUserHeaderByUserId:(NSString *)userId;
*/

/**
 用户默认头像
 */
+ (NSData *)defaultUserHeaderImage;

/**
 第三方Cell默认头像
 
 @return 用户头像
 */
+ (UIImage *)defaultCommonTrdInfoImage ;

/**
 根据用户Id获取用户名片信息

 @param rtxId 用户Id
 */
- (NSDictionary *)getUserInfoByRTX:(NSString *)rtxId ;

/**
 更新用户签名

 @param userId 用户Id
 @param signature 个性签名
 */
- (void)updateUserSignatureForUser:(NSString *)userId signature:(NSString *)signature;


/**
 获取用户Profile

 @param userId 用户Id
 @param update 是否需要更新
 @param block 回调
 */
- (void)userProfilewithUserId:(NSString *)userId needupdate:(BOOL)update withBlock:(void (^)(NSDictionary *))block;

/**
 本地获取用户Profile
 
 @param userId 用户Id
 */
- (NSDictionary *)getLocalProfileForUserId:(NSString *)userId;

/**
 *  获取userProfile
 *
 *  @param userIds 用户ID
 *
 *  @return userProfile
 *  数据样例:
 
 "dan.liu@ejabhost1" =     {
 M = "\U8fd9\U592aimba\U4e86!";
 U = "dan.liu";
 V = 19;
 };
 */
- (NSDictionary *)getRemoteUserProfileForUserIds:(NSArray *)userIds;


/**
 根据用户Id获取QChat 用户名片信息

 @param user 用户Id
 */
- (NSDictionary *)getQChatUserInfoForUser:(NSString *)user;

#pragma mark - 跨域

/**
 搜索用户(跨域)
 
 @param searchStr 关键词
 @return 返回用户列表
 */
- (NSArray *)searchQunarUserBySearchStr:(NSString *)searchStr;

/**
 搜索用户
 
 @param searchStr 关键词
 @return 返回用户列表
 */
- (NSArray *)searchUserListBySearchStr:(NSString *)searchStr;

- (NSInteger)searchUserListTotalCountBySearchStr:(NSString *)searchStr;

- (NSArray *)searchUserListBySearchStr:(NSString *)searchStr WithLimit:(NSInteger)limit WithOffset:(NSInteger)offset;

/**
 搜索用户(全平台)
 
 @param searchStr 关键词
 @param searchURL search url
 @param Id id
 @param limitNum 限制条数
 @param offset 偏移量
 @return 返回用户列表
 */
- (NSArray *)searchUserListBySearchStr:(NSString *)searchStr Url:(NSString *)searchURL id:(NSString *)Id limit:(NSInteger)limitNum offset:(NSInteger)offset;
Clone this wiki locally