10.9提交
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// DataStructureConverter.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 齐洪茹 on 2023/12/26.
|
||||
// Copyright © 2023 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
@class NIMMessage;
|
||||
@class V2NIMMessage;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface DataStructureConverter : NSObject
|
||||
+ (NIMMessage *)messageConvertToV1:(V2NIMMessage *)message;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// NIMAddCollectParams.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/4/1.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMAddCollectParams : NSObject
|
||||
|
||||
/**
|
||||
* 收藏类型, > 0的类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger type;
|
||||
|
||||
/**
|
||||
* 数据,最大20KB
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *data;
|
||||
|
||||
/**
|
||||
* 扩展字段,最大1KB
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *ext;
|
||||
|
||||
/**
|
||||
* 去重唯一ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *uniqueId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by chenjili on 2021/3/22.
|
||||
// Copyright (c) 2021 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMAddEmptyRecentSessionBySessionOption : NSObject
|
||||
/**
|
||||
* 是否填入最后一条消息
|
||||
* @discussion ,默认为 NO,仅创建空会话;为YES,将同时添加最后一条消息
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL withLastMsg;
|
||||
|
||||
/**
|
||||
* 如果没有最后一条消息,是否用一条空消息补位
|
||||
* @discussion ,默认为 YES,创建一条空消息补位;为NO,不使用补位消息
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL addEmptyMsgIfNoLastMsgExist;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// NIMAddStickTopSessionParams.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/4/1.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMSession.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMAddStickTopSessionParams : NSObject
|
||||
|
||||
/**
|
||||
* 会话
|
||||
*/
|
||||
@property (nonatomic, copy) NIMSession *session;
|
||||
|
||||
/**
|
||||
* 扩展信息,最大512字符
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *ext;
|
||||
|
||||
/**
|
||||
* 初始化置顶信息
|
||||
* @param session 需要置顶的会话
|
||||
* @return 置顶信息对象
|
||||
*/
|
||||
- (instancetype)initWithSession:(NIMSession *)session;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,117 @@
|
||||
//
|
||||
// NIMAntiSpamOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 反垃圾选项
|
||||
* @discussion 这个选项用于配置反垃圾。当使用易盾反垃圾时,设置 enabled 为 YES (默认为 NO) 后该消息进投递到易盾系统进行反垃圾检测 (需要开启易盾服务),只对自定义消息有效
|
||||
*/
|
||||
@interface NIMAntiSpamOption : NSObject
|
||||
|
||||
/**
|
||||
* 是否开启反垃圾
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL yidunEnabled;
|
||||
|
||||
|
||||
/**
|
||||
* 需要反垃圾的内容
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *content;
|
||||
|
||||
/**
|
||||
* 用户在易盾配置的额外反垃圾的业务ID
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *businessId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否命中客户端反垃圾
|
||||
* @discussion 默认为NO,使用 NIMAntispamManager 中的 checkLocalAntispam:error: 方法来确定所给文本是否命中客户端本地反垃圾,根据结果填写这个字段
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL hitClientAntispam;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 本地反垃圾检查选项
|
||||
* @discussion 这个选项用于反垃圾的本地检查,可以用这个选项进行一些字符串的本地替换操作
|
||||
*/
|
||||
@interface NIMLocalAntiSpamCheckOption : NSObject
|
||||
|
||||
/**
|
||||
* 检查内容
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *content;
|
||||
|
||||
|
||||
/**
|
||||
* 需要替换的字符串
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *replacement;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 本地反垃圾检查结果类型
|
||||
*/
|
||||
typedef NS_ENUM (NSInteger, NIMLocalAntiSpamOperate){
|
||||
/**
|
||||
* 本地反垃圾列表不存在
|
||||
*/
|
||||
NIMAntiSpamOperateFileNotExists,
|
||||
/**
|
||||
* 本地替换
|
||||
*/
|
||||
NIMAntiSpamResultLocalReplace,
|
||||
/**
|
||||
* 本地屏蔽
|
||||
*/
|
||||
NIMAntiSpamResultLocalForbidden,
|
||||
/**
|
||||
* 服务器屏蔽
|
||||
*/
|
||||
NIMAntiSpamResultServerForbidden,
|
||||
/**
|
||||
* 没有命中词库,检查通过
|
||||
*/
|
||||
NIMAntiSpamResultNotHit,
|
||||
/**
|
||||
* 解析失败
|
||||
*/
|
||||
NIMAntiSpamResultError,
|
||||
};
|
||||
|
||||
/**
|
||||
* 本地反垃圾检查选项
|
||||
* @discussion 这个选项用于反垃圾的本地检查,可以用这个选项进行一些字符串的本地替换操作
|
||||
*/
|
||||
@interface NIMLocalAntiSpamCheckResult : NSObject
|
||||
|
||||
/**
|
||||
* 结果类型
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NIMLocalAntiSpamOperate type;
|
||||
|
||||
/**
|
||||
* 替换后的字符串,只有当类型为本地替换时才有效
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *content;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMAntispamManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by chris on 2018/3/9.
|
||||
// Copyright © 2018年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMLocalAntiSpamCheckOption;
|
||||
@class NIMLocalAntiSpamCheckResult;
|
||||
|
||||
/**
|
||||
* 反垃圾协议
|
||||
*/
|
||||
@protocol NIMAntispamManager <NSObject>
|
||||
|
||||
/**
|
||||
* 本地反垃圾检查器
|
||||
*
|
||||
* @param option 本地反垃圾检查选项
|
||||
* @param error 错误提示
|
||||
* @discussion 此扩展不会漫游到其他端,上层需要保证 NSDictionary 可以转换为 JSON。
|
||||
* @return 本地反垃圾检查结果,本地反垃圾列表会在每次登录后同步更新
|
||||
* 因为网络问题,或者没有登录,都会导致本地反垃圾列表无效的情况,error 中会包含具体出错原因
|
||||
*/
|
||||
- (nullable NIMLocalAntiSpamCheckResult *)checkLocalAntispam:(NIMLocalAntiSpamCheckOption *)option
|
||||
error:(NSError **)error;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// NIMApnsManager.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMPushNotificationSetting;
|
||||
@class NIMPushNotificationMultiportConfig;
|
||||
|
||||
/**
|
||||
* 更新推送回调
|
||||
*
|
||||
* @param error 错误信息,成功则error为nil
|
||||
*/
|
||||
typedef void(^NIMApnsHandler)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 获取 badge 回调
|
||||
*
|
||||
* @return badge 数量
|
||||
*/
|
||||
typedef NSUInteger(^NIMBadgeHandler)(void);
|
||||
|
||||
|
||||
/**
|
||||
* 推送委托
|
||||
*/
|
||||
@protocol NIMApnsManagerDelegate <NSObject>
|
||||
|
||||
/**
|
||||
* 其他端修改推送配置
|
||||
*/
|
||||
- (void)onOtherClientChangedPushNotificationMultiportConfig;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 推送协议
|
||||
*/
|
||||
@protocol NIMApnsManager <NSObject>
|
||||
/**
|
||||
* 获取当前的推送免打扰设置
|
||||
*
|
||||
* @return 推送设置
|
||||
*/
|
||||
- (nullable NIMPushNotificationSetting *)currentSetting;
|
||||
|
||||
/**
|
||||
* 更新推送免打扰设置
|
||||
*
|
||||
* @param setting 推送设置
|
||||
* @param completion 完成的回调
|
||||
*/
|
||||
- (void)updateApnsSetting:(NIMPushNotificationSetting *)setting
|
||||
completion:(nullable NIMApnsHandler)completion;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前多端推送策略配置
|
||||
*
|
||||
* @return 推送自定义配置
|
||||
*/
|
||||
- (nullable NIMPushNotificationMultiportConfig *)currentMultiportConfig;
|
||||
|
||||
|
||||
/**
|
||||
* 更推送自定义多端推送策略配置
|
||||
*
|
||||
* @param config 多端推送策略配置
|
||||
* @param completion 完成的回调
|
||||
*/
|
||||
- (void)updateApnsMultiportConfig:(NIMPushNotificationMultiportConfig *)config
|
||||
completion:(nullable NIMApnsHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 注册获取 badge 数量的回调函数
|
||||
*
|
||||
* @param handler 获取 badge 回调
|
||||
* @discussion 默认场景下,云信会将所有未读数量统一汇报给服务器,包括需要提醒和不需要提醒的会话未读数,上层可以通过注册该接口进行调整
|
||||
*/
|
||||
- (void)registerBadgeCountHandler:(NIMBadgeHandler)handler;
|
||||
|
||||
/**
|
||||
* 添加委托
|
||||
*
|
||||
* @param delegate 委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMApnsManagerDelegate>)delegate;
|
||||
|
||||
|
||||
/**
|
||||
* 移除委托
|
||||
*
|
||||
* @param delegate 委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMApnsManagerDelegate>)delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// NIMAsymEncryptionOption.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease on 2019/10/14.
|
||||
// Copyright © 2019 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// SM2加密配置类
|
||||
@interface NIMSM2Option : NSObject
|
||||
|
||||
/// 密钥版本
|
||||
@property (nonatomic, assign) NSInteger version;
|
||||
|
||||
/// SM2 X值
|
||||
@property (nonatomic, copy) NSString *SM2X;
|
||||
|
||||
/// SM2 Y值
|
||||
@property (nonatomic, copy) NSString *SM2Y;
|
||||
|
||||
@end
|
||||
|
||||
typedef NS_ENUM(NSUInteger, NIMRSAPaddingMode) {
|
||||
NIMRSAPaddingModePKCS1,
|
||||
NIMRSAPaddingModeOAEPWithSHA_1AndMGF1,
|
||||
NIMRSAPaddingModeOAEPWithSHA_256AndMGF1
|
||||
};
|
||||
|
||||
/// RSA加密配置类
|
||||
@interface NIMRSAOption : NSObject
|
||||
|
||||
/// 密钥版本
|
||||
@property (nonatomic, assign) NSInteger version;
|
||||
|
||||
/// RSA module
|
||||
@property (nonatomic, copy) NSString *module;
|
||||
|
||||
|
||||
/// RSA exp
|
||||
@property (nonatomic, assign) NSUInteger exp;
|
||||
|
||||
/// RSA padding
|
||||
@property (nonatomic, assign) NIMRSAPaddingMode paddingMode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// NIMAudioObject.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMMessageObjectProtocol.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 语音实例对象
|
||||
*/
|
||||
@interface NIMAudioObject : NSObject<NIMMessageObject>
|
||||
|
||||
/**
|
||||
* 语音对象初始化方法
|
||||
*
|
||||
* @param sourcePath 语音路径
|
||||
*
|
||||
* @return 语音实例对象
|
||||
*/
|
||||
- (instancetype)initWithSourcePath:(NSString *)sourcePath;
|
||||
|
||||
/**
|
||||
* 语音对象初始化方法
|
||||
*
|
||||
* @param data 语音数据
|
||||
* @param extension 语音数据文件后缀名
|
||||
*
|
||||
* @return 语音实例对象
|
||||
*/
|
||||
- (instancetype)initWithData:(NSData *)data
|
||||
extension:(NSString *)extension;
|
||||
|
||||
|
||||
/**
|
||||
* 语音对象初始化方法
|
||||
*
|
||||
* @param sourcePath 语音路径
|
||||
* @param scene 场景类别
|
||||
*
|
||||
* @return 语音实例对象
|
||||
*/
|
||||
- (instancetype)initWithSourcePath:(NSString *)sourcePath scene:(NSString *)scene;
|
||||
|
||||
/**
|
||||
* 语音对象初始化方法
|
||||
*
|
||||
* @param data 语音数据
|
||||
* @param extension 语音数据文件后缀名
|
||||
* @param scene 场景类别
|
||||
*
|
||||
* @return 语音实例对象
|
||||
*/
|
||||
- (instancetype)initWithData:(NSData *)data
|
||||
extension:(NSString *)extension
|
||||
scene:(NSString *)scene;
|
||||
|
||||
/**
|
||||
* 设置上传的url,用于发送已经上传好的资源
|
||||
*
|
||||
* @param urlString 图片的地址
|
||||
*
|
||||
*/
|
||||
- (void)setUploadURL:(NSString *)urlString;
|
||||
|
||||
/**
|
||||
* 语音的本地路径
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *path;
|
||||
|
||||
/**
|
||||
* 语音的远程路径
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *url;
|
||||
|
||||
/**
|
||||
* 语音时长,毫秒为单位
|
||||
* @discussion SDK会根据传入文件信息自动解析出duration,但上层也可以自己设置这个值
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger duration;
|
||||
|
||||
/**
|
||||
* 音频MD5
|
||||
*/
|
||||
@property (nullable,nonatomic, copy, readonly) NSString *md5;
|
||||
|
||||
/**
|
||||
* 文件显示名
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *displayName;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// NIMBatchDeleteMessagesOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by He on 2019/6/25.
|
||||
// Copyright © 2019 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 批量删除本地消息选项
|
||||
*/
|
||||
@interface NIMBatchDeleteMessagesOption : NSObject
|
||||
|
||||
/**
|
||||
* 起始时间, 默认 0, 单位s
|
||||
* @discussion 小于等于0表示之前全部消息
|
||||
*/
|
||||
@property(nonatomic,assign) NSTimeInterval start;
|
||||
|
||||
/**
|
||||
* 截止时间, 默认 0, 单位s
|
||||
* @discussion 小于等于0表示当前时间
|
||||
*/
|
||||
@property(nonatomic,assign) NSTimeInterval end;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// NIMBroadcastManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2017年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMBroadcastMessage;
|
||||
|
||||
/**
|
||||
* 广播消息委托
|
||||
*/
|
||||
@protocol NIMBroadcastManagerDelegate <NSObject>
|
||||
|
||||
/**
|
||||
* 收到广播消息回调
|
||||
*
|
||||
* @param broadcastMessage 广播消息
|
||||
*/
|
||||
|
||||
- (void)onReceiveBroadcastMessage:(NIMBroadcastMessage *)broadcastMessage;
|
||||
@end
|
||||
|
||||
/**
|
||||
* 广播消息协议
|
||||
*/
|
||||
@protocol NIMBroadcastManager <NSObject>
|
||||
|
||||
/**
|
||||
* 添加广播消息委托
|
||||
*
|
||||
* @param delegate 广播通知回调
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMBroadcastManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除广播消息委托
|
||||
*
|
||||
* @param delegate 广播通知回调
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMBroadcastManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// NIMBroadcastMessage.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2017年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 系统广播
|
||||
*/
|
||||
@interface NIMBroadcastMessage : NSObject
|
||||
|
||||
/**
|
||||
* 系统广播 id,全局唯一
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) int64_t broadcastId;
|
||||
|
||||
/**
|
||||
* 发起者 id
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *sender;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSTimeInterval timestamp;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *content;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// NIMCacheQuery.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2018年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* SDK 缓存查询选项
|
||||
*/
|
||||
@interface NIMResourceQueryOption : NSObject
|
||||
|
||||
/**
|
||||
* 查询的缓存文件类型,类型为文件后缀的集合。
|
||||
* 默认为 nil ,不分类型查询所有文件缓存。
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSArray<NSString *> *extensions;
|
||||
|
||||
/**
|
||||
* 当前时间往前多少时间之前所有的消息,默认为 7 天之前。
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval timeInterval;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* SDK 缓存查询结果
|
||||
*/
|
||||
@interface NIMCacheQueryResult : NSObject
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *path;
|
||||
|
||||
/**
|
||||
* 文件的创建日期
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSDate *creationDate;
|
||||
|
||||
/**
|
||||
* 文件的大小,单位为 bytes
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) long long fileLength;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// NIMChatExtendBasicInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by He on 2020/4/7.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMSession.h"
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMSession;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 获取 Thread Talk 消息基本信息
|
||||
*/
|
||||
@interface NIMChatExtendBasicInfo : NSObject <NSCopying>
|
||||
|
||||
/**
|
||||
* 会话类型
|
||||
*/
|
||||
@property (nonatomic,assign) NIMSessionType type;
|
||||
|
||||
/**
|
||||
* 消息的发送时间戳,单位(s)
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval timestamp;
|
||||
|
||||
/**
|
||||
* 消息发送方
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *fromAccount;
|
||||
|
||||
/**
|
||||
* 消息的接收方
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *toAccount;
|
||||
|
||||
/**
|
||||
* 消息的服务端ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *serverID;
|
||||
|
||||
/**
|
||||
* 消息的本地ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *messageID;
|
||||
|
||||
/**
|
||||
* 所在会话
|
||||
*/
|
||||
@property (nonatomic,strong,readonly) NIMSession *session;
|
||||
|
||||
|
||||
/**
|
||||
* 根据消息获取
|
||||
*
|
||||
* @param message 目标消息
|
||||
*/
|
||||
- (instancetype)initWithMessage:(NIMMessage *)message;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+504
@@ -0,0 +1,504 @@
|
||||
//
|
||||
// NIMThreadTalkManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by He on 2020/3/27.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMChatManagerProtocol.h"
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMSession;
|
||||
@class NIMRecentSession;
|
||||
@class NIMThreadTalkFetchOption;
|
||||
@class NIMThreadTalkFetchResult;
|
||||
@class NIMChatExtendBasicInfo;
|
||||
@class NIMQuickComment;
|
||||
@class NIMCollectInfo;
|
||||
@class NIMCollectQueryOptions;
|
||||
@class NIMAddCollectParams;
|
||||
@class NIMSyncMessagePinResponse;
|
||||
@class NIMMessagePinItem;
|
||||
@class NIMStickTopSessionInfo;
|
||||
@class NIMSyncStickTopSessionResponse;
|
||||
@class NIMAddStickTopSessionParams;
|
||||
@class NIMSyncMessagePinRequest;
|
||||
@class NIMLoadRecentSessionsOptions;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 获取Thread Talk子消息回调
|
||||
*
|
||||
* @param error 请求结果
|
||||
* @param result 请求结果数据
|
||||
*/
|
||||
typedef void (^NIMThreadTalkFetchMessages) (NSError * _Nullable error, NIMThreadTalkFetchResult * _Nullable result);
|
||||
|
||||
/**
|
||||
* 获取Thread Talk子消息回调
|
||||
*
|
||||
* @param error 错误结果
|
||||
* @param result 子消息列表
|
||||
*/
|
||||
typedef void (^NIMFetchHistoryMessagesByIds) (NSError * _Nullable error, NSMapTable<NIMChatExtendBasicInfo *, NIMMessage *> * _Nullable result);
|
||||
|
||||
/**
|
||||
* 完成回调
|
||||
*
|
||||
* @param error 错误码
|
||||
*/
|
||||
typedef void (^NIMQuickCommentHandler) (NSError * _Nullable error);
|
||||
|
||||
/**
|
||||
* 本地获取快捷评论结果
|
||||
*
|
||||
* @param error 错误结果
|
||||
* @param result 获取结果
|
||||
*/
|
||||
typedef void (^NIMGetQuickCommentsByMsgHandler) (NSError * _Nullable error, NSMapTable<NSNumber *, NSArray<NIMQuickComment *> *> * _Nullable result);
|
||||
|
||||
/**
|
||||
* 批量获取
|
||||
*
|
||||
* @param error 结果
|
||||
* @param result 评论列表
|
||||
* @param failedMessages 查询失败的列表
|
||||
|
||||
*/
|
||||
typedef void (^NIMFetchCommentsByMsgsHandler) (NSError * _Nullable error, NSMapTable<NIMMessage *, NSArray<NIMQuickComment *> * > * _Nullable result, NSArray<NIMMessage *> * _Nullable failedMessages);
|
||||
|
||||
/**
|
||||
* 读取收藏列表回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param collectInfos 读取的消息列表
|
||||
* @param totalCount 收藏总条数,用来判断是否还有更多
|
||||
*/
|
||||
typedef void(^NIMCollectQueryBlock)(NSError * _Nullable error,
|
||||
NSArray<NIMCollectInfo *> * _Nullable collectInfos,
|
||||
NSInteger totalCount);
|
||||
|
||||
/**
|
||||
* 添加收藏回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param collectInfo 添加的收藏
|
||||
*/
|
||||
typedef void(^NIMAddCollectBlock)(NSError * _Nullable error, NIMCollectInfo * _Nullable collectInfo);
|
||||
|
||||
/**
|
||||
* 更新收藏回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param total_removed 删除的数量
|
||||
*/
|
||||
typedef void(^NIMRemoveCollectBlock)(NSError * _Nullable error, NSInteger total_removed);
|
||||
|
||||
/**
|
||||
* 移除收藏回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param collectInfo 更新后的收藏
|
||||
*/
|
||||
typedef void(^NIMUpdateCollectBlock)(NSError * _Nullable error, NIMCollectInfo * _Nullable collectInfo);
|
||||
|
||||
/**
|
||||
* 添加置顶会话回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param newInfo 被添加的置顶会话
|
||||
*/
|
||||
typedef void(^NIMAddStickTopSessionCompletion)(NSError * _Nullable error, NIMStickTopSessionInfo * _Nullable newInfo);
|
||||
|
||||
/**
|
||||
* 移除置顶会话回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param removedInfo 被删除的置顶信息
|
||||
*/
|
||||
typedef void(^NIMRemoveStickTopSessionCompletion)(NSError * _Nullable error, NIMStickTopSessionInfo * _Nullable removedInfo);
|
||||
|
||||
/**
|
||||
* 更新置顶会话回调block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param updatedInfo 更新后的置顶会话
|
||||
*/
|
||||
typedef void(^NIMUpdateStickTopSessionCompletion)(NSError * _Nullable error, NIMStickTopSessionInfo * _Nullable updatedInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 本地查找置顶会话回调block
|
||||
*
|
||||
* @param infos 所有本地置顶会话信息
|
||||
*/
|
||||
typedef void(^NIMLoadStickTopSessionInfosCompletion)(NSError * _Nullable error, NSDictionary<NIMSession*,NIMStickTopSessionInfo *> * _Nullable infos);
|
||||
|
||||
/**
|
||||
* 添加PIN记录的回调
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param item 新增的PIN记录
|
||||
*/
|
||||
typedef void(^NIMAddMessagePinCompletion)(NSError * _Nullable error, NIMMessagePinItem * _Nullable item);
|
||||
|
||||
/**
|
||||
* 移除Pin的回调
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param item 被移除的PIN记录
|
||||
*/
|
||||
typedef void(^NIMRemoveMessagePinCompletion)(NSError * _Nullable error, NIMMessagePinItem * _Nullable item);
|
||||
|
||||
/**
|
||||
* 更新PIN记录的回调
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param item 被更新的PIN记录
|
||||
*/
|
||||
typedef void(^NIMUpdateMessagePinCompletion)(NSError * _Nullable error, NIMMessagePinItem * _Nullable item);
|
||||
|
||||
/**
|
||||
* 增量更新PIN记录的回调
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param response 更新成功后的响应对象
|
||||
*/
|
||||
typedef void(^NIMSyncMessagePinCompletion)(NSError * _Nullable error, NIMSyncMessagePinResponse * _Nullable response);
|
||||
|
||||
/**
|
||||
* 加载PIN记录的回调
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param items 更新成功后的所有pin消息
|
||||
*/
|
||||
typedef void(^NIMLoadMessagePinsCompletion)(NSError * _Nullable error, NSArray<NIMMessagePinItem *> * _Nullable items);
|
||||
|
||||
/**
|
||||
* 查找最近会话回调
|
||||
* @param recentSessions 最近会话列表
|
||||
*/
|
||||
typedef void(^NIMLoadRecentSessionsCompletion)(NSError * _Nullable error, NSArray<NIMRecentSession *> * _Nullable recentSessions);
|
||||
|
||||
/**
|
||||
* Thread Talk 回调
|
||||
*/
|
||||
@protocol NIMChatExtendManagerDelegate <NSObject>
|
||||
|
||||
|
||||
#pragma mark - 快捷回复
|
||||
@optional
|
||||
|
||||
/**
|
||||
* 新增快捷评论
|
||||
*
|
||||
* @param comment 评论
|
||||
*/
|
||||
- (void)onRecvQuickComment:(NIMQuickComment *)comment;
|
||||
|
||||
/**
|
||||
* 移除快捷评论
|
||||
*
|
||||
* @param comment 被删评论
|
||||
*/
|
||||
- (void)onRemoveQuickComment:(NIMQuickComment *)comment;
|
||||
|
||||
/**
|
||||
* 一条PIN被增加的在线通知
|
||||
* @param item 新增的PIN记录
|
||||
*/
|
||||
- (void)onNotifyAddMessagePin:(NIMMessagePinItem *)item;
|
||||
|
||||
/**
|
||||
* 一条PIN被移除的在线通知
|
||||
* @param item 被移除的PIN记录
|
||||
*/
|
||||
- (void)onNotifyRemoveMessagePin:(NIMMessagePinItem *)item;
|
||||
|
||||
/**
|
||||
* 一条PIN被更新的在线通知
|
||||
* @param item 被更新的PIN记录
|
||||
*/
|
||||
- (void)onNotifyUpdateMessagePin:(NIMMessagePinItem *)item;
|
||||
|
||||
/**
|
||||
* 置顶会话同步完成的在线通知
|
||||
* @param response 置顶信息全量同步后的响应对象
|
||||
*/
|
||||
- (void)onNotifySyncStickTopSessions:(NIMSyncStickTopSessionResponse *)response;
|
||||
|
||||
/**
|
||||
* 一条置顶信息被增加的在线通知
|
||||
* @param newInfo 新增的置顶信息
|
||||
*/
|
||||
- (void)onNotifyAddStickTopSession:(NIMStickTopSessionInfo *)newInfo;
|
||||
|
||||
/**
|
||||
* 一条置顶信息被移除的在线通知
|
||||
* @param removedInfo 被移除的置顶信息
|
||||
*/
|
||||
- (void)onNotifyRemoveStickTopSession:(NIMStickTopSessionInfo *)removedInfo;
|
||||
|
||||
/**
|
||||
* 一条置顶会话被更新的在线通知
|
||||
* @param updatedInfo 被更新的置顶信息
|
||||
*/
|
||||
- (void)onNotifyUpdateStickTopSession:(NIMStickTopSessionInfo *)updatedInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 聊天扩展
|
||||
*/
|
||||
@protocol NIMChatExtendManager <NSObject>
|
||||
|
||||
#pragma mark - Thread Talk
|
||||
|
||||
/**
|
||||
* 回复消息
|
||||
*
|
||||
* @param message 新生成的消息
|
||||
* @param target 被回复的消息
|
||||
* @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
|
||||
*
|
||||
* @return 是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (BOOL)reply:(NIMMessage *)message
|
||||
to:(NIMMessage *)target
|
||||
error:(NSError * __nullable *)error;
|
||||
|
||||
/**
|
||||
* 异步回复消息
|
||||
*
|
||||
* @param message 新生成的消息
|
||||
* @param target 被回复的消息
|
||||
* @param block 发送完成后的回调,这里的回调完成只表示当前这个函数调用完成,需要后续的回调才能判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (void)reply:(NIMMessage *)message
|
||||
to:(NIMMessage *)target
|
||||
completion:(__nullable NIMChatManagerBlock)block;
|
||||
|
||||
/**
|
||||
* 本地获取Thread Talk的消息列表
|
||||
*
|
||||
* @param message 父消息
|
||||
* @return 目标message的子消息列表
|
||||
*/
|
||||
- (NSArray<NIMMessage *> * _Nullable)subMessages:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 本地获取Thread Talk的消息列表
|
||||
*
|
||||
* @param message 父消息
|
||||
* @return 目标message的子消息数目
|
||||
*/
|
||||
- (NSInteger)subMessagesCount:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 获取指定消息的Thread Talk子消息
|
||||
*
|
||||
* @param info 目标消息
|
||||
* @param option 查询分页选项
|
||||
* @param block 完成回调
|
||||
*/
|
||||
- (void)fetchSubMessages:(NIMChatExtendBasicInfo *)info
|
||||
option:(NIMThreadTalkFetchOption * _Nullable)option
|
||||
completion:(NIMThreadTalkFetchMessages)block;
|
||||
|
||||
/**
|
||||
* 获取指定消息的Thread Talk子消息
|
||||
*
|
||||
* @param message 目标消息
|
||||
* @param option 查询分页选项
|
||||
* @param block 完成回调
|
||||
*/
|
||||
- (void)fetchSubMessagesFrom:(NIMMessage *)message
|
||||
option:(NIMThreadTalkFetchOption * _Nullable)option
|
||||
completion:(NIMThreadTalkFetchMessages)block;
|
||||
|
||||
|
||||
/**
|
||||
* 根据MessageId等获取消息
|
||||
*
|
||||
* @param infos 请求信息
|
||||
* @param sync 是否同步到本地,注:DB标记状态删除的消息无法被同步覆盖
|
||||
* @param block 完成回调
|
||||
*/
|
||||
- (void)fetchHistoryMessages:(NSArray<NIMChatExtendBasicInfo *> *)infos
|
||||
syncToDB:(BOOL)sync
|
||||
completion:(NIMFetchHistoryMessagesByIds)block;
|
||||
|
||||
|
||||
#pragma mark - 快捷回复
|
||||
/**
|
||||
* 发送快捷回复
|
||||
*
|
||||
* @param comment 回复内容
|
||||
* @param message 被回复消息
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)addQuickComment:(NIMQuickComment *)comment
|
||||
toMessage:(NIMMessage *)message
|
||||
completion:(NIMQuickCommentHandler _Nullable)completion;
|
||||
|
||||
/**
|
||||
* 从服务端删除一条评论
|
||||
*
|
||||
* @param comment 目标评论
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)deleteQuickComment:(NIMQuickComment *)comment
|
||||
completion:(NIMQuickCommentHandler _Nullable)completion;
|
||||
|
||||
/**
|
||||
* 批量获取快捷评论
|
||||
*
|
||||
* @param messages 目标消息, 最多批量20个
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)fetchQuickComments:(NSArray<NIMMessage *> *)messages
|
||||
completion:(NIMFetchCommentsByMsgsHandler)completion;
|
||||
|
||||
/**
|
||||
* 本地获取消息对应的快捷评论结果
|
||||
*
|
||||
* @param message 目标消息
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)quickCommentsByMessage:(NIMMessage *)message
|
||||
completion:(NIMGetQuickCommentsByMsgHandler)completion;
|
||||
|
||||
|
||||
#pragma mark - 收藏
|
||||
/**
|
||||
* 分页查询收藏列表
|
||||
* @param option 分页查询选项
|
||||
* @param completion 查询完成的回调
|
||||
*/
|
||||
- (void)queryCollect:(NIMCollectQueryOptions *)option completion:(nullable NIMCollectQueryBlock)completion;
|
||||
|
||||
/**
|
||||
* 添加一个收藏
|
||||
* @param info 添加收藏的参数,必须字段:type、data、ext
|
||||
* @param completion 添加完成的回调
|
||||
*/
|
||||
- (void)addCollect:(NIMAddCollectParams *)info completion:(nullable NIMAddCollectBlock)completion;
|
||||
|
||||
/**
|
||||
* 批量移除收藏
|
||||
* @param collectList 批量移除的收藏对象,必须字段:id、createTime
|
||||
* @param completion 移除完成的回调
|
||||
*/
|
||||
- (void)removeCollect:(NSArray<NIMCollectInfo *> *)collectList completion:(nullable NIMRemoveCollectBlock)completion;
|
||||
|
||||
/**
|
||||
* 更新收藏ext
|
||||
* @param collectInfo 需要更新的收藏对象,需要id、createTime、ext字段,如果ext不传,表示删除ext字段
|
||||
*/
|
||||
- (void)updateCollect:(NIMCollectInfo *)collectInfo completion:(nullable NIMUpdateCollectBlock)completion;
|
||||
|
||||
#pragma mark - 置顶
|
||||
|
||||
/**
|
||||
* 添加一条置顶记录
|
||||
* @param params 添加置顶的参数
|
||||
* @param completion 添加置顶记录完成的回调
|
||||
*/
|
||||
- (void)addStickTopSession:(NIMAddStickTopSessionParams *)params completion:(nullable NIMAddStickTopSessionCompletion)completion;
|
||||
|
||||
/**
|
||||
* 删除一条置顶记录
|
||||
* @param info 需要删除的置顶记录
|
||||
* @param completion 删除完成的回调
|
||||
*/
|
||||
- (void)removeStickTopSession:(NIMStickTopSessionInfo *)info completion:(nullable NIMRemoveStickTopSessionCompletion)completion;
|
||||
|
||||
/**
|
||||
* 更新一条置顶记录的扩展信息
|
||||
* @param info 需要更新的置顶记录
|
||||
* @param completion 删除完成的回调
|
||||
*/
|
||||
- (void)udpateStickTopSession:(NIMStickTopSessionInfo *)info completion:(nullable NIMUpdateStickTopSessionCompletion)completion;
|
||||
|
||||
/**
|
||||
* 查找所有的置顶记录
|
||||
* @param completion 查找完成的回调
|
||||
*/
|
||||
- (void)loadStickTopSessionInfos:(nullable NIMLoadStickTopSessionInfosCompletion)completion;
|
||||
|
||||
/**
|
||||
* 获取最近会话列表
|
||||
* @param options 查询选项(如按照置顶会话排序)
|
||||
*/
|
||||
- (void)loadRecentSessionsWithOptions:(NIMLoadRecentSessionsOptions *)options completion:(nullable NIMLoadRecentSessionsCompletion)completion;
|
||||
|
||||
/**
|
||||
* 根据置顶信息排序最近会话
|
||||
* @param recentSessions 需要排序的置顶会话,若传可变数组则进行in place排序
|
||||
* @param infos [会话:置顶信息] 映射
|
||||
* @return 排序后的最近会话列表,若传如可变数组,则返回其数组本身
|
||||
*/
|
||||
- (NSArray<NIMRecentSession *> *)sortRecentSessions:(NSArray<NIMRecentSession *> *)recentSessions withStickTopInfos:(NSDictionary<NIMSession *,NIMStickTopSessionInfo *> *)infos;
|
||||
|
||||
/**
|
||||
* 查询某个会话的置顶信息
|
||||
* @param session 需要查询的会话
|
||||
* @return 置顶信息
|
||||
*/
|
||||
- (NIMStickTopSessionInfo *)stickTopInfoForSession:(NIMSession *)session;
|
||||
|
||||
#pragma mark - Pin
|
||||
|
||||
/**
|
||||
* 添加一条PIN记录
|
||||
* @param item 需要添加的PIN记录
|
||||
* @param completion 添加完成的回调
|
||||
*/
|
||||
- (void)addMessagePin:(NIMMessagePinItem *)item completion:(nullable NIMAddMessagePinCompletion)completion;
|
||||
|
||||
/**
|
||||
* 删除一条PIN记录
|
||||
* @param item 需要删除的PIN记录
|
||||
* @param completion 删除完成的回调
|
||||
*/
|
||||
- (void)removeMessagePin:(NIMMessagePinItem *)item completion:(nullable NIMRemoveMessagePinCompletion)completion;
|
||||
|
||||
/**
|
||||
* 更新一条PIN记录的扩展字段(ext)
|
||||
* @param item 需要更新的PIN记录,ext不传为删除
|
||||
* @param completion 更新完成的回调
|
||||
*/
|
||||
- (void)updateMessagePin:(NIMMessagePinItem *)item completion:(nullable NIMUpdateMessagePinCompletion)completion;
|
||||
|
||||
/**
|
||||
* 查询全部PIN记录(登录后首次查询该会话会触发一次网络同步)
|
||||
* @param session 会话
|
||||
* @param completion 加载完成的回调
|
||||
*/
|
||||
- (void)loadMessagePinsForSession:(NIMSession *)session completion:(nullable NIMLoadMessagePinsCompletion)completion;
|
||||
|
||||
/**
|
||||
* 查询某条消息的PIN记录
|
||||
* @param message 消息
|
||||
* @return 记录
|
||||
*/
|
||||
- (NIMMessagePinItem *)pinItemForMessage:(NIMMessage *)message;
|
||||
|
||||
#pragma mark - 其他
|
||||
/**
|
||||
|
||||
* 添加Thread Talk委托
|
||||
*
|
||||
* @param delegate 聊天委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMChatExtendManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除Thread Talk委托
|
||||
*
|
||||
* @param delegate 聊天委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMChatExtendManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,411 @@
|
||||
//
|
||||
// NIMChatManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMSession;
|
||||
@class NIMMessageReceipt;
|
||||
@class NIMRevokeMessageNotification;
|
||||
@class NIMTeamMessageReceiptDetail;
|
||||
@class NIMRevokeMessageOption;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* P2P 发送已读回执 Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
*/
|
||||
typedef void(^NIMSendMessageReceiptBlock)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* Team 发送已读回执 Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
* @param failedReceipts 失败的回执
|
||||
*/
|
||||
typedef void(^NIMSendTeamMessageReceiptsBlock)(NSError * __nullable error,NSArray<NIMMessageReceipt *> * __nullable failedReceipts);
|
||||
|
||||
/**
|
||||
* 撤回消息Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
*/
|
||||
typedef void(^NIMRevokeMessageBlock)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 查询群组消息回执详情Block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param detail 已读回执详情
|
||||
*/
|
||||
typedef void(^NIMQueryReceiptDetailBlock)(NSError * __nullable error,NIMTeamMessageReceiptDetail * __nullable detail);
|
||||
|
||||
|
||||
/**
|
||||
* 操作完成回调
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
*/
|
||||
typedef void(^NIMChatManagerBlock)(NSError * __nullable error);
|
||||
|
||||
|
||||
/**
|
||||
* 聊天委托
|
||||
*/
|
||||
@protocol NIMChatManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/**
|
||||
* 即将发送消息回调
|
||||
* @discussion 因为发消息之前可能会有个准备过程,所以需要在收到这个回调时才将消息加入到 Datasource 中
|
||||
* @param message 当前发送的消息
|
||||
*/
|
||||
- (void)willSendMessage:(NIMMessage *)message;
|
||||
|
||||
|
||||
/**
|
||||
* 上传资源文件成功的回调
|
||||
* @discussion 对于需要上传资源的消息(图片,视频,音频等),SDK 将在上传资源成功后通过这个接口进行回调,上层可以在收到该回调后进行推送信息的重新配置 (APNS payload)
|
||||
* @param urlString 当前消息资源获得的 url 地址
|
||||
* @param message 当前发送的消息
|
||||
*/
|
||||
- (void)uploadAttachmentSuccess:(NSString *)urlString
|
||||
forMessage:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 发送消息进度回调
|
||||
*
|
||||
* @param message 当前发送的消息
|
||||
* @param progress 进度
|
||||
*/
|
||||
- (void)sendMessage:(NIMMessage *)message
|
||||
progress:(float)progress;
|
||||
|
||||
|
||||
/**
|
||||
* 发送消息完成回调
|
||||
*
|
||||
* @param message 当前发送的消息
|
||||
* @param error 失败原因,如果发送成功则error为nil
|
||||
*/
|
||||
- (void)sendMessage:(NIMMessage *)message
|
||||
didCompleteWithError:(nullable NSError *)error;
|
||||
|
||||
|
||||
/**
|
||||
* 收到消息回调
|
||||
*
|
||||
* @param messages 消息列表,内部为NIMMessage
|
||||
*/
|
||||
- (void)onRecvMessages:(NSArray<NIMMessage *> *)messages;
|
||||
|
||||
/**
|
||||
* 收到消息回执
|
||||
*
|
||||
* @param receipts 消息回执数组
|
||||
* @discussion 当上层收到此消息时所有的存储和 model 层业务都已经更新,只需要更新 UI 即可。
|
||||
*/
|
||||
- (void)onRecvMessageReceipts:(NSArray<NIMMessageReceipt *> *)receipts;
|
||||
|
||||
|
||||
/**
|
||||
* 收到消息被撤回的通知
|
||||
*
|
||||
* @param notification 被撤回的消息信息
|
||||
* @discusssion 云信在收到消息撤回后,会先从本地数据库中找到对应消息并进行删除,之后通知上层消息已删除
|
||||
*/
|
||||
- (void)onRecvRevokeMessageNotification:(NIMRevokeMessageNotification *)notification;
|
||||
|
||||
|
||||
/**
|
||||
* 收取消息附件回调
|
||||
* @param message 当前收取的消息
|
||||
* @param progress 进度
|
||||
* @discussion 附件包括:图片,视频的缩略图,语音文件
|
||||
*/
|
||||
- (void)fetchMessageAttachment:(NIMMessage *)message
|
||||
progress:(float)progress;
|
||||
|
||||
|
||||
/**
|
||||
* 收取消息附件完成回调
|
||||
*
|
||||
* @param message 当前收取的消息
|
||||
* @param error 错误返回,如果收取成功,error为nil
|
||||
*/
|
||||
- (void)fetchMessageAttachment:(NIMMessage *)message
|
||||
didCompleteWithError:(nullable NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 聊天协议
|
||||
*/
|
||||
@protocol NIMChatManager <NSObject>
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param message 消息
|
||||
* @param session 接受方
|
||||
* @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
|
||||
*
|
||||
* @return 是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (BOOL)sendMessage:(NIMMessage *)message
|
||||
toSession:(NIMSession *)session
|
||||
error:(NSError * __nullable *)error;
|
||||
|
||||
|
||||
/**
|
||||
* 异步发送消息
|
||||
*
|
||||
* @param message 消息
|
||||
* @param session 接收方
|
||||
* @param completion 发送完成后的回调,这里的回调完成只表示当前这个函数调用完成,需要后续的回调才能判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (void)sendMessage:(NIMMessage *)message
|
||||
toSession:(NIMSession *)session
|
||||
completion:(__nullable NIMChatManagerBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 取消正在发送的消息
|
||||
*
|
||||
* @param message 目标消息
|
||||
* @return 是否调用成功
|
||||
*/
|
||||
- (BOOL)cancelSendingMessage:(NIMMessage *)message;
|
||||
|
||||
|
||||
/**
|
||||
* 重发消息
|
||||
*
|
||||
* @param message 重发消息
|
||||
* @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
|
||||
*
|
||||
* @return 是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (BOOL)resendMessage:(NIMMessage *)message
|
||||
error:(NSError * __nullable *)error;
|
||||
|
||||
|
||||
/**
|
||||
* 生成转发消息
|
||||
* 得到转发消息后,开发者需要自己再调用sendForwardMessage:toSession:error: 进行发送, 和 直接调用forwardMessage:toSession:error:效果一样,但是这样可以得到转发消息的进度方法回调和是否转发成功方法回调
|
||||
*
|
||||
* @param message 要转发的消息
|
||||
* @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
|
||||
*
|
||||
* @return 生成的需要转发的消息
|
||||
*/
|
||||
- (NIMMessage *)makeForwardMessageFromMessage:(NIMMessage *)message
|
||||
error:(NSError *__autoreleasing _Nullable * _Nullable)error;
|
||||
|
||||
/**
|
||||
* 发送生成的转发消息
|
||||
*
|
||||
* @param message 转发消息
|
||||
* @param session 接受方
|
||||
* @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
|
||||
*
|
||||
* @return 是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (BOOL)sendForwardMessage:(NIMMessage *)message
|
||||
toSession:(NIMSession *)session
|
||||
error:(NSError * __nullable *)error;
|
||||
|
||||
/**
|
||||
* 转发消息
|
||||
*
|
||||
* @param message 消息
|
||||
* @param session 接收方
|
||||
* @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
|
||||
*
|
||||
* @return 是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器
|
||||
*/
|
||||
- (BOOL)forwardMessage:(NIMMessage *)message
|
||||
toSession:(NIMSession *)session
|
||||
error:(NSError * __nullable *)error;
|
||||
|
||||
|
||||
/**
|
||||
* 发送已读回执 (P2P)
|
||||
*
|
||||
* @param receipt 已读回执
|
||||
* @param completion 完成回调
|
||||
* @discussion 此接口仅适用于 P2P 消息,群消息已读回执使用 sendTeamMessageReceipts:completion 如果已有比当前已读回执时间戳更大的已读回执已确认,则接口返回成功。
|
||||
*/
|
||||
- (void)sendMessageReceipt:(NIMMessageReceipt *)receipt
|
||||
completion:(nullable NIMSendMessageReceiptBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 发送已读回执 (Team 批量接口)
|
||||
*
|
||||
* @param receipts 已读回执 receipts count 最多不超过50个
|
||||
* @param completion 完成回调
|
||||
* @discussion 此接口仅适用于 Team 消息。
|
||||
*/
|
||||
- (void)sendTeamMessageReceipts:(NSArray<NIMMessageReceipt *> *)receipts
|
||||
completion:(nullable NIMSendTeamMessageReceiptsBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 刷新群组消息已读、未读数量
|
||||
*
|
||||
* @param messages 要查询的消息集合
|
||||
* @discussion 消息已读变化后,会通过 NIMChatManager 的代理 onRecvMessageReceipts: 回调给上层
|
||||
* 刷新的消息必须为群组消息
|
||||
*/
|
||||
- (void)refreshTeamMessageReceipts:(NSArray<NIMMessage *> *)messages;
|
||||
|
||||
|
||||
/**
|
||||
* 查询群组消息回执详情
|
||||
*
|
||||
* @param message 要查询的消息
|
||||
* @param completion 完成后的回调
|
||||
* @discussion 详情包括已读人数的 id 列表和未读人数的 id 列表
|
||||
* 查询详情对象不会跟着回执人数变化而变化,如果要获取最新的详情,必须再次调用此接口
|
||||
*
|
||||
*/
|
||||
- (void)queryMessageReceiptDetail:(NIMMessage *)message
|
||||
completion:(NIMQueryReceiptDetailBlock)completion;
|
||||
/**
|
||||
* 查询群组消息指定用户的回执详情
|
||||
*
|
||||
* @param message 待查询的消息
|
||||
* @param accountSet 指定的用户的账号组成的NSSet
|
||||
* @return 该消息的已读、未读账号列表
|
||||
*/
|
||||
- (void)queryMessageReceiptDetail:(NIMMessage *)message
|
||||
accountSet:(NSSet *)accountSet
|
||||
completion:(NIMQueryReceiptDetailBlock)completion;
|
||||
|
||||
/**
|
||||
* 从本地数据库查询单条群组消息已读、未读账号列表
|
||||
* 注意!!!:这里获取的数据通常比离线前的列表信息更陈旧
|
||||
*
|
||||
* @param message 待查询的消息
|
||||
* @return 该消息的已读、未读账号列表
|
||||
*/
|
||||
- (nullable NIMTeamMessageReceiptDetail *)localMessageReceiptDetail:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 从本地数据库查询单条群组消息在指定用户中的已读、未读账号列表(同步接口)
|
||||
* 注意!!!:这里获取的数据通常比离线前的列表信息更陈旧
|
||||
*
|
||||
* @param message 待查询的消息
|
||||
* @param accountSet 指定的用户的账号组成的NSSet
|
||||
* @return 该消息的已读、未读账号列表
|
||||
*/
|
||||
- (nullable NIMTeamMessageReceiptDetail *)localMessageReceiptDetail:(NIMMessage *)message
|
||||
accountSet:(NSSet *)accountSet;
|
||||
|
||||
/**
|
||||
* 撤回消息,不含推送信息
|
||||
*
|
||||
* @param message 需要被撤回的消息
|
||||
* @param completion 完成回调
|
||||
* @discussion 消息计入未读数
|
||||
*/
|
||||
- (void)revokeMessage:(NIMMessage *)message
|
||||
completion:(nullable NIMRevokeMessageBlock)completion;
|
||||
|
||||
/**
|
||||
* 撤回消息
|
||||
*
|
||||
* @param message 需要被撤回的消息
|
||||
* @param apnsContent 云信推送内容,长度限制500字
|
||||
* @param apnsPayload 云信推送payload信息,长度限制 2K
|
||||
* @param should 是否计入未读数
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)revokeMessage:(NIMMessage *)message
|
||||
apnsContent:(nullable NSString *)apnsContent
|
||||
apnsPayload:(nullable NSDictionary *)apnsPayload
|
||||
shouldBeCounted:(BOOL)should
|
||||
completion:(nullable NIMRevokeMessageBlock)completion;
|
||||
|
||||
/**
|
||||
* 撤回消息
|
||||
*
|
||||
* @param message 需要被撤回的消息
|
||||
* @param option 撤回的配置选项
|
||||
* @param completion 完成回调
|
||||
* @discussion 消息计入未读数
|
||||
*/
|
||||
- (void)revokeMessage:(NIMMessage *)message
|
||||
option:(NIMRevokeMessageOption *)option
|
||||
completion:(nullable NIMRevokeMessageBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 收取消息附件
|
||||
*
|
||||
* @param message 需要收取附件的消息
|
||||
* @param error 错误
|
||||
*
|
||||
* @return 是否调用成功
|
||||
* @discussion 附件包括:图片消息的图片缩略图,视频消息的视频缩略图,音频消息的音频文件,文件消息的文件以及自定义消息中的自定义文件
|
||||
* 个人和群组消息 SDK 会在收到该消息时自动调用本接口,自动下载除 "文件消息的文件" 外的所有附件内容
|
||||
*
|
||||
*/
|
||||
- (BOOL)fetchMessageAttachment:(NIMMessage *)message
|
||||
error:(NSError * __nullable *)error;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 取消收取消息附件
|
||||
*
|
||||
* @param message 需要取消收取附件的消息
|
||||
*
|
||||
* @discussion 附件包括:图片消息的图片缩略图,视频消息的视频缩略图,音频消息的音频文件,文件消息的文件以及自定义消息中的自定义文件
|
||||
* 个人和群组消息。SDK 不会触发任何下载回调
|
||||
*/
|
||||
- (void)cancelFetchingMessageAttachment:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 消息是否正在传输 (发送/接受附件)
|
||||
*
|
||||
* @param message 消息
|
||||
*
|
||||
* @return 是否正在传输
|
||||
*/
|
||||
- (BOOL)messageInTransport:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 传输消息的进度 (发送/接受附件)
|
||||
*
|
||||
* @param message 消息
|
||||
*
|
||||
* @return 正在传输的消息进度,如果消息不在传输,则返回0
|
||||
*/
|
||||
- (float)messageTransportProgress:(NIMMessage *)message;
|
||||
|
||||
/**
|
||||
* 添加聊天委托
|
||||
*
|
||||
* @param delegate 聊天委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMChatManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除聊天委托
|
||||
*
|
||||
* @param delegate 聊天委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMChatManagerDelegate>)delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// NIMChatroom.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 聊天室队列修改权限
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomQueueModificationLevel){
|
||||
/**
|
||||
* 所有人都可以修改聊天室队列
|
||||
*/
|
||||
NIMChatroomQueueModificationLevelAnyone,
|
||||
/**
|
||||
* 只有管理员可以修改聊天室队列
|
||||
*/
|
||||
NIMChatroomQueueModificationLevelManager,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室
|
||||
*/
|
||||
@interface NIMChatroom : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室Id
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 聊天室名
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *name;
|
||||
|
||||
/**
|
||||
* 公告
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *announcement;
|
||||
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *creator;
|
||||
|
||||
|
||||
/**
|
||||
* 第三方扩展字段,长度限制4K
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *ext;
|
||||
|
||||
/**
|
||||
* 当前在线用户数量
|
||||
*/
|
||||
@property (nonatomic,assign) NSInteger onlineUserCount;
|
||||
|
||||
/**
|
||||
* 直播拉流地址
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *broadcastUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室队列修改权限等级
|
||||
*/
|
||||
@property (nonatomic,assign) NIMChatroomQueueModificationLevel queueModificationLevel;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室是否正在全员禁言标记,禁言后只有管理员可以发言
|
||||
*/
|
||||
- (BOOL)inAllMuteMode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMChatroomBeKickedResult.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2018年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMChatroomManagerProtocol.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 聊天室被踢结果
|
||||
*/
|
||||
@interface NIMChatroomBeKickedResult : NSObject
|
||||
|
||||
/**
|
||||
* 被踢的聊天室 Id
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 被踢的原因
|
||||
*/
|
||||
@property (nonatomic, assign) NIMChatroomKickReason reason;
|
||||
|
||||
/**
|
||||
* 被踢的扩展字段
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *ext;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// NIMChatroomCdnTrackInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/7/8.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMChatroomCdnTrackInfo : NSObject
|
||||
|
||||
/**
|
||||
* 基础信息
|
||||
* s: 成功次数
|
||||
* f: 失败次数
|
||||
* sr: 成功平均响应时间(s)
|
||||
* fr:失败平均响应时间(s)
|
||||
* smr:成功最大响应时间(s)
|
||||
* fmr:失败最大响应时间(s)
|
||||
* 例: {
|
||||
"cdn.netease.com": {
|
||||
"s": 10,
|
||||
"f": 5,
|
||||
"sr": 0.3,
|
||||
"fr": 0.2,
|
||||
"smr": 0.5,
|
||||
"fmr": 0.3
|
||||
}
|
||||
* }
|
||||
*/
|
||||
@property (nonatomic, copy) NSDictionary *baseInfo;
|
||||
|
||||
/**
|
||||
* 总共失败次数
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger finalFailureCount;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,186 @@
|
||||
//
|
||||
// NIMChatroomEnterRequest.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMChatroomManagerProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取聊天室地址回调
|
||||
*/
|
||||
typedef void(^NIMRequestChatroomAddressesCallback)(NSError * __nullable error,NSArray<NSString *> * __nullable addresses);
|
||||
|
||||
/**
|
||||
* 获取聊天室地址方法
|
||||
*/
|
||||
typedef void(^NIMRequestChatroomAddressesHandler)(NSString *roomId,NIMRequestChatroomAddressesCallback callback);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室独立模式
|
||||
*/
|
||||
@interface NIMChatroomIndependentMode : NSObject
|
||||
|
||||
/**
|
||||
* 独立模式下的用户名
|
||||
* @discussion 设置为 nil 情况下,SDK 将使用匿名账号进行登录。在匿名模式下,NIMChatroomEnterRequest 必须设置昵称和头像信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *username;
|
||||
|
||||
/**
|
||||
* 如果username为nil,则使用匿名登录,此变量决定了匿名账号。如果为nil,则由SDK自动生成
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *anonName;
|
||||
|
||||
/**
|
||||
* 独立模式下的 Token
|
||||
* @discussion 当用户名为空时,token 无效
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *token;
|
||||
|
||||
/**
|
||||
* 聊天室 AppKey, 可选填, 如果不填则使用云信IM AppKey
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *chatroomAppKey;
|
||||
|
||||
/**
|
||||
* 注册获取聊天室地址的回调方法
|
||||
*
|
||||
* @param handler 获取聊天室地址信息的方法
|
||||
* @discussion 在进入聊天室和刷新聊天室 IP 时,SDK 都会主动调用这个回调方法,并传入相应的两个参数 `roomId` 和 `callback`。
|
||||
* 当前回调接口要求上层使用 `roomId` 走自己的网络请求获取对应聊天室地址并通过 callback 回调给 SDK。
|
||||
* 需要注意的是无论请求是否成功,都需要通过 callback 进行回调,否则进入聊天室请求将会一直等待。同时此接口只需注册一次即可,多次注册将使用后者覆盖前者。
|
||||
*
|
||||
* 参考代码:
|
||||
*
|
||||
* [NIMChatroomIndependentMode registerRequestChatroomAddressesHandler:^(NSString * _Nonnull roomId, NIMRequestChatroomAddressesCallback _Nonnull callback) {
|
||||
* [YourHTTPService request:roomId completion:^(NSError *error,NSArray *addresses)
|
||||
* {
|
||||
* //无论请求是否成功,都需要进行回调
|
||||
* if(callback)
|
||||
* {
|
||||
* callback(error,addresses);
|
||||
* }
|
||||
* }];
|
||||
* }];
|
||||
*
|
||||
*/
|
||||
+ (void)registerRequestChatroomAddressesHandler:(NIMRequestChatroomAddressesHandler)handler;
|
||||
|
||||
@end
|
||||
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomLoginAuthType) {
|
||||
NIMChatroomLoginAuthTypeDefault = 0,
|
||||
NIMChatroomLoginAuthTypeDynamicToken = 1,
|
||||
NIMChatroomLoginAuthTypeThirdPart = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* 进入聊天室请求
|
||||
*/
|
||||
@interface NIMChatroomEnterRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室Id
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 聊天室昵称
|
||||
* @discussion 上层可以自主设置在聊天室内的昵称,没有设置则使用用户本身的信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomNickname;
|
||||
|
||||
/**
|
||||
* 聊天室头像
|
||||
* @discussion 上层可以自主设置在聊天室内的头像,没有设置则使用用户本身的信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomAvatar;
|
||||
|
||||
/**
|
||||
* 本人的聊天室成员信息拓展字段,仅对当次进入有效
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomExt;
|
||||
/**
|
||||
* 聊天室事件通知拓展字段
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomNotifyExt;
|
||||
/**
|
||||
* 登录标签,可以设置多个,json_array格式,例子:["tag1", "tag2"]
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *tags;
|
||||
/**
|
||||
* 登录登出通知的目标标签,是一个标签表达式,见TagCalculator和TagPattern
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyTargetTags;
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室重连次数,默认为三次
|
||||
* @discussion 设置成 0 后一旦一次连接失败后,SDK 将不在重试。 APP 可以根据自己的需求进行设置
|
||||
*/
|
||||
@property (nonatomic,assign) NSInteger retryCount;
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室独立模式
|
||||
* @discussion 默认为 nil,即聊天室登录需要依赖 IM 登录,只有 IM 登录后才能够登录聊天室。设置后可以在不依赖 IM 通道的情况下进行登录
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMChatroomIndependentMode *mode;
|
||||
|
||||
/**
|
||||
* 鉴权方式
|
||||
*/
|
||||
@property (nonatomic, assign) NIMChatroomLoginAuthType loginAuthType;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NSString *loginExt;
|
||||
|
||||
/**
|
||||
* 动态token回调
|
||||
*/
|
||||
@property (nonatomic, strong) NIMProvideChatroomDynamicTokenHandler dynamicTokenHandler;
|
||||
|
||||
/**
|
||||
* 坐标x
|
||||
*/
|
||||
@property (nonatomic, strong) NSDecimalNumber *locationX;
|
||||
|
||||
/**
|
||||
* 坐标y
|
||||
*/
|
||||
@property (nonatomic, strong) NSDecimalNumber *locationY;
|
||||
|
||||
/**
|
||||
* 坐标z
|
||||
*/
|
||||
@property (nonatomic, strong) NSDecimalNumber *locationZ;
|
||||
|
||||
/**
|
||||
* 订阅的消息的距离
|
||||
*/
|
||||
@property (nonatomic, strong) NSDecimalNumber *distance;
|
||||
|
||||
/**
|
||||
* 对某些资料内容另外的反垃圾的业务ID
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *antispamBusinessId;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+492
@@ -0,0 +1,492 @@
|
||||
//
|
||||
// NIMChatroomManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMChatroom;
|
||||
@class NIMChatroomEnterRequest;
|
||||
@class NIMChatroomUpdateRequest;
|
||||
@class NIMChatroomMemberInfoUpdateRequest;
|
||||
@class NIMChatroomMember;
|
||||
@class NIMChatroomMemberRequest;
|
||||
@class NIMChatroomMemberUpdateRequest;
|
||||
@class NIMChatroomMemberKickRequest;
|
||||
@class NIMChatroomMembersByIdsRequest;
|
||||
@class NIMChatroomQueueUpdateRequest;
|
||||
@class NIMChatroomQueueRemoveRequest;
|
||||
@class NIMChatroomQueueBatchUpdateRequest;
|
||||
@class NIMHistoryMessageSearchOption;
|
||||
@class NIMChatroomBeKickedResult;
|
||||
@class NIMChatroomTempMuteTagRequest;
|
||||
@class NIMChatroomFetchMembersByTagRequest;
|
||||
@class NIMChatroomQueryMembersCountByTagRequest;
|
||||
@class NIMChatroomLocation;
|
||||
@class NIMChatroomTagsUpdate;
|
||||
@class NIMGetMessagesByTagsParam;
|
||||
@class NIMChatroomTagsUpdateEvent;
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室网络请求回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
*/
|
||||
typedef void(^NIMChatroomHandler)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 聊天室成员请求回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param member 更新后的聊天室成员信息
|
||||
*/
|
||||
typedef void(^NIMChatroomMemberHandler)(NSError * __nullable error,NIMChatroomMember * __nullable member);
|
||||
|
||||
/**
|
||||
* 进入聊天室请求回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param chatroom 聊天室信息
|
||||
* @param me 自己在聊天室内的信息
|
||||
*/
|
||||
typedef void(^NIMChatroomEnterHandler)(NSError * __nullable error,NIMChatroom * __nullable chatroom,NIMChatroomMember * __nullable me);
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室信息请求回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param chatroom 聊天室信息
|
||||
*/
|
||||
typedef void(^NIMChatroomInfoHandler)(NSError * __nullable error,NIMChatroom * __nullable chatroom);
|
||||
|
||||
/**
|
||||
* 聊天室成员组网络数据回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
*/
|
||||
typedef void(^NIMChatroomMembersHandler)(NSError * __nullable error, NSArray<NIMChatroomMember *> * __nullable members);
|
||||
|
||||
/**
|
||||
* 聊天室成员数量数量回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
*/
|
||||
typedef void(^NIMChatroomMembersCountHandler)(NSError * __nullable error, uint64_t count);
|
||||
|
||||
/**
|
||||
* 聊天室队列数据回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
*/
|
||||
typedef void(^NIMChatroomQueueInfoHandler)(NSError * __nullable error, NSArray<NSDictionary<NSString *, NSString *> *> * __nullable info);
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室队列移除元素回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
*/
|
||||
typedef void(^NIMChatroomQueueRemoveHandler)(NSError * __nullable error, NSDictionary<NSString *, NSString *> * __nullable element);
|
||||
|
||||
|
||||
/**
|
||||
聊天室队列批量更新元素回调
|
||||
|
||||
@param error 错误信息
|
||||
@param elements 不存在的元素elementKey列表
|
||||
*/
|
||||
typedef void(^NIMChatroomQueueBatchUpdateHandler)(NSError * __nullable error, NSArray<NSString *> * __nullable elements);
|
||||
|
||||
|
||||
/**
|
||||
* 拉取服务器聊天消息记录block
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param messages 读取的消息列表
|
||||
*/
|
||||
typedef void(^NIMFetchChatroomHistoryBlock)(NSError * __nullable error,NSArray<NIMMessage *> * __nullable messages);
|
||||
|
||||
|
||||
/**
|
||||
* 根据标签拉取服务器聊天消息记录的回调
|
||||
*
|
||||
* @param error 错误,如果成功则error为nil
|
||||
* @param messages 读取的消息列表
|
||||
*/
|
||||
typedef void(^NIMGetMessagesByTagsHandler)(NSError * __nullable error,NSArray<NIMMessage *> * __nullable messages);
|
||||
|
||||
/**
|
||||
* 聊天室动态token block
|
||||
*/
|
||||
typedef NSString*(^NIMProvideChatroomDynamicTokenHandler)(NSString * __nullable roomId, NSString * __nullable account);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室连接状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomConnectionState) {
|
||||
/**
|
||||
* 正在进入
|
||||
*/
|
||||
NIMChatroomConnectionStateEntering = 0,
|
||||
/**
|
||||
* 进入聊天室成功
|
||||
*/
|
||||
NIMChatroomConnectionStateEnterOK = 1,
|
||||
/**
|
||||
* 进入聊天室失败
|
||||
*/
|
||||
NIMChatroomConnectionStateEnterFailed = 2,
|
||||
/**
|
||||
* 和聊天室失去连接
|
||||
*/
|
||||
NIMChatroomConnectionStateLoseConnection = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* 聊天室被踢原因
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomKickReason) {
|
||||
/**
|
||||
* 聊天室已经解散
|
||||
*/
|
||||
NIMChatroomKickReasonInvalidRoom = 1,
|
||||
/**
|
||||
* 被聊天室管理员踢出
|
||||
*/
|
||||
NIMChatroomKickReasonByManager = 2,
|
||||
/**
|
||||
* 多端被踢
|
||||
*/
|
||||
NIMChatroomKickReasonByConflictLogin = 3,
|
||||
/**
|
||||
* 被拉黑
|
||||
*/
|
||||
NIMChatroomKickReasonBlacklist = 5,
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室管理器回调
|
||||
*/
|
||||
@protocol NIMChatroomManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/**
|
||||
* 被踢回调
|
||||
*
|
||||
* @param result 被踢的结果详情
|
||||
*/
|
||||
- (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result;
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室连接状态变化
|
||||
*
|
||||
* @param roomId 聊天室Id
|
||||
* @param state 当前状态
|
||||
*/
|
||||
- (void)chatroom:(NSString *)roomId connectionStateChanged:(NIMChatroomConnectionState)state;
|
||||
|
||||
/**
|
||||
* 聊天室自动登录出错
|
||||
*
|
||||
* @param roomId 聊天室Id
|
||||
* @param error 自动登录出错原因
|
||||
*/
|
||||
- (void)chatroom:(NSString *)roomId autoLoginFailed:(NSError *)error;
|
||||
|
||||
/**
|
||||
* 我的标签修改通知
|
||||
* @param event 修改通知
|
||||
*/
|
||||
- (void)tagsUpdate:(NIMChatroomTagsUpdateEvent *)event;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 聊天室管理器
|
||||
*/
|
||||
@protocol NIMChatroomManager <NSObject>
|
||||
|
||||
/**
|
||||
* 进入聊天室
|
||||
*
|
||||
* @param request 进入聊天室请求
|
||||
* @param completion 进入完成后的回调
|
||||
*/
|
||||
- (void)enterChatroom:(NIMChatroomEnterRequest *)request
|
||||
completion:(nullable NIMChatroomEnterHandler)completion;
|
||||
|
||||
/**
|
||||
* 离开聊天室
|
||||
*
|
||||
* @param roomId 聊天室ID
|
||||
* @param completion 离开聊天室的回调
|
||||
*/
|
||||
- (void)exitChatroom:(NSString *)roomId
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
/**
|
||||
* 聊天室登录使用的模式
|
||||
*
|
||||
* @param roomId 聊天室ID
|
||||
* @return 使用的登录模式
|
||||
*/
|
||||
- (NSInteger)chatroomAuthMode:(NSString *)roomId;
|
||||
|
||||
/**
|
||||
* 查询服务器保存的聊天室消息记录
|
||||
*
|
||||
* @param roomId 聊天室ID
|
||||
* @param option 查询选项
|
||||
* @param result 完成回调
|
||||
*/
|
||||
- (void)fetchMessageHistory:(NSString *)roomId
|
||||
option:(NIMHistoryMessageSearchOption *)option
|
||||
result:(nullable NIMFetchChatroomHistoryBlock)result;
|
||||
|
||||
/**
|
||||
* 通过标签查询消息
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)getMessagesByTags:(NIMGetMessagesByTagsParam *)param
|
||||
completion:(nullable NIMGetMessagesByTagsHandler)completion;
|
||||
|
||||
/**
|
||||
* 获取聊天室信息
|
||||
*
|
||||
* @param roomId 聊天室ID
|
||||
* @param completion 获取聊天室信息的回调
|
||||
* @discussion 只有已进入聊天室才能够获取对应的聊天室信息
|
||||
*/
|
||||
- (void)fetchChatroomInfo:(NSString *)roomId
|
||||
completion:(nullable NIMChatroomInfoHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 修改聊天室信息
|
||||
*
|
||||
* @param request 聊天室修改请求
|
||||
* @param completion 修改后完成的回调
|
||||
*/
|
||||
- (void)updateChatroomInfo:(NIMChatroomUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 修改自己在聊天室内的个人信息
|
||||
*
|
||||
* @param request 个人信息更新请求
|
||||
* @param completion 修改完成后的回调
|
||||
*/
|
||||
- (void)updateMyChatroomMemberInfo:(NIMChatroomMemberInfoUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 获取聊天室成员
|
||||
*
|
||||
* @param request 获取成员请求
|
||||
* @param completion 请求完成回调
|
||||
*/
|
||||
- (void)fetchChatroomMembers:(NIMChatroomMemberRequest *)request
|
||||
completion:(nullable NIMChatroomMembersHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID获取聊天室成员信息
|
||||
*
|
||||
* @param request 获取成员请求
|
||||
* @param completion 请求完成回调
|
||||
*/
|
||||
- (void)fetchChatroomMembersByIds:(NIMChatroomMembersByIdsRequest *)request
|
||||
completion:(nullable NIMChatroomMembersHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 根据标签获取聊天室内该标签下的成员
|
||||
*
|
||||
* @param request 获取标签成员请求
|
||||
* @param completion 请求完成回调
|
||||
*/
|
||||
- (void)fetchChatroomMembersByTag:(NIMChatroomFetchMembersByTagRequest *)request
|
||||
completion:(nullable NIMChatroomMembersHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 根据标签查询聊天室内该标签下的在线成员数量
|
||||
*
|
||||
* @param request 获取标签成员数量请求
|
||||
* @param completion 请求完成回调
|
||||
*/
|
||||
- (void)queryChatroomMembersCountByTag:(NIMChatroomQueryMembersCountByTagRequest *)request
|
||||
completion:(nullable NIMChatroomMembersCountHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新坐标
|
||||
* @param location 当前坐标和有效距离
|
||||
* @param completion 请求完成回调
|
||||
*/
|
||||
-(void)updateLocation:(nonnull NIMChatroomLocation *)location
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新标签
|
||||
* @param tags 标签
|
||||
* @param completion 请求完成回调
|
||||
*/
|
||||
-(void)updateTags:(nonnull NIMChatroomTagsUpdate *)tags
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 标记为聊天室管理员
|
||||
*
|
||||
* @param request 更新请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)markMemberManager:(NIMChatroomMemberUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
/**
|
||||
* 标记为聊天室普通成员
|
||||
*
|
||||
* @param request 更新请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)markNormalMember:(NIMChatroomMemberUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新用户聊天室黑名单状态
|
||||
*
|
||||
* @param request 更新请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)updateMemberBlack:(NIMChatroomMemberUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 更新用户聊天室静言状态
|
||||
*
|
||||
* @param request 更新请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)updateMemberMute:(NIMChatroomMemberUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新用户聊天室临时禁言状态
|
||||
*
|
||||
* @param request 更新请求
|
||||
* @param duration 临时禁言时长,单位为秒
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)updateMemberTempMute:(NIMChatroomMemberUpdateRequest *)request
|
||||
duration:(unsigned long long)duration
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 针对标签更新聊天室临时禁言状态
|
||||
*
|
||||
* @param request 更新请求
|
||||
* @param duration 临时禁言时长,单位为秒
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)tempMuteTag:(NIMChatroomTempMuteTagRequest *)request completion:(NIMChatroomHandler)completion;
|
||||
|
||||
/**
|
||||
* 将特定成员踢出聊天室
|
||||
*
|
||||
* @param request 踢出请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)kickMember:(NIMChatroomMemberKickRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 加入或者更新聊天室通用队列元素,权限由 NIMChatroom 的 queueModificationLevel 决定
|
||||
*
|
||||
* @param request 聊天室队列请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)updateChatroomQueueObject:(NIMChatroomQueueUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 移除聊天室队列元素,权限由 NIMChatroom 的 queueModificationLevel 决定
|
||||
*
|
||||
* @param request 拉取请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)removeChatroomQueueObject:(NIMChatroomQueueRemoveRequest *)request
|
||||
completion:(nullable NIMChatroomQueueRemoveHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 获取聊天室队列
|
||||
*
|
||||
* @param roomId 聊天室ID
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)fetchChatroomQueue:(NSString *)roomId
|
||||
completion:(nullable NIMChatroomQueueInfoHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 删除聊天室队列,权限由 NIMChatroom 的 queueModificationLevel 决定
|
||||
*
|
||||
* @param roomId 聊天室ID
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)dropChatroomQueue:(NSString *)roomId
|
||||
completion:(nullable NIMChatroomHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新聊天室通用队列元素,权限由 NIMChatroom 的 queueModificationLevel 决定
|
||||
*
|
||||
* @param request 聊天室队列批量请求
|
||||
* @param completion 请求回调
|
||||
*/
|
||||
- (void)batchUpdateChatroomQueueObject:(NIMChatroomQueueBatchUpdateRequest *)request
|
||||
completion:(nullable NIMChatroomQueueBatchUpdateHandler)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 添加通知对象
|
||||
*
|
||||
* @param delegate 通知对象
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMChatroomManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除通知对象
|
||||
*
|
||||
* @param delegate 通知对象
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMChatroomManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,123 @@
|
||||
//
|
||||
// NIMChatroomMember.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 聊天室用户类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomMemberType) {
|
||||
/**
|
||||
* 普通游客
|
||||
*/
|
||||
NIMChatroomMemberTypeGuest = -2,
|
||||
/**
|
||||
* 受限用户
|
||||
*/
|
||||
NIMChatroomMemberTypeLimit = -1,
|
||||
/**
|
||||
* 普通用户
|
||||
*/
|
||||
NIMChatroomMemberTypeNormal = 0,
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
NIMChatroomMemberTypeCreator = 1,
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
NIMChatroomMemberTypeManager = 2,
|
||||
/**
|
||||
* 匿名游客
|
||||
*/
|
||||
NIMChatroomMemberTypeAnonymousGuest = 4,
|
||||
};
|
||||
|
||||
/**
|
||||
* 聊天室用户
|
||||
*/
|
||||
@interface NIMChatroomMember : NSObject
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *userId;
|
||||
|
||||
/**
|
||||
* 聊天室内的昵称字段,由用户进聊天室时提交。
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomNickname;
|
||||
|
||||
/**
|
||||
* 聊天室内的头像字段,由用户进聊天室时提交。
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomAvatar;
|
||||
|
||||
/**
|
||||
* 用户在聊天室内的头像缩略图
|
||||
* @discussion 仅适用于使用云信上传服务进行上传的资源,否则无效。
|
||||
*/
|
||||
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *roomAvatarThumbnail;
|
||||
|
||||
/**
|
||||
* 聊天室内预留给开发者的扩展字段,由用户进聊天室时提交。
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomExt;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@property (nonatomic,assign) NIMChatroomMemberType type;
|
||||
|
||||
/**
|
||||
* 是否被禁言
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isMuted;
|
||||
|
||||
/**
|
||||
* 是否被临时禁言
|
||||
* @discussion 临时禁言和禁言属性无相关性
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isTempMuted;
|
||||
|
||||
/**
|
||||
* 临时禁言剩余时长
|
||||
*/
|
||||
@property (nonatomic,assign) unsigned long long tempMuteDuration;
|
||||
|
||||
/**
|
||||
* 是否被拉黑
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isInBlackList;
|
||||
|
||||
/**
|
||||
* 是否在线, 仅特殊成员才可能离线, 对游客用户而言只能是在线
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isOnline;
|
||||
|
||||
/**
|
||||
* 进入聊天室的时间点
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval enterTimeInterval;
|
||||
|
||||
/**
|
||||
* 聊天室成员的tags
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *tags;
|
||||
|
||||
/**
|
||||
* 聊天室成员的notifyTargetTags
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyTargetTags;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
//
|
||||
// NIMChatroomMemberRequest.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMChatroomMember;
|
||||
|
||||
/**
|
||||
* 聊天室成员类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomFetchMemberType){
|
||||
/**
|
||||
* 聊天室固定成员,包括创建者,管理员,普通等级用户,受限用户(禁言+黑名单),有数量上限
|
||||
*/
|
||||
NIMChatroomFetchMemberTypeRegular,
|
||||
/**
|
||||
* 聊天室临时成员,只有在线时才能在列表中看到,数量无上限
|
||||
*/
|
||||
NIMChatroomFetchMemberTypeTemp,
|
||||
/**
|
||||
* 聊天室在线的固定成员
|
||||
*/
|
||||
NIMChatroomFetchMemberTypeRegularOnline,
|
||||
/**
|
||||
* 聊天室非固定成员(反向查询)
|
||||
*/
|
||||
NIMChatroomFetchMemberTypeUnRegularReversedOrder,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室成员信息修改字段
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomMemberInfoUpdateTag) {
|
||||
/**
|
||||
* 聊天室成员昵称信息
|
||||
*/
|
||||
NIMChatroomMemberInfoUpdateTagNick = 5,
|
||||
/**
|
||||
* 聊天室成员头像信息
|
||||
*/
|
||||
NIMChatroomMemberInfoUpdateTagAvatar = 6,
|
||||
/**
|
||||
* 聊天室成员扩展信息
|
||||
*/
|
||||
NIMChatroomMemberInfoUpdateTagExt = 7,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室获取成员请求
|
||||
*/
|
||||
@interface NIMChatroomMemberRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 聊天室成员类型
|
||||
*/
|
||||
@property (nonatomic,assign) NIMChatroomFetchMemberType type;
|
||||
|
||||
/**
|
||||
* 最后一位成员锚点,不包括此成员。填nil会使用当前服务器最新时间开始查询,即第一页。
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMChatroomMember *lastMember;
|
||||
|
||||
/**
|
||||
* 获取聊天室成员个数
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger limit;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID获取聊天室成员请求
|
||||
*/
|
||||
@interface NIMChatroomMembersByIdsRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 用户ID列表,最多20个
|
||||
*/
|
||||
@property (nonatomic,copy) NSArray<NSString *> *userIds;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室成员标记请求
|
||||
*/
|
||||
@interface NIMChatroomMemberUpdateRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *userId;
|
||||
|
||||
/**
|
||||
* 标记是否有效
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL enable;
|
||||
|
||||
/**
|
||||
* 操作通知事件扩展
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyExt;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室成员信息修改请求
|
||||
*/
|
||||
@interface NIMChatroomMemberInfoUpdateRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 需要更新的信息,修改传入的数据键值对是 {@(NIMChatroomMemberInfoUpdateTag) : NSString},无效数据将被过滤
|
||||
*/
|
||||
@property (nonatomic,copy) NSDictionary *updateInfo;
|
||||
|
||||
/**
|
||||
* 是否需要通知
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL needNotify;
|
||||
|
||||
/**
|
||||
* 操作通知事件扩展
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyExt;
|
||||
|
||||
/**
|
||||
* 更新的信息是否需要在服务器做持久化,只对固定成员生效,默认为 NO
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL needSave;
|
||||
|
||||
/**
|
||||
* 对某些资料内容另外的反垃圾的业务ID
|
||||
*/
|
||||
@property (nonatomic,strong) NSString *antispamBusinessId;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室踢人请求
|
||||
*/
|
||||
@interface NIMChatroomMemberKickRequest : NSObject
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 用户ID,仅管理员可以踢人;如userId是管理员仅创建者可以踢.
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *userId;
|
||||
|
||||
/**
|
||||
* 被踢通知扩展字段
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyExt;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
//
|
||||
// NIMChatroomNotificationContent.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMNotificationContent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 聊天室操作类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomEventType){
|
||||
/**
|
||||
* 成员进入聊天室
|
||||
*/
|
||||
NIMChatroomEventTypeEnter = 301,
|
||||
/**
|
||||
* 成员离开聊天室
|
||||
*/
|
||||
NIMChatroomEventTypeExit = 302,
|
||||
/**
|
||||
* 成员被拉黑
|
||||
*/
|
||||
NIMChatroomEventTypeAddBlack = 303,
|
||||
/**
|
||||
* 成员被取消拉黑
|
||||
*/
|
||||
NIMChatroomEventTypeRemoveBlack = 304,
|
||||
/**
|
||||
* 成员被设置禁言
|
||||
*/
|
||||
NIMChatroomEventTypeAddMute = 305,
|
||||
/**
|
||||
* 成员被取消禁言
|
||||
*/
|
||||
NIMChatroomEventTypeRemoveMute = 306,
|
||||
/**
|
||||
* 设置为管理员
|
||||
*/
|
||||
NIMChatroomEventTypeAddManager = 307,
|
||||
/**
|
||||
* 移除管理员
|
||||
*/
|
||||
NIMChatroomEventTypeRemoveManager = 308,
|
||||
/**
|
||||
* 设置为固定成员
|
||||
*/
|
||||
NIMChatroomEventTypeAddCommon = 309,
|
||||
/**
|
||||
* 取消固定成员
|
||||
*/
|
||||
NIMChatroomEventTypeRemoveCommon = 310,
|
||||
/**
|
||||
* 聊天室被关闭
|
||||
*/
|
||||
NIMChatroomEventTypeClosed = 311,
|
||||
/**
|
||||
* 聊天室信息更新
|
||||
*/
|
||||
NIMChatroomEventTypeInfoUpdated = 312,
|
||||
/**
|
||||
* 聊天室成员被踢
|
||||
*/
|
||||
NIMChatroomEventTypeKicked = 313,
|
||||
/**
|
||||
* 聊天室成员被临时禁言
|
||||
*/
|
||||
NIMChatroomEventTypeAddMuteTemporarily = 314,
|
||||
/**
|
||||
* 聊天室成员被解除临时禁言
|
||||
*/
|
||||
NIMChatroomEventTypeRemoveMuteTemporarily = 315,
|
||||
/**
|
||||
* 聊天室成员主动更新了聊天室的角色信息
|
||||
*/
|
||||
NIMChatroomEventTypeMemberUpdateInfo = 316,
|
||||
/**
|
||||
* 聊天室通用队列变更的通知
|
||||
*/
|
||||
NIMChatroomEventTypeQueueChange = 317,
|
||||
/**
|
||||
* 聊天室被禁言了,只有管理员可以发言,其他人都处于禁言状态
|
||||
*/
|
||||
NIMChatroomEventTypeRoomMuted = 318,
|
||||
/**
|
||||
* 聊天室不在禁言状态
|
||||
*/
|
||||
NIMChatroomEventTypeRoomUnMuted = 319,
|
||||
/**
|
||||
* 聊天室通用队列批量变更的通知
|
||||
*/
|
||||
NIMChatroomEventTypeQueueBatchChange = 320,
|
||||
/**
|
||||
* 聊天室新增标签禁言,包括的字段是muteDuration、targetTag、operator、opeNick字段
|
||||
*/
|
||||
NIMChatroomEventTypeTagTempMuteAdd = 321,
|
||||
/**
|
||||
* 聊天室移除标签禁言,包括的字段是muteDuration、targetTag、operator、opeNick字段
|
||||
*/
|
||||
NIMChatroomEventTypeTagTempMuteRemove = 322,
|
||||
/**
|
||||
* 聊天室消息撤回,包括的字段是operator、target、msgTime、msgId、ext字段
|
||||
*/
|
||||
NIMChatroomEventTypeRecall = 323,
|
||||
|
||||
/**
|
||||
* 批量添加聊天室队列元素,包括的字段是ext、opeNick、operator、queueChange字段
|
||||
*/
|
||||
NIMChatroomEventTypeQueueBatchAdd = 324,
|
||||
|
||||
/**
|
||||
* 批量更新聊天室标签
|
||||
*/
|
||||
NIMChatroomEventTypeUpdateTags = 325,
|
||||
};
|
||||
|
||||
/**
|
||||
* 聊天室队列变更类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomQueueChangeType){
|
||||
/**
|
||||
* 无效或未知变更类型
|
||||
*/
|
||||
NIMChatroomQueueChangeTypeInvalid = 0,
|
||||
/**
|
||||
* 新增元素
|
||||
*/
|
||||
NIMChatroomQueueChangeTypeOffer = 1,
|
||||
/**
|
||||
* 取出元素
|
||||
*/
|
||||
NIMChatroomQueueChangeTypePoll = 2,
|
||||
/**
|
||||
* 清空元素
|
||||
*/
|
||||
NIMChatroomQueueChangeTypeDrop = 3,
|
||||
/**
|
||||
* 更新元素
|
||||
*/
|
||||
NIMChatroomQueueChangeTypeUpdate = 5,
|
||||
|
||||
/**
|
||||
* 批量新增或更新元素
|
||||
*/
|
||||
NIMChatroomQueueChangeTypeBatchOffer = 6,
|
||||
};
|
||||
|
||||
/**
|
||||
* 聊天室队列批量变更类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomQueueBatchChangeType){
|
||||
/**
|
||||
* 无效或未知变更类型
|
||||
*/
|
||||
NIMChatroomQueueBatchChangeTypeInvalid = 0,
|
||||
/**
|
||||
* 部分批量清理操作(发生在提交元素的用户掉线时,清理这个用户对应的key)
|
||||
*/
|
||||
NIMChatroomQueueBatchChangeTypePartClear = 4,
|
||||
};
|
||||
|
||||
/**
|
||||
* 通知事件包含的聊天室成员
|
||||
*/
|
||||
@interface NIMChatroomNotificationMember : NSObject
|
||||
/**
|
||||
* 聊天室成员ID
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *userId;
|
||||
/**
|
||||
* 聊天室成员昵称
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *nick;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室通知内容
|
||||
*/
|
||||
@interface NIMChatroomNotificationContent : NIMNotificationContent
|
||||
|
||||
/**
|
||||
* 聊天室通知事件类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMChatroomEventType eventType;
|
||||
|
||||
/**
|
||||
* 操作者
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NIMChatroomNotificationMember *source;
|
||||
|
||||
/**
|
||||
* 被操作者
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSArray<NIMChatroomNotificationMember *> *targets;
|
||||
|
||||
/**
|
||||
* 通知信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *notifyExt;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSArray<NSString *> *tags;
|
||||
|
||||
/**
|
||||
* 被撤回消息的ID
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *revokedMessageId;
|
||||
|
||||
/**
|
||||
* 被撤回消息的时间
|
||||
*/
|
||||
@property (nonatomic,readonly) NSTimeInterval revokedMessageTime;
|
||||
|
||||
/**
|
||||
* 拓展信息
|
||||
* @discusssion 不同的聊天室通知有不同的扩展信息
|
||||
* NIMChatroomEventTypeAddMuteTemporarily/NIMChatroomEventTypeRemoveMuteTemporarily 类型: 拓展信息为NSNumber,表示临时禁言时长
|
||||
*
|
||||
* NIMChatroomEventTypeEnter 类型: 扩展信息为 NSDictionary , KEY 值为 NIMChatroomEventInfoMutedKey ,NIMChatroomEventInfoTempMutedKey, NIMChatroomEventInfoTempMutedDurationKey
|
||||
*
|
||||
* NIMChatroomEventTypeQueueChange 类型: 扩展信息为 NSDictionary, KEY 值为 NIMChatroomEventInfoQueueChangeTypeKey , NIMChatroomEventInfoQueueChangeItemKey, NIMChatroomEventInfoQueueChangeItemValueKey
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) id ext;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 是否是禁言状态
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoMutedKey;
|
||||
|
||||
/**
|
||||
* 是否为临时禁言状态
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoTempMutedKey;
|
||||
|
||||
/**
|
||||
* 临时禁言时长
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoTempMutedDurationKey;
|
||||
|
||||
/**
|
||||
* 聊天室变更类型
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoQueueChangeTypeKey;
|
||||
|
||||
/**
|
||||
* 聊天室变更元素
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoQueueChangeItemKey;
|
||||
|
||||
/**
|
||||
* 聊天室批量变更元素,为包含多个键值对的字典
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoQueueChangeItemsKey;
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室变更元素的值
|
||||
*/
|
||||
extern NSString *const NIMChatroomEventInfoQueueChangeItemValueKey;
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// NIMChatroomQueueRequest.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 聊天室通用队列更新请求
|
||||
*/
|
||||
@interface NIMChatroomQueueUpdateRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室 ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 更新元素的 Key 值,如果 key 在队列中存在则更新,不存在则放到队列尾部 ,长度限制为 32 字节
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *key;
|
||||
|
||||
/**
|
||||
* 更新元素的 Value 值,长度限制为 4096 字节
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *value;
|
||||
|
||||
/**
|
||||
* 当提交这个新元素的用户从聊天室掉线或退出的时候,是否需要删除这个元素,默认为 NO 不删除。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL transient;
|
||||
|
||||
/**
|
||||
* 队列元素所属账号,默认不传表示队列元素属于当前操作人,管理员可以指定队列元素归属于其他合法账号。
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *elementAccid;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室通用队列取出请求
|
||||
*/
|
||||
@interface NIMChatroomQueueRemoveRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 拉去元素的Key值,如果要拉取第一个元素,则传空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *key;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室通用队列批量更新请求
|
||||
*/
|
||||
@interface NIMChatroomQueueBatchUpdateRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室 ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 批量更新元素的key-value对,key/value分别是elementKey和elementValue(elementKey限制128字节,elementValue限制4096字节),一次最多更新100个
|
||||
*/
|
||||
@property (nonatomic,copy) NSDictionary *elements;
|
||||
|
||||
/**
|
||||
* 是否需要发送广播通知
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL needNotify;
|
||||
|
||||
|
||||
/**
|
||||
* 通知中的自定义字段,长度限制2048
|
||||
*/
|
||||
@property (nonatomic,copy) NSString* notifyExt;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// Created by Songwenhai on 2021/4/10.
|
||||
// Copyright (c) 2021 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMChatroomMember;
|
||||
|
||||
/**
|
||||
* 禁言某个标签的用户的发言,只有管理员或创建者能操作
|
||||
*/
|
||||
@interface NIMChatroomTempMuteTagRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 禁言的tag
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *targetTag;
|
||||
|
||||
/**
|
||||
* 禁言的时长,单位秒,若设置为0,则表示取消禁言
|
||||
*/
|
||||
@property(nonatomic, assign) unsigned long long duartion;
|
||||
|
||||
|
||||
/**
|
||||
* 是否需要通知
|
||||
*/
|
||||
@property(nonatomic, assign) BOOL needNotify;
|
||||
|
||||
/**
|
||||
* 操作通知事件扩展
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *notifyExt;
|
||||
|
||||
/**
|
||||
* 禁言通知广播的目标标签,默认是targetTag
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *notifyTargetTags;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 根据用户标签获取聊天室成员请求
|
||||
*/
|
||||
@interface NIMChatroomFetchMembersByTagRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *tag;
|
||||
|
||||
/**
|
||||
* 最后一位成员锚点,不包括此成员。填nil会使用当前服务器最新时间开始查询,即第一页。
|
||||
*/
|
||||
@property(nullable, nonatomic, strong) NIMChatroomMember *lastMember;
|
||||
|
||||
/**
|
||||
* 获取聊天室成员个数
|
||||
*/
|
||||
@property(nonatomic, assign) NSUInteger limit;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户标签获取聊天室在线成员数量请求
|
||||
*/
|
||||
@interface NIMChatroomQueryMembersCountByTagRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *tag;
|
||||
|
||||
@end
|
||||
|
||||
@interface NIMChatroomLocation : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *roomId;
|
||||
/**
|
||||
* X坐标
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *locationX;
|
||||
/**
|
||||
* Y坐标
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *locationY;
|
||||
/**
|
||||
* Z坐标
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *locationZ;
|
||||
/**
|
||||
* 距离
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *distance;
|
||||
@end
|
||||
|
||||
@interface NIMChatroomTagsUpdate : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *roomId;
|
||||
/**
|
||||
* 标签,可以设置多个,如果不传,则会删掉老的标签
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray<NSString *> *tags;
|
||||
/**
|
||||
* 更新标签的通知的目标标签,是一个标签表达式,同时也会改变该连接掉线时的通知对象,见TagCalculator和TagPattern,如果不传,则会删掉老的notifyTargetTags
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *notifyTargetTags;
|
||||
/**
|
||||
* 是否需要通知,填true则会产生一条通知,类型为325
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL needNotify;
|
||||
/**
|
||||
* 通知扩展字段
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *ext;
|
||||
|
||||
@end
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by 陈吉力 on 2022/10/18.
|
||||
// Copyright (c) 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 我的聊天室标签变更通知类
|
||||
*/
|
||||
@interface NIMChatroomTagsUpdateEvent : NSObject
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nonatomic, nullable, copy, readonly) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 修改后的标签
|
||||
*/
|
||||
@property(nonatomic, nullable, copy, readonly) NSArray *tags;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// NIMChatroomUpdateRequest.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 聊天室信息修改字段
|
||||
* @discussion 等级枚举见 `NIMChatroomQueueModificationLevel`
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMChatroomUpdateTag){
|
||||
/**
|
||||
* 聊天室名称
|
||||
*/
|
||||
NIMChatroomUpdateTagName = 3,
|
||||
/**
|
||||
* 聊天室公告
|
||||
*/
|
||||
NIMChatroomUpdateTagAnnouncement = 4,
|
||||
/**
|
||||
* 聊天室直播拉流地址
|
||||
*/
|
||||
NIMChatroomUpdateTagBroadcastUrl = 5,
|
||||
/**
|
||||
* 聊天室扩展字段
|
||||
*/
|
||||
NIMChatroomUpdateTagExt = 12,
|
||||
/**
|
||||
* 聊天室队列修改等级,只有管理员和房主可以修改
|
||||
*/
|
||||
NIMChatroomUpdateTagQueueModificationLevel = 16
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 聊天室信息更新请求
|
||||
*/
|
||||
@interface NIMChatroomUpdateRequest : NSObject
|
||||
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
|
||||
/**
|
||||
* 修改信息字段,修改传入的数据键值对是 {@(NIMChatroomUpdateTag) : NSString 或 NSNumber},无效数据将被过滤
|
||||
*/
|
||||
@property (nonatomic,copy) NSDictionary *updateInfo;
|
||||
|
||||
/**
|
||||
* 是否需要通知, 默认NO
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL needNotify;
|
||||
|
||||
/**
|
||||
* 放到事件通知里的扩展字段
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyExt;
|
||||
|
||||
/**
|
||||
* 对某些资料内容另外的反垃圾的业务ID
|
||||
*/
|
||||
@property (nonatomic,strong) NSString *antispamBusinessId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// NIMClearMessagesOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by He on 2019/3/20.
|
||||
// Copyright © 2019 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 清空消息选项
|
||||
*/
|
||||
@interface NIMClearMessagesOption : NSObject
|
||||
|
||||
/**
|
||||
* 是否同时删除服务端漫游消息, 默认为 YES
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL removeRoam;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// NIMCollectInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/3/30.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMCollectInfo : NSObject
|
||||
|
||||
/**
|
||||
* 收藏项id
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger id;
|
||||
|
||||
/**
|
||||
* 收藏类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger type;
|
||||
|
||||
/**
|
||||
* 数据,最大20KB
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *data;
|
||||
|
||||
/**
|
||||
* 扩展字段,最大1KB
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *ext;
|
||||
|
||||
/**
|
||||
* 去重唯一ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *uniqueId;
|
||||
|
||||
/**
|
||||
* 创建时间(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
|
||||
/**
|
||||
* 更新时间(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// NIMCollectQueryParams.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/3/27.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMCollectQueryOptions : NSObject
|
||||
|
||||
/**
|
||||
* 最小时间(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval fromTime;
|
||||
|
||||
/**
|
||||
* 最大时间,传0表示当前时间(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval toTime;
|
||||
|
||||
/**
|
||||
* 上一页最后一条ID,第一条传0
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger excludeId;
|
||||
|
||||
/**
|
||||
* 查询条数,默认100
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger limit;
|
||||
|
||||
/**
|
||||
* 是否倒序
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL reverse;
|
||||
|
||||
/**
|
||||
* 收藏类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger type;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+1041
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// NIMCreateTeamOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease
|
||||
// Copyright © 2016 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMTeamDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 创建群选项
|
||||
*/
|
||||
@interface NIMCreateTeamExOption : NSObject <NSCopying>
|
||||
/**
|
||||
* 群名
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *name;
|
||||
/**
|
||||
* 群类型
|
||||
* @discussion 默认为普通群
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamType type;
|
||||
|
||||
/**
|
||||
* 群头像
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *avatarUrl;
|
||||
|
||||
/**
|
||||
* 群简介
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *intro;
|
||||
|
||||
/**
|
||||
* 群公告
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *announcement;
|
||||
|
||||
/**
|
||||
* 客户端自定义信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *clientCustomInfo;
|
||||
|
||||
/**
|
||||
* 邀请他人的附言
|
||||
* @discussion 高级群有效,普通群无需附言
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *postscript;
|
||||
|
||||
/**
|
||||
* 群验证模式
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamJoinModeNoAuth
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamJoinMode joinMode;
|
||||
|
||||
/**
|
||||
* 群邀请权限
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamInviteModeManager
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamInviteMode inviteMode;
|
||||
|
||||
|
||||
/**
|
||||
* 被邀请模式
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamBeInviteModeNeedAuth
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamBeInviteMode beInviteMode;
|
||||
|
||||
/**
|
||||
* 修改群信息权限
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamUpdateInfoModeManager
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamUpdateInfoMode updateInfoMode;
|
||||
|
||||
/**
|
||||
* 修改群客户端自定义字段权限
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamUpdateClientCustomModeManager
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamUpdateClientCustomMode updateClientCustomMode;
|
||||
|
||||
/**
|
||||
* 设置群最大人数上限
|
||||
* @discussion 默认为0,表示使用默认人数上限
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger maxMemberCountLimitation;
|
||||
|
||||
/**
|
||||
* 对某些资料内容另外的反垃圾的业务ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *antispamBusinessId;
|
||||
|
||||
/**
|
||||
* 邀请用户列表
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray<NSString *> *users;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// NIMCreateTeamOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease
|
||||
// Copyright © 2016 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMTeamDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 创建群选项
|
||||
* @deprecated 使用NIMCreateTeamExOption
|
||||
*/
|
||||
@interface NIMCreateTeamOption : NSObject
|
||||
/**
|
||||
* 群名
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *name;
|
||||
/**
|
||||
* 群类型
|
||||
* @discussion 默认为普通群
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamType type;
|
||||
|
||||
/**
|
||||
* 群头像
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *avatarUrl;
|
||||
|
||||
/**
|
||||
* 群简介
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *intro;
|
||||
|
||||
/**
|
||||
* 群公告
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *announcement;
|
||||
|
||||
/**
|
||||
* 客户端自定义信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *clientCustomInfo;
|
||||
|
||||
/**
|
||||
* 邀请他人的附言
|
||||
* @discussion 高级群有效,普通群无需附言
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *postscript;
|
||||
|
||||
/**
|
||||
* 群验证模式
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamJoinModeNoAuth
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamJoinMode joinMode;
|
||||
|
||||
/**
|
||||
* 群邀请权限
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamInviteModeManager
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamInviteMode inviteMode;
|
||||
|
||||
|
||||
/**
|
||||
* 被邀请模式
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamBeInviteModeNeedAuth
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamBeInviteMode beInviteMode;
|
||||
|
||||
/**
|
||||
* 修改群信息权限
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamUpdateInfoModeManager
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamUpdateInfoMode updateInfoMode;
|
||||
|
||||
/**
|
||||
* 修改群客户端自定义字段权限
|
||||
* @discussion 只有高级群有效,默认为 NIMTeamUpdateClientCustomModeManager
|
||||
*/
|
||||
@property (nonatomic,assign) NIMTeamUpdateClientCustomMode updateClientCustomMode;
|
||||
|
||||
/**
|
||||
* 设置群最大人数上限
|
||||
* @discussion 默认为0,表示使用默认人数上限
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger maxMemberCountLimitation;
|
||||
|
||||
/**
|
||||
* 对某些资料内容另外的反垃圾的业务ID
|
||||
*/
|
||||
@property (nonatomic,strong) NSString *antispamBusinessId;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// NIMCustomObject.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMMessageObjectProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/*
|
||||
除了 SDK 预定义的几种消息类型,上层APP开发者如果想要实现更多的消息类型,不可避免需要使用自定义消息这种类型
|
||||
由于 SDK 并不能预测上层 APP 的应用场景,所以 NIMCustomObject 采取消息透传的方式以提供给上层开发者最大的自由度
|
||||
即 SDK 只负责发送和收取由 NIMCustomObject 中 id<NIMCustomAttachment> attachment 序列化和反序列化后的字节流
|
||||
在发送端,SDK 获取 encodeAttachment 后得到的字节流发送至对面端
|
||||
在接收端,SDK 读取字节流,并通过上层 APP 设置的反序列化对象进行解析 (registerCustomDecoder:)
|
||||
|
||||
文件上传:
|
||||
为了方便 APP 在自定义消息类型中进行文件的上传,SDK 也提供了三个接口文件上传
|
||||
即只要 APP 实现上传相关的接口,资源的上传就可以由 SDK 自动完成
|
||||
如需要上传资源需要实现的接口有:
|
||||
1. - (BOOL)attachmentNeedsUpload 是否有文件需要上传,在有文件且文件没有上传成功时返回YES
|
||||
2. - (NSString *)attachmentPathForUploading 返回需要上传的文件路径
|
||||
3. - (void)updateAttachmentURL:(NSString *)urlString 上传成功后SDK会调用这个接口,APP 需要实现这个接口来保存上传后的URL
|
||||
具体可以参考 DEMO 中阅后即焚的实现
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 自定义消息对象附件协议
|
||||
*/
|
||||
@protocol NIMCustomAttachment <NSObject>
|
||||
@required
|
||||
|
||||
/**
|
||||
* 序列化attachment
|
||||
*
|
||||
* @return 序列化后的结果,将用于透传
|
||||
*/
|
||||
- (NSString *)encodeAttachment;
|
||||
|
||||
@optional
|
||||
#pragma mark - 上传相关接口
|
||||
/**
|
||||
* 是否需要上传附件
|
||||
*
|
||||
* @return 是否需要上传附件
|
||||
*/
|
||||
- (BOOL)attachmentNeedsUpload;
|
||||
|
||||
/**
|
||||
* 需要上传的附件路径
|
||||
*
|
||||
* @return 路径
|
||||
*/
|
||||
- (NSString *)attachmentPathForUploading;
|
||||
|
||||
/**
|
||||
* 更新附件URL
|
||||
*
|
||||
* @param urlString 附件url
|
||||
*/
|
||||
- (void)updateAttachmentURL:(NSString *)urlString;
|
||||
|
||||
#pragma mark - 下载相关接口
|
||||
/**
|
||||
* 是否需要下载附件
|
||||
*
|
||||
* @return 是否需要上传附件
|
||||
*/
|
||||
- (BOOL)attachmentNeedsDownload;
|
||||
|
||||
/**
|
||||
* 需要下载的附件url
|
||||
*
|
||||
* @return 附件url
|
||||
* @discussion 如果当前字段是云信的 http url 地址,那么需要调用 id<NIMResourceManager> 中 normalizeURLString: 方法将这个地址进行转 https 和 cdn 加速格式
|
||||
*/
|
||||
- (NSString *)attachmentURLStringForDownloading;
|
||||
|
||||
/**
|
||||
* 需要下载的附件本地路径
|
||||
*
|
||||
* @return 附件本地路径
|
||||
* @discussion 上层需要保证路径的
|
||||
*/
|
||||
- (NSString *)attachmentPathForDownloading;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 自定义消息对象附件序列化协议
|
||||
*/
|
||||
@protocol NIMCustomAttachmentCoding<NSObject>
|
||||
@required
|
||||
|
||||
/**
|
||||
* 反序列化
|
||||
*
|
||||
* @param content 透传的自定义消息
|
||||
*
|
||||
* @return 自定义消息附件
|
||||
*/
|
||||
- (nullable id<NIMCustomAttachment>)decodeAttachment:(nullable NSString *)content;
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 用户自定义消息对象
|
||||
*/
|
||||
@interface NIMCustomObject : NSObject<NIMMessageObject>
|
||||
|
||||
/**
|
||||
* 用户自定义附件
|
||||
* @discussion SDK负责将attachment通过encodeAttachment接口序列化后的结果进行透传
|
||||
*/
|
||||
@property(nullable, nonatomic, strong) id<NIMCustomAttachment> attachment;
|
||||
|
||||
|
||||
/**
|
||||
* 注册自定义消息解析器
|
||||
*
|
||||
* @param decoder 自定义消息解析器
|
||||
* @disucssion 如果用户使用自定义消息类型,就需要注册自定义消息解析器,负责将透传过来的自定义消息反序列化成上层应用可识别的对象
|
||||
*/
|
||||
+ (void)registerCustomDecoder:(id<NIMCustomAttachmentCoding>)decoder;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// NIMCustomNotificationSetting.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 自定义系统通知配置
|
||||
*/
|
||||
@interface NIMCustomSystemNotificationSetting : NSObject
|
||||
|
||||
/**
|
||||
* 系统通知是否需要被计入苹果推送通知的未读计数
|
||||
* @discussion 默认为YES。默认情况下,用户收到的自定义系统通知会在应用图标上累计未读。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL shouldBeCounted;
|
||||
/**
|
||||
* 消息是否需要苹果推送
|
||||
* @discussion 默认为YES。将这个字段设为NO,消息将不再有苹果推送通知。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL apnsEnabled;
|
||||
/**
|
||||
* 苹果推送是否需要带前缀(一般为昵称)
|
||||
* @discussion 默认为NO。将这个字段设为YES,推送消息将带有前缀(xx:)。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL apnsWithPrefix;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// NIMCustomizedAPIManagerProtocol.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by cqu227hk on 2022/12/08.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMGenericTypeAPIDefine.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* 定制化api调用统一入口协议定义
|
||||
*/
|
||||
@protocol NIMCustomizedAPIManager <NSObject>
|
||||
|
||||
/**
|
||||
* 调用定制化api
|
||||
*
|
||||
* @param param api调用参数,包括 api name/param等信息 详见NIMGenericTypeAPICallParam定义
|
||||
* @param completion api扫行结果回调,包括error/result等信息 详见NIMNIMGenericTypeAPICallInvokeCallback定义
|
||||
*/
|
||||
- (void)invokeAPI:(NIMGenericTypeAPICallParam* __nonnull)param
|
||||
completion:(nullable NIMGenericTypeAPICallInvokeCallback)completion;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// NIMDatabaseException.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMDatabaseException;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 数据库异常类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMDatabaseExceptionType)
|
||||
{
|
||||
/**
|
||||
* 损坏的DB
|
||||
* @deprecated 请使用 NIMDatabaseExceptionTypeCorrupt
|
||||
*/
|
||||
NIMDatabaseExceptionTypeBadDb = 1,
|
||||
|
||||
/**
|
||||
* 未分类的通用错误
|
||||
*/
|
||||
NIMDatabaseExceptionTypeGeneric = 0,
|
||||
|
||||
/**
|
||||
* 数据库损坏
|
||||
*/
|
||||
NIMDatabaseExceptionTypeCorrupt = 1,
|
||||
|
||||
/**
|
||||
* 磁盘空间已满
|
||||
*/
|
||||
NIMDatabaseExceptionTypeFull = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* 数据库异常处理协议
|
||||
*/
|
||||
@protocol NIMDatabaseHandleExceptionProtocol <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* 数据库异常处理方法
|
||||
*/
|
||||
- (void)handleException:(NIMDatabaseException *)exception;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 数据库异常信息
|
||||
*/
|
||||
@interface NIMDatabaseException : NSObject
|
||||
|
||||
/**
|
||||
* 异常
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMDatabaseExceptionType exception;
|
||||
|
||||
/**
|
||||
* 数据库异常信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *message;
|
||||
|
||||
/**
|
||||
* 数据库文件沙盒路径
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *databasePath;
|
||||
|
||||
/**
|
||||
* 注册数据库异常处理对象
|
||||
* @param handler 用户自定义处理对象
|
||||
*/
|
||||
+ (void)registerExceptionHandler:(id<NIMDatabaseHandleExceptionProtocol>)handler;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// NIMDeleteMessageOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 张根宁 on 2020/6/8.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMDeleteMessageOption : NSObject
|
||||
|
||||
/**
|
||||
* 是否从数据库中删除
|
||||
* @discussion 默认情况下云信采用标记的方式进行消息删除,如果设置为 YES,将直接从数据库中移除该消息
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL removeFromDB;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// NIMDeleteMessagesOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2017年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 批量删除消息选项
|
||||
*/
|
||||
@interface NIMDeleteMessagesOption : NSObject
|
||||
|
||||
/**
|
||||
* 是否移除对应最近会话
|
||||
* @discussion 批量删除消息时是否移除最近会话,默认为 NO,设置为 YES 时将同时删除最近会话信息
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL removeSession;
|
||||
|
||||
|
||||
/**
|
||||
* 是否删除消息表
|
||||
* @discussion 默认情况下云信采用标记的方式进行消息删除,如果设置为 YES,将一并移除对应的消息表,进而减少消息表数量,加快 I/O
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL removeTable;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// NIMDeleteRecentSessionOption.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by I am Groot on 2020/12/6.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMDeleteRecentSessionOption : NSObject
|
||||
/**
|
||||
* 是否移除该会话的服务端漫游消息
|
||||
* @discussion ,默认为 NO,仅删除本地会话;为YES,将同时删除服务端漫游消息
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isDeleteRoamMessage;
|
||||
|
||||
/**
|
||||
* 是否标记会话中所有消息已读
|
||||
* @discussion ,默认为为 NO,仅删除本地会话;为YES,将同时标记会话中所有消息为已读
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL shouldMarkAllMessagesReadInSessions;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,183 @@
|
||||
//
|
||||
// NIMDocTranscodingInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMPlatform.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 转码源文件格式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMDocTranscodingFileType){
|
||||
/**
|
||||
* ppt
|
||||
*/
|
||||
NIMDocTranscodingFileTypePPT = 1,
|
||||
/**
|
||||
* pptx
|
||||
*/
|
||||
NIMDocTranscodingFileTypePPTX = 2,
|
||||
/**
|
||||
* pdf
|
||||
*/
|
||||
NIMDocTranscodingFileTypePDF = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* 转码目标图像文件类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMDocTranscodingImageType){
|
||||
/**
|
||||
* 未知图像文件类型
|
||||
*/
|
||||
NIMDocTranscodingImageTypeUnknown = 0,
|
||||
/**
|
||||
* 转码为 jpg 图片
|
||||
*/
|
||||
NIMDocTranscodingImageTypeJPG = 10,
|
||||
/**
|
||||
* 转码为 png 图片
|
||||
*/
|
||||
NIMDocTranscodingImageTypePNG = 11,
|
||||
};
|
||||
|
||||
/**
|
||||
* 转码图像清晰度
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMDocTranscodingQuality){
|
||||
/**
|
||||
* 高清转码质量
|
||||
*/
|
||||
NIMDocTranscodingQualityHigh = 1,
|
||||
/**
|
||||
* 中等转码质量
|
||||
*/
|
||||
NIMDocTranscodingQualityMedium = 2,
|
||||
/**
|
||||
* 低清转码质量
|
||||
*/
|
||||
NIMDocTranscodingQualityLow = 3,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 转码过程状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMDocTranscodingState){
|
||||
/**
|
||||
* 未知转码状态
|
||||
*/
|
||||
NIMDocTranscodingStateUnknown = 0,
|
||||
/**
|
||||
* 转码准备中
|
||||
*/
|
||||
NIMDocTranscodingStatePreparing = 1,
|
||||
/**
|
||||
* 转码进行中
|
||||
*/
|
||||
NIMDocTranscodingStateOngoing = 2,
|
||||
/**
|
||||
* 转码超时
|
||||
*/
|
||||
NIMDocTranscodingStateTimeout = 3,
|
||||
/**
|
||||
* 转码完成
|
||||
*/
|
||||
NIMDocTranscodingStateCompleted = 4,
|
||||
/**
|
||||
* 转码失败
|
||||
*/
|
||||
NIMDocTranscodingStateFailed = 5,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
转码文档信息
|
||||
*/
|
||||
@interface NIMDocTranscodingInfo : NSObject
|
||||
|
||||
/**
|
||||
转码文档标识 id
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *docId;
|
||||
|
||||
/**
|
||||
转码文档名称
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *docName;
|
||||
|
||||
/**
|
||||
转码源文档的文件类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMDocTranscodingFileType sourceType;
|
||||
|
||||
/**
|
||||
转码源文档大小
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) UInt64 sourceSize;
|
||||
|
||||
/**
|
||||
转码目标图片的文件类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMDocTranscodingImageType targetType;
|
||||
|
||||
/**
|
||||
转码过程状态
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMDocTranscodingState state;
|
||||
|
||||
/**
|
||||
转码源文档文件的下载地址
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *sourceFileUrl;
|
||||
|
||||
/**
|
||||
转码文档总页数
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSUInteger numberOfPages;
|
||||
|
||||
/**
|
||||
发起文档转码时的附带信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *ext;
|
||||
|
||||
/**
|
||||
文档转码内部状态码, 0 表示成功, 可用于在转码失败时定位具体失败原因。已知的一些失败原因 2: 找不到文件; 3: 文件类型错误; 4: 转码请求出现异常; 5: 转码服务器连接错误 6: 转码服务器内部错误; 7: 文档转码图片出错; 8: 图片质量处理错误; 9: 页数超限; 10: nos回调错误; 11: 文档解析错误(如加密的PDF无法解析; 100: 未知错误
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSInteger transcodingFlag;
|
||||
|
||||
/**
|
||||
获取某清晰度的转码后文件总字节大小
|
||||
|
||||
@param quality 转码质量
|
||||
@return 转码后该质量的图片文件总字节大小
|
||||
*/
|
||||
- (UInt64)transcodedTotalSize:(NIMDocTranscodingQuality)quality;
|
||||
|
||||
/**
|
||||
获取某清晰度转码后图片的长宽信息
|
||||
|
||||
@param quality 转码质量
|
||||
@return 转码后图片的长宽信息
|
||||
*/
|
||||
- (CGSize)transcodedImagesSize:(NIMDocTranscodingQuality)quality;
|
||||
|
||||
/**
|
||||
获取转码后某清晰度的文件页码对应的下载 url
|
||||
|
||||
@param pageNumber 文件页码
|
||||
@param quality 图片质量
|
||||
@return 图片下载 url
|
||||
*/
|
||||
- (nullable NSString *)transcodedUrl:(NSUInteger)pageNumber
|
||||
ofQuality:(NIMDocTranscodingQuality)quality;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// NIMDocTranscodingManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2016 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMDocTranscodingInfo;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
查询文档转码信息结果 block
|
||||
|
||||
@param error 执行结果,如果成功则为 nil
|
||||
@param info 查询到的文档转码信息
|
||||
*/
|
||||
typedef void(^NIMDocTranscodingInquireCompleteBlock)(NSError * __nullable error, NIMDocTranscodingInfo * __nullable info);
|
||||
|
||||
|
||||
/**
|
||||
拉取文档转码信息列表结果 block
|
||||
|
||||
@param error 执行结果,如果成功则为 nil
|
||||
@param infos 拉取到的所有文档转码信息
|
||||
*/
|
||||
typedef void(^NIMDocTranscodingFetchCompleteBlock)(NSError * __nullable error, NSArray<NIMDocTranscodingInfo *> * __nullable infos);
|
||||
|
||||
/**
|
||||
* 删除转码文档结果 block
|
||||
*
|
||||
@param error 执行结果,如果成功则为 nil
|
||||
*/
|
||||
typedef void(^NIMDocTranscodingDeleteCompleteBlock)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 文档转码管理器
|
||||
*/
|
||||
@protocol NIMDocTranscodingManager <NSObject>
|
||||
|
||||
/**
|
||||
查询文档转码信息
|
||||
|
||||
@param docId 转码文档标识 id
|
||||
@param completion 查询结果 block
|
||||
*/
|
||||
- (void)inquireDocInfo:(NSString *)docId
|
||||
completion:(nullable NIMDocTranscodingInquireCompleteBlock)completion;
|
||||
|
||||
/**
|
||||
拉取文档转码信息列表
|
||||
|
||||
@param lastDocId 最后一个文档的锚点,不包括此文档。填 nil 会从最新提交的转码文档开始往前查询。
|
||||
@param limit 拉取文档的最大个数,每次拉取的个数不能超过 30
|
||||
@param completion 拉取结果 block
|
||||
*/
|
||||
- (void)fetchMyDocsInfo:(nullable NSString *)lastDocId
|
||||
limit:(NSUInteger)limit
|
||||
completion:(nullable NIMDocTranscodingFetchCompleteBlock)completion;
|
||||
|
||||
/**
|
||||
删除转码文档
|
||||
|
||||
@param docId 转码文档标识 id
|
||||
@param completion 删除转码文档结果 block
|
||||
*/
|
||||
- (void)deleteDoc:(NSString *)docId
|
||||
completion:(nullable NIMDocTranscodingDeleteCompleteBlock)completion;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// NIMEncryptionConfig.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease on 2019/10/14.
|
||||
// Copyright © 2019 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMAsymEncryptionOption.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
非对称加密类型
|
||||
|
||||
- NIMAsymEncryptionTypeRSA: RSA加密
|
||||
- NIMAsymEncryptionTypeSM2: SM加密
|
||||
*/
|
||||
typedef NS_ENUM (NSInteger, NIMAsymEncryptionType){
|
||||
NIMAsymEncryptionTypeRSA = 1, //RSA
|
||||
NIMAsymEncryptionTypeSM2 = 1 << 1, //SM2
|
||||
};
|
||||
|
||||
/**
|
||||
对称加密类型
|
||||
|
||||
- NIMSymEncryptionTypeRC4: RC4加密
|
||||
- NIMSymEncryptionTypeAES: AES加密
|
||||
- NIMSymEncryptionTypeSM4: SM4加密
|
||||
*/
|
||||
typedef NS_ENUM (NSInteger, NIMSymEncryptionType){
|
||||
NIMSymEncryptionTypeRC4 = 1, //RC4
|
||||
NIMSymEncryptionTypeAES = 1 << 1, //AES
|
||||
NIMSymEncryptionTypeSM4 = 1 << 2, //SM4
|
||||
};
|
||||
|
||||
@interface NIMEncryptionConfig : NSObject
|
||||
|
||||
/// 非对称加密类型(默认:RSA)
|
||||
@property (nonatomic, assign) NIMAsymEncryptionType asymEncryptionType;
|
||||
|
||||
/// 对称加密类型(默认:RC4)
|
||||
@property (nonatomic, assign) NIMSymEncryptionType symEncryptionType;
|
||||
|
||||
/// 更新非对称加密RSA的配置
|
||||
/// @param option RSA配置
|
||||
- (void)updateRSAOption:(NIMRSAOption *)option;
|
||||
|
||||
/// 更新非对称加密SM2的配置
|
||||
/// @param option SM2配置
|
||||
- (void)updateSM2Option:(NIMSM2Option *)option;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
//
|
||||
// NIMEventSubscribeManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2017 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMSubscribeEvent;
|
||||
@class NIMSubscribeRequest;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 事件普通回调
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
* @param event 事件,填充了发布的时间
|
||||
*/
|
||||
typedef void(^NIMEventSubscribeBlock)(NSError * __nullable error, NIMSubscribeEvent * __nullable event);
|
||||
|
||||
/**
|
||||
* 订阅/取消订阅事件回调
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil,
|
||||
* @param failedPublishers 失败的发布者 Id, 为 nil 则全部订阅/取消订阅成功
|
||||
*/
|
||||
typedef void(^NIMEventSubscribeResponseBlock)(NSError * __nullable error, NSArray * __nullable failedPublishers);
|
||||
|
||||
|
||||
/**
|
||||
* 事件查询回调
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil,
|
||||
* @param results NIMSubscribeResult 数组 本账号订阅的事件详情,包括订阅了谁,订阅的时间以及有效期等等
|
||||
*/
|
||||
typedef void(^NIMEventSubscribeQueryBlock)(NSError * __nullable error, NSArray * __nullable results);
|
||||
|
||||
|
||||
/**
|
||||
* 订阅回调
|
||||
*/
|
||||
@protocol NIMEventSubscribeManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* 收到所订阅的事件的回调
|
||||
* @param events 广播的事件 NIMSubscribeEvent 列表
|
||||
*/
|
||||
- (void)onRecvSubscribeEvents:(NSArray *)events;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 事件订阅协议
|
||||
*/
|
||||
@protocol NIMEventSubscribeManager <NSObject>
|
||||
|
||||
/**
|
||||
* 发布事件
|
||||
*
|
||||
* @param event 需要广播的事件,事件可被其他人订阅
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)publishEvent:(NIMSubscribeEvent *)event
|
||||
completion:(nullable NIMEventSubscribeBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 订阅事件
|
||||
*
|
||||
* @param request 订阅请求
|
||||
* @param completion 完成回调
|
||||
* @discussion 请求中必需填写 type,expiry,publishers 字段
|
||||
*/
|
||||
- (void)subscribeEvent:(NIMSubscribeRequest *)request
|
||||
completion:(nullable NIMEventSubscribeResponseBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 取消订阅事件
|
||||
*
|
||||
* @param request 取消订阅请求
|
||||
* @param completion 完成回调
|
||||
* @discussion 请求中必须填写 type 字段 , 如果不填写 publishers 字段,则取消指定事件的全部订阅关系
|
||||
*/
|
||||
- (void)unSubscribeEvent:(NIMSubscribeRequest *)request
|
||||
completion:(nullable NIMEventSubscribeResponseBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 查询订阅事件
|
||||
*
|
||||
* @param request 查询请求
|
||||
* @param completion 完成回调
|
||||
* @discussion 请求中必须填写 type 字段 和 publishers 字段
|
||||
*/
|
||||
- (void)querySubscribeEvent:(NIMSubscribeRequest *)request
|
||||
completion:(nullable NIMEventSubscribeQueryBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 添加通知对象
|
||||
*
|
||||
* @param delegate 通知对象
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMEventSubscribeManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除通知对象
|
||||
*
|
||||
* @param delegate 通知对象
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMEventSubscribeManagerDelegate>)delegate;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// NIMFileObject.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMMessageObjectProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 文件的实例对象
|
||||
*/
|
||||
@interface NIMFileObject : NSObject<NIMMessageObject>
|
||||
|
||||
/**
|
||||
* 文件对象初始化方法(根据文件路径)
|
||||
*
|
||||
* @param sourcePath 文件路径
|
||||
*
|
||||
* @return 文件实例对象
|
||||
*/
|
||||
- (instancetype)initWithSourcePath:(NSString *)sourcePath;
|
||||
|
||||
|
||||
/**
|
||||
* 文件对象初始化方法(根据文件数据)
|
||||
*
|
||||
* @param data 文件数据
|
||||
* @param extension 文件拓展名
|
||||
* @return 文件实例对象
|
||||
*/
|
||||
|
||||
- (instancetype)initWithData:(NSData*)data extension:(NSString*)extension;
|
||||
|
||||
|
||||
/**
|
||||
* 文件对象初始化方法(根据文件路径)
|
||||
*
|
||||
* @param sourcePath 文件路径
|
||||
* @param scene 场景类别
|
||||
*
|
||||
* @return 文件实例对象
|
||||
*/
|
||||
- (instancetype)initWithSourcePath:(NSString *)sourcePath scene:(NSString *)scene;
|
||||
|
||||
|
||||
/**
|
||||
* 文件对象初始化方法(根据文件数据)
|
||||
*
|
||||
* @param data 文件数据
|
||||
* @param extension 文件拓展名
|
||||
* @param scene 场景类别
|
||||
* @return 文件实例对象
|
||||
*/
|
||||
|
||||
- (instancetype)initWithData:(NSData*)data extension:(NSString*)extension scene:(NSString *)scene;
|
||||
|
||||
/**
|
||||
* 设置上传的url,用于发送已经上传好的资源
|
||||
*
|
||||
* @param urlString 图片的地址
|
||||
*
|
||||
*/
|
||||
- (void)setUploadURL:(NSString *)urlString;
|
||||
|
||||
/**
|
||||
* 文件显示名
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *displayName;
|
||||
|
||||
/**
|
||||
* 文件的本地路径
|
||||
*/
|
||||
@property (nullable ,nonatomic, copy, readonly) NSString *path;
|
||||
|
||||
/**
|
||||
* 文件的远程路径
|
||||
*/
|
||||
@property (nullable,nonatomic, copy, readonly) NSString *url;
|
||||
|
||||
|
||||
/**
|
||||
* 文件MD5
|
||||
*/
|
||||
@property (nullable,nonatomic, copy, readonly) NSString *md5;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) long long fileLength;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// Created by cqu227hk on 2022/12/08.
|
||||
// Copyright (c) 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 统一类型调用参数定义
|
||||
*/
|
||||
@interface NIMGenericTypeAPICallParam : NSObject
|
||||
|
||||
/**
|
||||
* 调用序列号,调用方产生,在执行结果中带回
|
||||
*/
|
||||
@property (nonatomic,assign) NSInteger sn;
|
||||
/**
|
||||
* 调用上下文数据,调用方产生,SDK不维护此数据的生命周期,在执行结果中带回
|
||||
*/
|
||||
@property (nonatomic,assign) id data;
|
||||
/**
|
||||
* api名称
|
||||
*/
|
||||
@property (nonatomic,copy) NSString* name;
|
||||
/**
|
||||
* api参数,json format
|
||||
*/
|
||||
@property (nonatomic,copy) NSString* param;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 统一类型调用结果参数定义
|
||||
*/
|
||||
@interface NIMGenericTypeAPICallResult : NSObject
|
||||
|
||||
/**
|
||||
* 调用序列号用户生成,与调用参数中的sn字段一致
|
||||
*/
|
||||
@property (nonatomic,assign) NSInteger sn;
|
||||
/**
|
||||
* 调用上下文数据,与调用参数中的data字段一致
|
||||
*/
|
||||
@property (nonatomic,assign) id data;
|
||||
/**
|
||||
* api名称
|
||||
*/
|
||||
@property (nonatomic,copy) NSString* name;
|
||||
/**
|
||||
* api 结果参数,json format
|
||||
*/
|
||||
@property (nonatomic,copy) NSString* result;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 统一类型调用执行结果回调定义
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
* @param result 调用结果,如果失败,result 可能为 nil
|
||||
*/
|
||||
typedef void(^NIMGenericTypeAPICallInvokeCallback)(NSError * __nullable error, NIMGenericTypeAPICallResult * __nullable result);
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// Created by NetEase on 2022/10/10.
|
||||
// Copyright (c) 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
|
||||
@interface NIMGetMessagesByTagsParam : NSObject <NSCopying>
|
||||
/**
|
||||
* 聊天室ID
|
||||
*/
|
||||
@property(nonatomic, readonly, assign) NSInteger roomId;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@property(nonatomic, readonly, nonnull, copy) NSArray<NSString *> *tags;
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
@property(nonatomic, nullable, copy) NSArray<NSNumber *> *messageTypes;
|
||||
/**
|
||||
* 起始时间s
|
||||
* NSTimeInterval,即double
|
||||
*/
|
||||
@property(nonatomic, nullable, copy) NSNumber *fromTime;
|
||||
/**
|
||||
* 结束时间s
|
||||
* NSTimeInterval,即double
|
||||
*/
|
||||
@property(nonatomic, nullable, copy) NSNumber *toTime;
|
||||
/**
|
||||
* 最大消息数量
|
||||
* NSInteger
|
||||
*/
|
||||
@property(nonatomic, nullable, copy) NSNumber *limit;
|
||||
/**
|
||||
* 是否反向
|
||||
* BOOL
|
||||
*/
|
||||
@property(nonatomic, nullable, copy) NSNumber *reverse;
|
||||
|
||||
- (instancetype)initWithRoomId:(NSInteger)roomId tags:(nonnull NSArray<NSString *> *)tags;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,438 @@
|
||||
//
|
||||
// NIMGlobalDefs.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NIMLib_NIMGlobalDefs_h
|
||||
#define NIMLib_NIMGlobalDefs_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* 消息内容类型枚举
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMMessageType){
|
||||
/**
|
||||
* 文本类型消息
|
||||
*/
|
||||
NIMMessageTypeText = 0,
|
||||
/**
|
||||
* 图片类型消息
|
||||
*/
|
||||
NIMMessageTypeImage = 1,
|
||||
/**
|
||||
* 声音类型消息
|
||||
*/
|
||||
NIMMessageTypeAudio = 2,
|
||||
/**
|
||||
* 视频类型消息
|
||||
*/
|
||||
NIMMessageTypeVideo = 3,
|
||||
/**
|
||||
* 位置类型消息
|
||||
*/
|
||||
NIMMessageTypeLocation = 4,
|
||||
/**
|
||||
* 通知类型消息
|
||||
*/
|
||||
NIMMessageTypeNotification = 5,
|
||||
/**
|
||||
* 文件类型消息
|
||||
*/
|
||||
NIMMessageTypeFile = 6,
|
||||
/**
|
||||
* 提醒类型消息
|
||||
*/
|
||||
NIMMessageTypeTip = 10,
|
||||
/**
|
||||
* 机器人类型消息
|
||||
*/
|
||||
NIMMessageTypeRobot = 11,
|
||||
/**
|
||||
* Rtc通话单
|
||||
*/
|
||||
NIMMessageTypeRtcCallRecord = 12,
|
||||
/**
|
||||
* 自定义类型消息
|
||||
*/
|
||||
NIMMessageTypeCustom = 100
|
||||
};
|
||||
|
||||
/**
|
||||
* 网络通话类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMNetCallType){
|
||||
/**
|
||||
* 音频通话
|
||||
*/
|
||||
NIMNetCallTypeAudio = 1,
|
||||
/**
|
||||
* 视频通话
|
||||
*/
|
||||
NIMNetCallTypeVideo = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* NIM本地Error Domain
|
||||
*/
|
||||
extern NSString *const NIMLocalErrorDomain;
|
||||
|
||||
/**
|
||||
* NIM服务器Error Domain
|
||||
*/
|
||||
extern NSString *const NIMRemoteErrorDomain;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 本地错误码 (IM 和通用) Domain NIMLocalErrorDomain
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMLocalErrorCode) {
|
||||
/**
|
||||
* 错误的参数
|
||||
*/
|
||||
NIMLocalErrorCodeInvalidParam = 1,
|
||||
/**
|
||||
* 多媒体文件异常
|
||||
*/
|
||||
NIMLocalErrorCodeInvalidMedia = 2,
|
||||
/**
|
||||
* 图片异常
|
||||
*/
|
||||
NIMLocalErrorCodeInvalidPicture = 3,
|
||||
/**
|
||||
* url异常
|
||||
*/
|
||||
NIMLocalErrorCodeInvalidUrl = 4,
|
||||
/**
|
||||
* 读取/写入文件失败
|
||||
*/
|
||||
NIMLocalErrorCodeIOError = 5,
|
||||
/**
|
||||
* 无效的token
|
||||
*/
|
||||
NIMLocalErrorCodeInvalidToken = 6,
|
||||
/**
|
||||
* Http请求失败
|
||||
*/
|
||||
NIMLocalErrorCodeHttpReqeustFailed = 7,
|
||||
/**
|
||||
* 无录音权限
|
||||
*/
|
||||
NIMLocalErrorCodeAudioRecordErrorNoPermission = 8,
|
||||
/**
|
||||
* 录音初始化失败
|
||||
*/
|
||||
NIMLocalErrorCodeAudioRecordErrorInitFailed = 9,
|
||||
/**
|
||||
* 录音失败
|
||||
*/
|
||||
NIMLocalErrorCodeAudioRecordErrorRecordFailed = 10,
|
||||
/**
|
||||
* 播放初始化失败
|
||||
*/
|
||||
NIMLocalErrorCodeAudioPlayErrorInitFailed = 11,
|
||||
/**
|
||||
* SQL语句执行失败
|
||||
*/
|
||||
NIMLocalErrorCodeSQLFailed = 12,
|
||||
/**
|
||||
* 用户信息缺失 (未登录 或 未提供用户资料)
|
||||
*/
|
||||
NIMLocalErrorCodeUserInfoNeeded = 13,
|
||||
|
||||
/**
|
||||
* AppKey 缺失,未注册 AppKey 就进行登录行为之类的接口
|
||||
*/
|
||||
NIMLocalErrorCodeAppKeyNeed = 14,
|
||||
|
||||
/**
|
||||
* 自动登录超过次数限制,一般情况下都是当前网络有问题引起,如当前网络可以连接,但无法自由收发包等
|
||||
*/
|
||||
|
||||
NIMLocalErrorCodeAutoLoginRetryLimit = 15,
|
||||
|
||||
/**
|
||||
* 相同的操作正在执行,请不要多次调用
|
||||
*/
|
||||
NIMLocalErrorCodeSameOperationInProgress = 16,
|
||||
|
||||
/**
|
||||
* 独立模式下获取聊天室服务器地址失败
|
||||
*/
|
||||
NIMLocalErrorCodeRequestChatroomAddressesFailed= 17,
|
||||
|
||||
/**
|
||||
* 群已读回执功能未开启,请使用 NIMSDKConfig 进行开启
|
||||
*/
|
||||
NIMLocalErrorCodeTeamReceiptDisabled = 18,
|
||||
|
||||
/**
|
||||
* 主动取消任务
|
||||
*/
|
||||
NIMLocalErrorCodeManualCancelTask = 19,
|
||||
/**
|
||||
* 资源过期
|
||||
*/
|
||||
NIMLocalErrorCodeResourcesOverdue = 20,
|
||||
/**
|
||||
* 场景未注册
|
||||
*/
|
||||
NIMLocalErrorCodeSceneUnregistered = 21,
|
||||
/**
|
||||
* Database 读写异常
|
||||
*/
|
||||
NIMLocalErrorCodeDatabaseError = 22,
|
||||
/**
|
||||
* 重复加入白板会议
|
||||
*/
|
||||
NIMLocalErrorCodeJoinSameRTSConference = 23,
|
||||
|
||||
/**
|
||||
* 功能不支持
|
||||
*/
|
||||
NIMLocalErrorCodeNotSupported = 24,
|
||||
|
||||
/**
|
||||
* 未知问题
|
||||
*/
|
||||
NIMLocalErrorCodeUnknownError = 25,
|
||||
|
||||
/**
|
||||
* 保存文件失败
|
||||
*/
|
||||
NIMLocalErrorCodeSaveFileError = 26,
|
||||
/**
|
||||
* 接口调用过于频繁
|
||||
*/
|
||||
NIMLocalErrorCodeFrequentCallError = 27,
|
||||
/**
|
||||
* 和设置冲突
|
||||
*/
|
||||
NIMLocalErrorCodeSettingConflictError = 28,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 服务器错误码 (IM 和通用) Doamin NIMRemoteErrorDomain
|
||||
* @discussion 更多错误详见 [服务器端状态码](http://dev.netease.im/docs?doc=nim_status_code#服务器端状态码)
|
||||
* 用户第三方回调自定义错误码范围 20000-20099
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMRemoteErrorCode) {
|
||||
/**
|
||||
* 客户端版本错误
|
||||
*/
|
||||
NIMRemoteErrorCodeInvalidVersion = 201,
|
||||
/**
|
||||
* 密码错误
|
||||
*/
|
||||
NIMRemoteErrorCodeInvalidPass = 302,
|
||||
/**
|
||||
* CheckSum校验失败
|
||||
*/
|
||||
NIMRemoteErrorCodeInvalidCRC = 402,
|
||||
/**
|
||||
* 非法操作或没有权限
|
||||
*/
|
||||
NIMRemoteErrorCodeForbidden = 403,
|
||||
/**
|
||||
* 请求的目标(用户或对象)不存在
|
||||
*/
|
||||
NIMRemoteErrorCodeNotExist = 404,
|
||||
/**
|
||||
* 对象只读
|
||||
*/
|
||||
NIMRemoteErrorCodeReadOnly = 406,
|
||||
/**
|
||||
* 请求过程超时
|
||||
*/
|
||||
NIMRemoteErrorCodeTimeoutError = 408,
|
||||
/**
|
||||
* 参数错误
|
||||
*/
|
||||
NIMRemoteErrorCodeParameterError = 414,
|
||||
/**
|
||||
* 网络连接出现错误
|
||||
*/
|
||||
NIMRemoteErrorCodeConnectionError = 415,
|
||||
/**
|
||||
* 操作太过频繁
|
||||
*/
|
||||
NIMRemoteErrorCodeFrequently = 416,
|
||||
/**
|
||||
* 对象已经存在
|
||||
*/
|
||||
NIMRemoteErrorCodeExist = 417,
|
||||
/**
|
||||
* 数量超限
|
||||
*/
|
||||
NIMRemoteErrorCodeBeyondLimit = 419,
|
||||
/**
|
||||
* 账号被禁用
|
||||
*/
|
||||
NIMRemoteErrorAccountBlock = 422,
|
||||
/**
|
||||
* 未知错误
|
||||
*/
|
||||
NIMRemoteErrorCodeUnknownError = 500,
|
||||
/**
|
||||
* 服务器数据错误
|
||||
*/
|
||||
NIMRemoteErrorCodeServerDataError = 501,
|
||||
/**
|
||||
* 不足
|
||||
*/
|
||||
NIMRemoteErrorCodeNotEnough = 507,
|
||||
/**
|
||||
* 超过期限
|
||||
*/
|
||||
NIMRemoteErrorCodeDomainExpireOld = 508,
|
||||
/**
|
||||
* 无效协议
|
||||
*/
|
||||
NIMRemoteErrorCodeInvalidProtocol = 509,
|
||||
/**
|
||||
* 用户不存在
|
||||
*/
|
||||
NIMRemoteErrorCodeUserNotExist = 510,
|
||||
/**
|
||||
* 服务不可用
|
||||
*/
|
||||
NIMRemoteErrorCodeServiceUnavailable = 514,
|
||||
/**
|
||||
* 群人数超过上限
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamMemberLimit = 801,
|
||||
/**
|
||||
* 没有操作群的权限
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamAccessError = 802,
|
||||
/**
|
||||
* 群组不存在
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamNotExists = 803,
|
||||
/**
|
||||
* 用户不在兴趣组内
|
||||
*/
|
||||
NIMRemoteErrorCodeNotInTeam = 804,
|
||||
/**
|
||||
* 群类型错误
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamInvaildType = 805,
|
||||
/**
|
||||
* 超出群个数限制
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamCountLimit = 806,
|
||||
/**
|
||||
* 已经在群里
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamAlreadyIn = 809,
|
||||
/**
|
||||
* 不是群成员
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamNotMember = 810,
|
||||
/**
|
||||
* 在群黑名单中
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamBlackList = 812,
|
||||
/**
|
||||
* 请求群信息列表部分成功
|
||||
*/
|
||||
NIMRemoteErrorCodeTeamsPartialSuccess = 816,
|
||||
/**
|
||||
* 解包错误
|
||||
*/
|
||||
NIMRemoteErrorCodeEUnpacket = 998,
|
||||
/**
|
||||
* 打包错误
|
||||
*/
|
||||
NIMRemoteErrorCodeEPacket = 999,
|
||||
|
||||
/**
|
||||
* 在对方的黑名单中
|
||||
*/
|
||||
NIMRemoteErrorCodeInBlackList = 7101,
|
||||
|
||||
/**
|
||||
* 聊天室状态异常
|
||||
*/
|
||||
NIMRemoteErrorCodeInvalidChatroom = 13002,
|
||||
/**
|
||||
* 账号在黑名单中,不允许进入聊天室
|
||||
*/
|
||||
NIMRemoteErrorCodeInChatroomBlackList = 13003,
|
||||
/**
|
||||
* 在禁言列表中,不允许发言
|
||||
*/
|
||||
NIMRemoteErrorCodeInChatroomMuteList = 13004,
|
||||
/**
|
||||
* 聊天室处于整体禁言状态,只有管理员能发言
|
||||
*/
|
||||
NIMRemoteErrorCodeInChatroomAllMute = 13006,
|
||||
/**
|
||||
* 通用音视频协议:对方云信不在线
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResPeerNIMOffline = 10201,
|
||||
/**
|
||||
* 通用音视频协议:对方推送亦不可达
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResPeerPushOffline = 10202,
|
||||
/**
|
||||
* 通用音视频协议:房间不存在
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResRoomNotExists = 10404,
|
||||
/**
|
||||
* 通用音视频协议:房间已存在
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResRoomHasExists = 10405,
|
||||
/**
|
||||
* 通用音视频协议:不在房间内
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResRoomMemberNotExists = 10406,
|
||||
/**
|
||||
* 通用音视频协议:已经在房间内
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResRoomMemberHasExists = 10407,
|
||||
/**
|
||||
* 通用音视频协议:邀请不存在或已过期
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResInviteNotExists = 10408,
|
||||
/**
|
||||
* 通用音视频协议:邀请已经拒绝
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResInviteHasReject = 10409,
|
||||
/**
|
||||
* 通用音视频协议:邀请已经接受了
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResInviteHasAccept = 10410,
|
||||
/**
|
||||
* 通用音视频协议:uid冲突
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResUidConflict = 10417,
|
||||
/**
|
||||
* 通用音视频协议:房间人数超限
|
||||
*/
|
||||
NIMRemoteErrorCodeSignalResRoomMemberExceed = 10419,
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户资料场景(头像等)
|
||||
*/
|
||||
extern NSString *const NIMNOSSceneTypeAvatar;
|
||||
|
||||
/**
|
||||
* IM 消息 (图片,文件,音频,视频消息发送)
|
||||
*/
|
||||
extern NSString *const NIMNOSSceneTypeMessage;
|
||||
|
||||
/**
|
||||
* 用户资料场景(下载权限)
|
||||
*/
|
||||
extern NSString *const NIMNOSSceneTypeSecurity;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,210 @@
|
||||
//
|
||||
// NIMImageObject.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMMessageObjectProtocol.h"
|
||||
#import "NIMPlatform.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 图片格式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMImageFormat)
|
||||
{
|
||||
/**
|
||||
* Jpeg格式
|
||||
*/
|
||||
NIMImageFormatJPEG,
|
||||
/**
|
||||
* Png格式
|
||||
*/
|
||||
NIMImageFormatPNG,
|
||||
};
|
||||
|
||||
/**
|
||||
* 图片选项
|
||||
*/
|
||||
@interface NIMImageOption : NSObject
|
||||
/**
|
||||
* 压缩参数默认为 0.5,可传入0.0-1.0的值,如果传入非法参数,则按照 0.5 进行压缩
|
||||
*/
|
||||
@property (nonatomic,assign) float compressQuality;
|
||||
|
||||
/**
|
||||
* 图片压缩格式,默认为JPEG
|
||||
*/
|
||||
@property (nonatomic,assign) NIMImageFormat format;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 图片实例对象
|
||||
*/
|
||||
@interface NIMImageObject : NSObject<NIMMessageObject>
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法
|
||||
*
|
||||
* @param image 要发送的图片
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithImage:(UIImage*)image;
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法
|
||||
*
|
||||
* @param filepath 要发送的图片路径
|
||||
*
|
||||
* @discussion 使用此方法上传是不做压缩转换的原图上传。iOS 11 苹果采用了新的图片格式 HEIC ,如果采用原图会导致其他设备的兼容问题,请开发者在上层做好格式的兼容转换。
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithFilepath:(NSString *)filepath;
|
||||
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法
|
||||
*
|
||||
* @param data 图片数据
|
||||
* @param extension 推荐使用的图片数据后缀名
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithData:(NSData *)data
|
||||
extension:(NSString *)extension;
|
||||
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法
|
||||
*
|
||||
* @param image 要发送的图片
|
||||
* @param scene 场景类别
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithImage:(UIImage*)image scene:(NSString *)scene;
|
||||
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法
|
||||
*
|
||||
* @param filepath 要发送的图片路径
|
||||
* @param scene 场景类别
|
||||
*
|
||||
* @discussion 使用此方法上传是不做压缩转换的原图上传。iOS 11 苹果采用了新的图片格式 HEIC ,如果采用原图会导致其他设备的兼容问题,请开发者在上层做好格式的兼容转换。
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithFilepath:(NSString *)filepath scene:(NSString *)scene;
|
||||
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法, 可用于发送Webp图片
|
||||
*
|
||||
* @param filepath 要发送的图片路径
|
||||
* @param scene 场景类别
|
||||
* @param size 图片宽高,当发送文件为Webp时须需要传入该图片尺寸大小
|
||||
*
|
||||
* @discussion 使用此方法上传是不做压缩转换的原图上传。iOS 11 苹果采用了新的图片格式 HEIC ,如果采用原图会导致其他设备的兼容问题,请开发者在上层做好格式的兼容转换。
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithFilepath:(NSString *)filepath
|
||||
scene:(NSString *)scene
|
||||
size:(CGSize)size;
|
||||
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法
|
||||
*
|
||||
* @param data 图片数据
|
||||
* @param extension 推荐使用的图片数据后缀名
|
||||
* @param scene 场景类别
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithData:(NSData *)data
|
||||
extension:(NSString *)extension
|
||||
scene:(NSString *)scene;
|
||||
|
||||
|
||||
/**
|
||||
* 图片实例对象初始化方法, 可用于发送Webp图片
|
||||
*
|
||||
* @param data 图片数据
|
||||
* @param extension 推荐使用的图片数据后缀名
|
||||
* @param scene 场景类别
|
||||
* @param size 图片宽高,当发送文件为Webp时须需要传入该图片尺寸大小
|
||||
*
|
||||
* @return 图片实例对象
|
||||
*/
|
||||
- (instancetype)initWithData:(NSData *)data
|
||||
extension:(NSString *)extension
|
||||
scene:(NSString *)scene
|
||||
size:(CGSize)size;
|
||||
|
||||
/**
|
||||
* 设置上传的url,用于发送已经上传好的资源
|
||||
*
|
||||
* @param urlString 图片的地址
|
||||
*
|
||||
*/
|
||||
- (void)setUploadURL:(NSString *)urlString;
|
||||
|
||||
/**
|
||||
* 文件展示名
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *displayName;
|
||||
|
||||
|
||||
/**
|
||||
* 图片本地路径
|
||||
* @discussion 目前 SDK 没有提供下载大图的方法,但推荐使用这个地址作为图片下载地址,APP 可以使用自己的下载类或者 SDWebImage 做图片的下载和管理
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *path;
|
||||
|
||||
/**
|
||||
* 缩略图本地路径
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *thumbPath;
|
||||
|
||||
|
||||
/**
|
||||
* 图片远程路径
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *url;
|
||||
|
||||
/**
|
||||
* 缩略图远程路径
|
||||
* @discussion 仅适用于使用云信上传服务进行上传的资源,否则无效。
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *thumbUrl;
|
||||
|
||||
/**
|
||||
* 图片尺寸
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGSize size;
|
||||
|
||||
/**
|
||||
* 图片选项
|
||||
* @discussion 仅在发送时且通过 initWithImage: 方式初始化才有效
|
||||
*/
|
||||
@property (nullable, nonatomic ,strong) NIMImageOption *option;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) long long fileLength;
|
||||
|
||||
/**
|
||||
* 图片MD5
|
||||
*/
|
||||
@property (nullable,nonatomic, copy, readonly) NSString *md5;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMImportedRecentSession.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2018年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMSession;
|
||||
|
||||
/**
|
||||
* 待导入的最近会话模型
|
||||
*/
|
||||
@interface NIMImportedRecentSession : NSObject
|
||||
|
||||
/**
|
||||
* 会话
|
||||
* @discussion 当前只支持 P2P 和 Team 会话类型
|
||||
*/
|
||||
@property (nonatomic,copy) NIMSession *session;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
* @discussion 最近会话的当前时间
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval timestamp;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// NIMIncompleteSessionInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by He on 2020/3/18.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMSession;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 未完整会话信息
|
||||
*/
|
||||
@interface NIMIncompleteSessionInfo : NSObject <NSCopying>
|
||||
/**
|
||||
* 会话
|
||||
*/
|
||||
@property (nonatomic,strong,readonly) NIMSession *session;
|
||||
/**
|
||||
* 发送方
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *from;
|
||||
/**
|
||||
* 消息时间戳(单位:s)
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSTimeInterval timestamp;
|
||||
/**
|
||||
* 消息服务端ID
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *serverId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,278 @@
|
||||
//
|
||||
// NIMIndexManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2021 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMSession;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 索引类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMIndexType) {
|
||||
/**
|
||||
* 消息文本
|
||||
*/
|
||||
NIMIndexTypeMsgText = 0,
|
||||
|
||||
/**
|
||||
* 自定义索引类型起始
|
||||
*/
|
||||
NIMIndexTypeCustomBase = 100,
|
||||
};
|
||||
|
||||
/**
|
||||
* 索引文本
|
||||
*/
|
||||
@interface NIMIndexText : NSObject
|
||||
|
||||
/**
|
||||
* 索引文本
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *text;
|
||||
|
||||
/**
|
||||
* 索引类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger type;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 消息索引记录结构
|
||||
*/
|
||||
@interface NIMMsgIndexRecord : NSObject<NSCopying>
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString * messageId;
|
||||
|
||||
/**
|
||||
* 索引文本
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString * indexText;
|
||||
|
||||
/**
|
||||
* 索引类型
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger indexType;
|
||||
|
||||
/**
|
||||
* 会话
|
||||
*/
|
||||
@property (nonatomic, copy) NIMSession * session;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval timestamp;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@property (nullable, nonatomic) NIMMessage * message;
|
||||
|
||||
@end
|
||||
|
||||
typedef NS_ENUM(NSInteger, NIMMsgIndexTimeOrder) {
|
||||
/**
|
||||
* 消息时间从新往旧
|
||||
*/
|
||||
NIMMsgIndexTimeOrderDesc = 0,
|
||||
|
||||
/**
|
||||
* 消息时间从旧往新
|
||||
*/
|
||||
NIMMsgIndexTimeOrderAsc = 1,
|
||||
};
|
||||
|
||||
@interface NIMMsgIndexQueryOption : NSObject
|
||||
|
||||
/**
|
||||
* 起始时间,默认为0
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval startTime;
|
||||
|
||||
/**
|
||||
* 结束时间,默认为0
|
||||
* @discussion 搜索的结束时间,0 表示最大时间戳
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval endTime;
|
||||
|
||||
/**
|
||||
* 检索顺序
|
||||
*/
|
||||
@property (nonatomic, assign) NIMMsgIndexTimeOrder timeOrder;
|
||||
|
||||
/**
|
||||
* 检索条数
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger limit;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 在消息索引结果基础上查询消息 Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
*/
|
||||
typedef void(^NIMMsgIndexQueryMsgBlock)(NSError * __nullable error);
|
||||
|
||||
@interface NIMMsgIndexQueryResult : NSObject
|
||||
|
||||
/**
|
||||
* 不包含任何结果
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL empty;
|
||||
|
||||
/**
|
||||
* 排序的会话列表
|
||||
*/
|
||||
@property (nonatomic, nullable, readonly) NSArray<NIMSession *> * sessions;
|
||||
|
||||
/**
|
||||
* 分会话索引记录
|
||||
*/
|
||||
@property (nonatomic, nullable, readonly) NSDictionary<NIMSession *, NSArray<NIMMsgIndexRecord *> *> * records;
|
||||
|
||||
/**
|
||||
* 是否包含消息
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL withMesssage;
|
||||
|
||||
/**
|
||||
* 分会话索引记录
|
||||
*
|
||||
* @param session 指定会话
|
||||
* @discussion
|
||||
*/
|
||||
- (NSArray<NIMMessage *> *)messages:(nonnull NIMSession *)session;
|
||||
|
||||
/**
|
||||
* 查询结果中的消息数量
|
||||
*
|
||||
* @param session 指定会话,不传表示所有
|
||||
* @discussion
|
||||
*/
|
||||
- (NSUInteger)messageCount:(nullable NIMSession *)session;
|
||||
|
||||
/**
|
||||
* 查询消息
|
||||
*
|
||||
* @param session 指定会话,不传表示所有
|
||||
* @param completion 完成回调
|
||||
* @discussion 消息结果记录在查询结果中
|
||||
*/
|
||||
- (void)queryMessage:(nullable NIMSession *)session
|
||||
completion:(nullable NIMMsgIndexQueryMsgBlock)completion;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 消息索引生成委托
|
||||
*/
|
||||
@protocol NIMMsgIndexProduceDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
- (nullable NSString *)produceText:(NIMMessage *)message;
|
||||
|
||||
- (nullable NSArray<NIMIndexText *> *)produceTexts:(NIMMessage *)message;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 同步消息索引 Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
*/
|
||||
typedef void(^NIMSyncMsgIndexBlock)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 查询消息索引 Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
*/
|
||||
typedef void(^NIMQueryMsgIndexBlock)(NSError * __nullable error, NIMMsgIndexQueryResult * __nullable result);
|
||||
|
||||
/**
|
||||
* 重置消息索引 Block
|
||||
*
|
||||
* @param error 错误信息,如果成功,error 为 nil
|
||||
*/
|
||||
typedef void(^NIMResetMsgIndexBlock)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 索引委托
|
||||
*/
|
||||
@protocol NIMIndexManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 索引协议
|
||||
*/
|
||||
@protocol NIMIndexManager <NSObject>
|
||||
|
||||
/**
|
||||
* 同步消息索引
|
||||
*
|
||||
* @param old 同步方向,YES往老方向,NO往新方向
|
||||
* @param session 指定会话,不传表示所有
|
||||
* @param completion 完成回调
|
||||
* @discussion 老方向和新方向不代表消息产生时间,而是指存入本地的时间
|
||||
*/
|
||||
- (void)syncMsgIndex:(BOOL)old
|
||||
session:(nullable NIMSession *)session
|
||||
completion:(nullable NIMSyncMsgIndexBlock)completion;
|
||||
|
||||
/**
|
||||
* 查询消息索引
|
||||
*
|
||||
* @param text 查询文本
|
||||
* @param session 指定会话,不传表示所有
|
||||
* @param option 查询选项
|
||||
* @param withMesssage 是否查询消息
|
||||
* @param completion 完成回调
|
||||
* @discussion 老方向和新方向不代表消息产生时间,而是指存入本地的时间
|
||||
*/
|
||||
- (void)queryMsgIndex:(nonnull NSString *)text
|
||||
session:(nullable NIMSession *)session
|
||||
option:(nullable NIMMsgIndexQueryOption *)option
|
||||
withMessage:(BOOL)withMessage
|
||||
completion:(nullable NIMQueryMsgIndexBlock)completion;
|
||||
|
||||
/**
|
||||
* 重置消息索引
|
||||
*
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)resetMsgIndex:(nullable NIMResetMsgIndexBlock)completion;
|
||||
|
||||
/**
|
||||
* 添加索引委托
|
||||
*
|
||||
* @param delegate 检索委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMIndexManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除索引委托
|
||||
*
|
||||
* @param delegate 检索委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMIndexManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// NIMLoadRecentSessionsOptions.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/4/10.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMLoadRecentSessionsOptions : NSObject
|
||||
|
||||
/**
|
||||
* 是否按照置顶会话排序
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL sortByStickTopInfos;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// NIMLocationObject.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMMessageObjectProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 位置实例对象
|
||||
*/
|
||||
@interface NIMLocationObject : NSObject<NIMMessageObject>
|
||||
|
||||
/**
|
||||
* 位置实例对象初始化方法
|
||||
*
|
||||
* @param latitude 纬度
|
||||
* @param longitude 经度
|
||||
* @param title 地理位置描述
|
||||
* @return 位置实例对象
|
||||
*/
|
||||
- (instancetype)initWithLatitude:(double)latitude
|
||||
longitude:(double)longitude
|
||||
title:(nullable NSString *)title;
|
||||
|
||||
/**
|
||||
* 维度
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) double latitude;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) double longitude;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *title;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by chenjili on 2022/6/8.
|
||||
// Copyright (c) 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMLogDesensitizationConfig : NSObject <NSCopying>
|
||||
|
||||
/**
|
||||
* 是否脱下载地址,包括上传成功后得到的下载地址
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL hideDownloadUrl;
|
||||
|
||||
+ (NSString *) getPrintTextOfDownloadUrl:(NSString *) url
|
||||
config:(NIMLogDesensitizationConfig *) config;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// NIMLoginClient.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* 客户端类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMLoginClientType) {
|
||||
|
||||
/**
|
||||
* 未知类型
|
||||
*/
|
||||
NIMLoginClientTypeUnknown = 0,
|
||||
/**
|
||||
* Android
|
||||
*/
|
||||
NIMLoginClientTypeAOS = 1,
|
||||
/**
|
||||
* iOS
|
||||
*/
|
||||
NIMLoginClientTypeiOS = 2,
|
||||
/**
|
||||
* PC
|
||||
*/
|
||||
NIMLoginClientTypePC = 4,
|
||||
/**
|
||||
* WP
|
||||
*/
|
||||
NIMLoginClientTypeWP = 8,
|
||||
/**
|
||||
* WEB
|
||||
*/
|
||||
NIMLoginClientTypeWeb = 16,
|
||||
/**
|
||||
* REST API
|
||||
*/
|
||||
NIMLoginClientTypeRestful = 32,
|
||||
/**
|
||||
* macOS
|
||||
*/
|
||||
NIMLoginClientTypemacOS = 64,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 登录客户端描述
|
||||
*/
|
||||
@interface NIMLoginClient : NSObject
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMLoginClientType type;
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *os;
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSTimeInterval timestamp;
|
||||
/**
|
||||
* 自定义信息,最大32个字符;目前android多端登录,TV端和手表端,可以通过该字段区分
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *customTag;
|
||||
/**
|
||||
* 自定义登录端类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSInteger customClientType;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 自动登录参数
|
||||
*/
|
||||
@interface NIMAutoLoginData : NSObject
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *account;
|
||||
|
||||
/**
|
||||
* 令牌(在后台绑定的登录token)
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *token;
|
||||
|
||||
|
||||
@property (nonatomic) int authType;
|
||||
|
||||
@property (nonatomic,copy) NSString *loginExtension;
|
||||
|
||||
/**
|
||||
* 强制模式
|
||||
* @discussion 默认为 NO.
|
||||
* 在云信中,我们推荐用户在在首次登录时使用手动登录接口,而后的登录采用非强制的自动登录模式,这种方式可以有效的规避非法异地登录带来的损害。(设备失窃或账号失窃)
|
||||
* 非强制模式下的自动登录,服务器将检查当前登录设备是否为上一次登录设备,如果不是,服务器将拒绝这次自动登录。(返回 error code 为 417 的错误)
|
||||
* 而强制模式下的自动登录,服务器将不检查当前登录设备是否为上一次登录设备,安全性较低。但相对的更加方便,适合 IM 仅作为辅助模块的 App
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL forcedMode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 服务器时间
|
||||
*/
|
||||
@interface NIMServerTime : NSObject
|
||||
|
||||
/**
|
||||
* 服务器时间戳
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) uint64_t timestamp;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// NIMLoginKickoutResult.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/5/22.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMLoginManagerProtocol.h"
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMLoginKickoutResult : NSObject
|
||||
|
||||
@property (nonatomic, assign) NIMKickReason reasonCode;
|
||||
|
||||
@property (nonatomic, assign) NIMLoginClientType clientType;
|
||||
|
||||
@property (nonatomic, copy) NSString *reasonDesc;
|
||||
|
||||
@property (nonatomic, assign) NSInteger customClientType;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,502 @@
|
||||
//
|
||||
// NIMLoginManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMLoginClient.h"
|
||||
|
||||
#ifndef NIMDeprecated
|
||||
#define NIMDeprecated(msg) __attribute__((deprecated(msg)))
|
||||
#endif
|
||||
|
||||
@class NIMLoginKickoutResult;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 登录服务相关Block
|
||||
*
|
||||
* @param error 执行结果,如果成功error为nil
|
||||
*/
|
||||
typedef void(^NIMLoginHandler)(NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 查询服务端时间Block
|
||||
*
|
||||
* @param error 执行结果,如果成功error为nil
|
||||
*/
|
||||
typedef void(^NIMLoginGetServerTimeHandle)(NSError * __nullable error, NIMServerTime *time);
|
||||
|
||||
/**
|
||||
* 登录步骤枚举
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMLoginStep)
|
||||
{
|
||||
/**
|
||||
* 连接服务器
|
||||
*/
|
||||
NIMLoginStepLinking = 1,
|
||||
/**
|
||||
* 连接服务器成功
|
||||
*/
|
||||
NIMLoginStepLinkOK,
|
||||
/**
|
||||
* 连接服务器失败
|
||||
*/
|
||||
NIMLoginStepLinkFailed,
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
NIMLoginStepLogining,
|
||||
/**
|
||||
* 登录成功
|
||||
*/
|
||||
NIMLoginStepLoginOK,
|
||||
/**
|
||||
* 登录失败
|
||||
*/
|
||||
NIMLoginStepLoginFailed,
|
||||
/**
|
||||
* 开始同步
|
||||
*/
|
||||
NIMLoginStepSyncing,
|
||||
/**
|
||||
* 同步完成
|
||||
*/
|
||||
NIMLoginStepSyncOK,
|
||||
/**
|
||||
* 连接断开
|
||||
*/
|
||||
NIMLoginStepLoseConnection,
|
||||
/**
|
||||
* 网络切换
|
||||
* @discussion 这个并不是登录步骤的一种,但是UI有可能需要通过这个状态进行UI展现
|
||||
*/
|
||||
NIMLoginStepNetChanged,
|
||||
/**
|
||||
* 主动退出
|
||||
*/
|
||||
NIMLoginStepLogout,
|
||||
};
|
||||
|
||||
/**
|
||||
* SDK 认证模式
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMSDKAuthMode)
|
||||
{
|
||||
/**
|
||||
* 未定义
|
||||
* @discussion SDK 未调用任何登录接时或在 IM/聊天室 模式下调用 logout 接口后变化为未定义模式
|
||||
*/
|
||||
NIMSDKAuthModeUndefined = 0,
|
||||
/**
|
||||
* 通过 IM 服务器鉴权
|
||||
* @discussion 调用 NIMLoginManager login/autoLogin 接口进行登录即为 IM 鉴权模式
|
||||
*/
|
||||
NIMSDKAuthModeIM,
|
||||
/**
|
||||
* 聊天室单独鉴权
|
||||
* @discussion 调用 NIMChatroomManager 进入聊天室接口时设置 NIMChatroomIndependentMode 即为聊天室单独聊天鉴权模式
|
||||
*/
|
||||
NIMSDKAuthModeChatroom,
|
||||
};
|
||||
|
||||
/**
|
||||
* SDK 认证类型
|
||||
* 0表示最初的loginToken的校验方式,1表示基于appSecret计算的token鉴权方式,2表示基于第三方回调的token鉴权方式,默认0
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMSDKAuthType)
|
||||
{
|
||||
NIMSDKAuthTypeDefault = 0,
|
||||
NIMSDKAuthTypeDynamicToken = 1,
|
||||
NIMSDKAuthTypeThirdParty = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* 被踢下线的原因
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMKickReason)
|
||||
{
|
||||
/**
|
||||
* 被另外一个客户端踢下线 (互斥客户端一端登录挤掉上一个登录中的客户端)
|
||||
*/
|
||||
NIMKickReasonByClient = 1,
|
||||
/**
|
||||
* 被服务器踢下线
|
||||
*/
|
||||
NIMKickReasonByServer = 2,
|
||||
/**
|
||||
* 被另外一个客户端手动选择踢下线
|
||||
*/
|
||||
NIMKickReasonByClientManually = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* 多端登陆的状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMMultiLoginType){
|
||||
/**
|
||||
* 目前已经有其他端登陆
|
||||
*/
|
||||
NIMMultiLoginTypeInit = 1,
|
||||
/**
|
||||
* 其他端上线
|
||||
*/
|
||||
NIMMultiLoginTypeLogin = 2,
|
||||
/**
|
||||
* 其他端下线
|
||||
*/
|
||||
NIMMultiLoginTypeLogout = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* IM 登录相关回调接口,包括登录状态、多端登录、被踢下线、数据同步状态等事件的监听回调。
|
||||
*/
|
||||
@protocol NIMLoginManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/**
|
||||
* 被其他端(服务端/客户端)踢下线的回调。<br>
|
||||
*
|
||||
* @deprecated 请使用- (void)onKickout:(NIMLoginKickoutResult *)result;
|
||||
*
|
||||
* @par 参数说明:
|
||||
* <table>
|
||||
* <tr><th>参数名称</th><th>描述</th>
|
||||
* </tr>
|
||||
* <tr><td>code</td><td>被踢下线的原因</td>
|
||||
* </tr>
|
||||
* <tr><td>clientType</td><td>将其踢下线的设备端的类型</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
- (void)onKick:(NIMKickReason)code clientType:(NIMLoginClientType)clientType NIMDeprecated("Use -onKickout: instead");
|
||||
|
||||
/**
|
||||
* 被其他端(服务端/客户端)踢下线的回调。
|
||||
* @par 使用场景:
|
||||
* 在被踢下线时,需要知晓被踢原因以及将其踢下线的设备端类型(包括服务端和客户端)。
|
||||
* @par 调用时机:
|
||||
* 建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 触发时机:
|
||||
* <ul><li>被同一个 IM 账号的服务端踢下线。</li><li>被同一个 IM 账号的其他客户端手动调用踢人接口踢下线。</li><li>被同一个 IM 账号的其他客户端踢下线(互斥客户端一端登录自动挤掉上一个登录中的客户端,该逻辑可通过云信控制台进行配置,目前支持四种不同的 [IM 多端登录策略](https://doc.yunxin.163.com/messaging/docs/jI1MzcwNTQ?platform=iOS))。</li></ul>
|
||||
* @par 注意事项:
|
||||
* 被踢下线后,若需要重新登录,建议先进行注销(登出),再切换到登录界面进行登录。
|
||||
* @par 参数说明:
|
||||
* result:被踢后收到的回调信息,包括被踢下线的原因(NIMKickReason)和将其踢下线的设备端的类型(NIMLoginClientType)
|
||||
* @par 相关接口:
|
||||
* [kickOtherClient:completion:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#adc1ca83617c1ace26541488881d90541) 主动将其他客户端踢下线
|
||||
*/
|
||||
- (void)onKickout:(NIMLoginKickoutResult *)result;
|
||||
|
||||
/**
|
||||
* IM 登录状态的回调。
|
||||
* @par 使用场景:
|
||||
* 该回调主要用于客户端登录页面的 UI 刷新。
|
||||
* @par 调用时机:
|
||||
* 必须在创建 NIM SDK 实例(sharedSDK)之后,才能调用该接口;建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 触发时机:
|
||||
* 从调用登录 IM 接口开始,到登录结束(包括成功和失败)之间符合任一状态(NIMLoginStep)时触发回调。
|
||||
* @par 注意事项:
|
||||
* 登录成功后,SDK 会自动同步数据,数据同步完成后,整个登录过程才算真正完成。
|
||||
* @par 参数说明:
|
||||
* step:IM 登录状态信息,即登录进度,登录过程中的状态变更请参考[登录状态的转换流程](https://doc.yunxin.163.com/messaging/docs/TU3MTM2ODM?platform=iOS#登录状态转换流程)
|
||||
* @par 相关接口:
|
||||
* [login:token:authType:loginExt:completion:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a7dedc10fcbadf36fb66ce9cc9710b8f6) 登录 IM<br>
|
||||
* [autoLogin:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a7239363d8c7d432e68261094b23081b7) 自动登录 IM<br>
|
||||
* [logout:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a60f99812a55cecb9069e748ed586513b) 登出(注销) IM
|
||||
*/
|
||||
- (void)onLogin:(NIMLoginStep)step;
|
||||
|
||||
/**
|
||||
* IM 自动登录失败的回调。
|
||||
* @par 使用场景:
|
||||
* 使用 IM 自动登录后,除了因为网络超时导致的错误(SDK 会在网络超时时启用<b>断网重连机制</b>进行重连,上层应用无需处理),如果发生其他错误(如 AppKey 未被设置,参数错误,密码错误,多端登录冲突,账号被封禁,操作过于频繁等),那么在集成时需要上层应用处理对应的逻辑。您可以通过注册该方法回调,获取自动登录失败的原因,并根据原因处理上层逻辑。<br>
|
||||
* 例如:自动登录失败的原因是用户名和密码不匹配,那么上层应用需实现<b>登出并提示用户手动登录</b>或是<b>从应用服务器刷新相应的用户名和密码</b>等逻辑。
|
||||
* @par 调用时机:
|
||||
* 必须在创建 NIM SDK 实例(sharedSDK)之后,才能调用该接口;建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 触发时机:
|
||||
* 自动登录失败时触发回调。
|
||||
* @par 参数说明:
|
||||
* error:自动登录失败的原因
|
||||
* @par 相关接口:
|
||||
* [autoLogin:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a7239363d8c7d432e68261094b23081b7) 自动登录 IM
|
||||
*/
|
||||
- (void)onAutoLoginFailed:(NSError *)error;
|
||||
|
||||
/**
|
||||
* 多端登录变更的回调,监听同一账号的其他端的登录状态变更情况,即当用户通过某个客户端登录时,其他(同一账号)已经在线的客户端会收到该回调。
|
||||
* @deprecated 请使用- (void)onMultiLoginClientsChangedWithType:(NIMMultiLoginType)type;
|
||||
*/
|
||||
- (void)onMultiLoginClientsChanged;
|
||||
|
||||
/**
|
||||
* 多端登录变更的回调,监听同一账号的其他端的登录状态变更情况,即当用户通过某个客户端登录时,其他(同一账号)已经在线的客户端会收到该回调。
|
||||
* @par 使用场景:
|
||||
* 若应用支持同一账号多端登录以及互踢下线等操作,建议同一账号的各个客户端在登录注册该回调,获取其他客户端的登录状态,可以搭配 [currentLoginClients](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a055c3df878ee55c5e492f43444e2f8f3) 一起使用,查询当前登录的其他设备列表,包含客户端类型、操作系统以及登录时间等信息。
|
||||
* @par 调用时机:
|
||||
* 必须在创建 NIM SDK 实例(sharedSDK)之后,才能调用该接口;建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 参数说明:
|
||||
* type:同一账号其他端的登录状态信息,分为“其他端上线”,“其他端下线”,“目前已有其他端登录”
|
||||
* @par 相关接口:
|
||||
* [currentLoginClients](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a055c3df878ee55c5e492f43444e2f8f3) :查询同一账号的其他已登录设备
|
||||
*/
|
||||
- (void)onMultiLoginClientsChangedWithType:(NIMMultiLoginType)type;
|
||||
|
||||
/**
|
||||
* 群组用户信息同步完成的回调。
|
||||
* @par 使用场景:
|
||||
* 若需要使用应用的群组成员信息,那么要确保群组用户信息已同步至SDK 的本地数据库,可以使用该接口回调知晓群组用户信息同步是否完成。
|
||||
* @par 调用时机:
|
||||
* 必须在创建 NIM SDK 实例(sharedSDK)之后,才能调用该接口;建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 注意事项:
|
||||
* 若同步失败,建议手动将群组用户信息同步至 SDK 的本地数据库,否则可能会影响 SDK 群组相关接口的使用。
|
||||
* @par 参数说明:
|
||||
* success:群组用户信息是否同步成功
|
||||
*/
|
||||
- (void)onTeamUsersSyncFinished:(BOOL)success;
|
||||
|
||||
/**
|
||||
* 超大群用户信息同步完成的回调。
|
||||
* @par 使用场景:
|
||||
* 若需要使用应用的超大群成员信息,那么要确保超大群用户信息已同步至SDK 的本地数据库,可以使用该接口回调知晓超大群用户信息同步是否完成。
|
||||
* @par 调用时机:
|
||||
* 必须在创建 NIM SDK 实例(sharedSDK)之后,才能调用该接口;建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 注意事项:
|
||||
* 若同步失败,建议手动将超大群用户信息同步至 SDK 的本地数据库,否则可能会影响 SDK 超大群相关接口的使用。
|
||||
* @par 参数说明:
|
||||
* success:超大群用户信息是否同步成功
|
||||
*/
|
||||
- (void)onSuperTeamUsersSyncFinished:(BOOL)success;
|
||||
|
||||
/**
|
||||
* 动态 Token 回调,用于获取动态 Token,后续以动态 token 鉴权方式登录 IM。
|
||||
* @par 使用场景:
|
||||
* 如果您有正式的生产环境,且您的业务对用户信息安全有较高的要求,可使用动态 Token 鉴权方式登录 IM。通过该方式登录前,需要调用该接口获取动态 Token。
|
||||
* @par 调用时机:
|
||||
* 必须在创建 NIM SDK 实例(sharedSDK)之后,才能调用该接口;建议在初始化 NIM SDK 后,登录 IM 前注册该回调。
|
||||
* @par 注意事项:
|
||||
* <ul><li>通过该接口获取的 Token 是动态且临时有效的。您可以通过服务端设置该动态 token 的有效期,建议不要太长。</li><li>若选择动态 token 鉴权方式,在调用登录接口时需要传入登录方式(authType,1 为动态 token 鉴权方式)。</li></ul>
|
||||
* @par 参数说明:
|
||||
* account:用户的 IM 账号,即 accid
|
||||
* @par 返回:
|
||||
* 对应账号的动态 token
|
||||
* @par 相关接口:
|
||||
* [login:token:authType:loginExt:completion:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a7dedc10fcbadf36fb66ce9cc9710b8f6) 登录 IM
|
||||
* @deprecated 请使用 NIMSDKConfigDelegate dynamicTokenForAccount:
|
||||
*/
|
||||
- (NSString *)provideDynamicTokenForAccount:(NSString *)account;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义重连策略回调。回调中返回自动重连的时间间隔,即当自动登录失败后多久后触发自动重连。<br>
|
||||
* SDK 默认的自动重连策略:自动登录失败后 2 秒触发自动重连触,如果一直连不上,重连时间指数级增长,2、4、6、8、16、32、64 ...
|
||||
*/
|
||||
- (int)reconnectDelay;
|
||||
|
||||
/**
|
||||
* 消息数据库已经打开
|
||||
*/
|
||||
- (void)onDataReady;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* IM 登录相关接口,包括登录、登出、踢人下线等接口。
|
||||
*/
|
||||
@protocol NIMLoginManager <NSObject>
|
||||
|
||||
/**
|
||||
* 手动登录 IM。
|
||||
* @deprecated 请使用 [login:token:authType:loginExt:completion:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a7dedc10fcbadf36fb66ce9cc9710b8f6)
|
||||
* @par 参数说明:
|
||||
* <table>
|
||||
* <tr><th>参数名称</th><th>描述</th>
|
||||
* </tr>
|
||||
* <tr><td>account</td><td>用户的 IM 账号,即 accid</td>
|
||||
* </tr>
|
||||
* <tr><td>token</td><td>IM 账号(accid)对应的登录 token</td>
|
||||
* </tr>
|
||||
* <tr><td>completion</td><td>登录服务相关回调</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
- (void)login:(NSString *)account
|
||||
token:(NSString *)token
|
||||
completion:(NIMLoginHandler)completion;
|
||||
|
||||
/**
|
||||
* 手动登录 IM。
|
||||
* @par 使用场景:
|
||||
* <ul><li>在新设备上首次登录 IM。</li><li>被同时在线的其他设备踢下线后再次登录 IM。</li><li>切换 IM 账号后再次登录 IM。</li><li>注销登录后再次登录 IM。</li></ul>
|
||||
* @par 注意事项:
|
||||
* <ul><li>登录成功后,SDK 会自动同步数据,数据同步完成后,整个登录过程才算真正完成。</li><li>推荐在手动登录成功后,将 accid 和 token 保存到本地,方便下次应用启动自动登录时使用。如果登录失败,清除本地保存的用户登录信息,防止下次启动走自动登录逻辑。</li></ul>
|
||||
* @par 参数说明:
|
||||
* <table>
|
||||
* <tr><th>参数名称</th><th>描述</th>
|
||||
* </tr>
|
||||
* <tr><td>account</td><td>用户的 IM 账号,即 accid</td>
|
||||
* </tr>
|
||||
* <tr><td>token</td><td>IM 账号(accid)对应的登录 token</td>
|
||||
* </tr>
|
||||
* <tr><td>authType</td><td>登录鉴权方式,0(默认):静态 token 鉴权;1:动态 token 鉴权;2:基于第三方回调的 token 鉴权</td>
|
||||
* </tr>
|
||||
* <tr><td>loginExt</td><td>登录自定义扩展字段。若选择基于第三方回调的 token 鉴权方式(authType 传入 3)时,该字段必传,如未传入,将报错</td>
|
||||
* </tr>
|
||||
* <tr><td>completion</td><td>登录服务相关回调</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* @par 相关回调:
|
||||
* [onLogin:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a70055366358595d63b0e1c07aedeb55f) 登录状态回调<br>
|
||||
* [onMultiLoginClientsChangedWithType:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a83f001bb0a5c477a72178f1c0b2585df) 多端登录设备列表
|
||||
* @par 相关接口:
|
||||
* [provideDynamicTokenForAccount:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a248519e2e4ea0328523db756cd538650) 获取动态 token<br>
|
||||
* [autoLogin:token:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a8c05c17ff5369ce9b70c6c7d33d6622e) 自动登录 IM
|
||||
*
|
||||
* @param account 帐号
|
||||
* @param token 令牌 (authType为NIMSDKAuthTypeDefault时有效)
|
||||
* @param authType 登陆类型,取值范围为NIMSDKAuthType
|
||||
* @param loginExt 登录自定义字段 (authType为NIMSDKAuthTypeThirdParty时有效;authType为NIMSDKAuthTypeThirdPartyDynamic时,loginExt通过NIMSDKConfigDelegate中的dynamicLoginExtForAccount:来获取)
|
||||
* @param completion 完成回调
|
||||
*/
|
||||
- (void)login:(NSString *)account
|
||||
token:(NSString *)token
|
||||
authType:(int)authType
|
||||
loginExt:(NSString *)loginExt
|
||||
completion:(NIMLoginHandler)completion;
|
||||
|
||||
/**
|
||||
* 自动登录 IM。
|
||||
* @deprecated 请使用- (void)autoLogin:(NIMAutoLoginData *)loginData;
|
||||
* @par 使用建议:
|
||||
* 启动 APP 时,如果已经保存了帐号和 token,那么建议使用自动登录方式,可以在无网络时直接打开会话窗口。
|
||||
* @par 参数说明:
|
||||
* <table>
|
||||
* <tr><th>参数名称</th><th>描述</th>
|
||||
* </tr>
|
||||
* <tr><td>account</td><td>用户的 IM 账号,即 accid</td>
|
||||
* </tr>
|
||||
* <tr><td>token</td><td>IM 账号(accid)对应的登录 token</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*/
|
||||
- (void)autoLogin:(NSString *)account
|
||||
token:(NSString *)token;
|
||||
|
||||
|
||||
/**
|
||||
* 自动登录 IM。
|
||||
* @par 前提条件:
|
||||
* 手动登录成功且将 accid 和 token 保存至本地。
|
||||
* @par 使用场景:
|
||||
* 自动登录一般用于应用被清理后,用户再次点击应用图标启动应用,无需输入用户名和密码即可完成登录的场景。此时应用可以在无网络、未登录成功的状态下直接访问用户本地 SDK 数据。
|
||||
* @par 注意事项:
|
||||
* 登录成功后,SDK 会自动同步数据,数据同步完成后,整个登录过程才算真正完成。
|
||||
* @par 参数说明:
|
||||
* loginData:自动登录参数,包括 account、token、 forcedMode 等信息。其中 forcedMode 为强制模式开关,默认为 NO,非强制模式下的自动登录,服务器将检查当前登录设备是否为上一次登录设备,如果不是,服务器将拒绝这次自动登录((回 error code 为 417 的错误)。若设置为 YES, 那么自动登录时云信服务端将不检查当前登录设备是否为上一次登录设备,安全便捷,但安全性较低,请根据实际业务场景谨慎使用。
|
||||
* @par 相关回调:
|
||||
* [onAutoLoginFailed:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#ab96ef125e18a7722668b30ddd0289e7f) 自动登录失败回调<br>
|
||||
* [onMultiLoginClientsChangedWithType:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a83f001bb0a5c477a72178f1c0b2585df) 多端登录设备回调
|
||||
* @par 相关接口:
|
||||
* [login:token:authType:loginExt:completion:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d9/d16/protocol_n_i_m_login_manager-p.html#a7dedc10fcbadf36fb66ce9cc9710b8f6) 手动登录 IM
|
||||
*/
|
||||
- (void)autoLogin:(NIMAutoLoginData *)loginData;
|
||||
|
||||
/**
|
||||
* 注销 IM 登录(登出 IM),登出后,用户将不再接收 IM 的消息。
|
||||
* @par 使用场景:
|
||||
* 一般情况下,如果您的应用生命周期跟 NIM SDK 生命周期一致,用户在退出应用前可以不登出,直接退出即可。些特殊场景,例如用户仅在进入特定界面后才调用 NIM SDK 的能力,退出界面后不再调用,此时需要调用 NIM SDK 的登出接口注销 IM 登录。
|
||||
* @par 注意事项:
|
||||
* <ul><li>调用该接口登出 IM 时,SDK 会同时通知云信服务端进行 APNs 推送的解绑操作,避免用户已登出但依然将消息推送到当前设备。</li><li>考虑到用户体验,登出的超时时间会比其他请求短一些。无论登出请求是否成功,上层应用在 UI 表现上都应该做出登出行为。如果登出失败,应用也需要跳转到登录界面。导致登出失败的原因是云信服务端解绑 APNs 推送信息失败,但此时本地信息是清理成功的。</li><li>用户在登出是需要调用这个接口进行 SDK 相关数据的清理,回调 Block 中的 error 只是指明和服务器的交互流程中可能出现的错误,但不影响后续的流程。 如用户登出时发生网络错误导致服务器没有收到登出请求,客户端仍可以登出(切换界面,清理数据等),但会出现推送信息仍旧会发到当前手机的问题。</li></ul>
|
||||
* @par 参数说明:
|
||||
* completion:登出完成的回调。回调中的 NIMLoginHandler error 只是指明和服务器的交互流程中可能出现的错误,但不影响后续的流程。 如用户登出时发生网络错误导致服务器没有收到登出请求,客户端仍可以登出(切换界面,清理数据等),但会出现推送信息仍旧会发到当前手机的问题。
|
||||
* @par 相关回调:
|
||||
* [onLogin:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a70055366358595d63b0e1c07aedeb55f) 登录状态回调<br>
|
||||
* [onMultiLoginClientsChangedWithType:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a83f001bb0a5c477a72178f1c0b2585df) 多端登录设备列表
|
||||
*/
|
||||
- (void)logout:(nullable NIMLoginHandler)completion;
|
||||
|
||||
/**
|
||||
* 将当前账号的其他已登录客户端踢下线。
|
||||
* @par 注意事项:
|
||||
* 被踢方收到被踢回调后,建议进行注销(logout)并切换到登录界面重新登录。
|
||||
* @par 参数说明:
|
||||
* <table>
|
||||
* <tr><th>参数名称</th><th>描述</th>
|
||||
* </tr>
|
||||
* <tr><td>client</td><td>需要踢下线的客户端信息</td>
|
||||
* </tr>
|
||||
* <tr><td>completion</td><td>踢人下线的相关回调</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* @par 相关回调:
|
||||
* [onKickout:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#acd2ae586b5e4f0a9cec487727c164a63) 被其他端踢下线的回调<br>
|
||||
* [onMultiLoginClientsChangedWithType:](https://doc.yunxin.163.com/docs/interface/messaging/iOS/doxygen/Latest/zh/d5/dc6/protocol_n_i_m_login_manager_delegate-p.html#a83f001bb0a5c477a72178f1c0b2585df) 多端登录设备列表
|
||||
*/
|
||||
- (void)kickOtherClient:(NIMLoginClient *)client
|
||||
completion:(nullable NIMLoginHandler)completion;
|
||||
|
||||
/**
|
||||
* 查询当前登录的帐号(accid)。
|
||||
*
|
||||
* @par 返回:
|
||||
* 当前登录的帐号,如果当前账号未登录成功,将返回空字符串("")
|
||||
*/
|
||||
- (NSString *)currentAccount;
|
||||
|
||||
/**
|
||||
* 查询当前的登录状态。
|
||||
*
|
||||
* @par 返回:
|
||||
* 当前的登录状态,返回 YES,表示已登录;返回 NO,表示处于未登录状态
|
||||
*/
|
||||
- (BOOL)isLogined;
|
||||
|
||||
/**
|
||||
* 查询当前账号登录的鉴权方式。
|
||||
*
|
||||
* @par 返回:
|
||||
* 当前账号登录的鉴权方式,如果当前账号未登录成功,将返回空字符串("")
|
||||
*/
|
||||
- (NIMSDKAuthMode)currentAuthMode;
|
||||
|
||||
/**
|
||||
* 查询当前账号登录的客户端信息(NIMLoginClient),将返回当前登录的的设备列表,包括客户端类型、操作系统、登录时间等信息。
|
||||
*
|
||||
* @par 返回:
|
||||
* 当前登录的的设备列表,其中不包含本端。若除本端外,无其他登录设备,将返回空字符串("")
|
||||
*/
|
||||
- (nullable NSArray<NIMLoginClient *> *)currentLoginClients;
|
||||
|
||||
/**
|
||||
* 查询云信服务端当前的时间。
|
||||
* @par 注意事项:
|
||||
* 该方法有调用频控,当调用失败时默认返回上一次调用成功时返回的时间。
|
||||
*
|
||||
* @par 参数说明:
|
||||
* completion:查询完成的回调
|
||||
*/
|
||||
- (void)queryServerTimeCompletion:(NIMLoginGetServerTimeHandle)completion;
|
||||
|
||||
/**
|
||||
* 通过在对应的管理类中添加委托(delegate)通知上层 API 调用结果。
|
||||
* @par 使用场景:
|
||||
* 一般推荐在相应 ViewController 或管理类初始化进行委托注册,在其销毁时进行移除。
|
||||
* @par 参数说明:
|
||||
* delegate:登录相关的委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMLoginManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 在对应的管理类中移除委托(delegate),移除后,将不再通知上层 API 调用结果。
|
||||
*
|
||||
* @par 参数说明:
|
||||
* delegate:登录相关的委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMLoginManagerDelegate>)delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,319 @@
|
||||
//
|
||||
// NIMMediaManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 音频输出设备类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMAudioOutputDevice){
|
||||
/**
|
||||
* 听筒
|
||||
*/
|
||||
NIMAudioOutputDeviceReceiver,
|
||||
/**
|
||||
* 扬声器
|
||||
*/
|
||||
NIMAudioOutputDeviceSpeaker
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 云信支持的音频类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMAudioType) {
|
||||
/**
|
||||
* aac
|
||||
*/
|
||||
NIMAudioTypeAAC,
|
||||
/**
|
||||
* amr
|
||||
*/
|
||||
NIMAudioTypeAMR
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 语音转文字
|
||||
*
|
||||
* @param error 执行结果,如果成功error为nil
|
||||
* @prarm text 转换后的文本
|
||||
*/
|
||||
typedef void(^NIMAudioToTextBlock)(NSError * __nullable error,NSString * __nullable text);
|
||||
|
||||
|
||||
/**
|
||||
* 语音转文字选项
|
||||
*/
|
||||
@interface NIMAudioToTextOption : NSObject
|
||||
|
||||
/**
|
||||
* 音频URL
|
||||
* @discussion 目前只支持云信服务器的URL,不支持外链
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *url;
|
||||
|
||||
/**
|
||||
* 音频本地地址
|
||||
* @discussion APP需要保证音频已经下载到本地
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *filepath;
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 多媒体委托
|
||||
*/
|
||||
@protocol NIMMediaManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* 开始播放音频的回调
|
||||
*
|
||||
* @param filePath 音频文件路径
|
||||
* @param error 错误信息
|
||||
*/
|
||||
- (void)playAudio:(NSString *)filePath didBeganWithError:(nullable NSError *)error;
|
||||
|
||||
/**
|
||||
* 播放完音频的回调
|
||||
*
|
||||
* @param filePath 音频文件路径
|
||||
* @param error 错误信息
|
||||
*/
|
||||
- (void)playAudio:(NSString *)filePath didCompletedWithError:(nullable NSError *)error;
|
||||
|
||||
/**
|
||||
* 播放完音频的进度回调
|
||||
*
|
||||
* @param filePath 音频文件路径
|
||||
* @param value 播放进度 0.0 - 1.0
|
||||
*/
|
||||
- (void)playAudio:(NSString *)filePath progress:(float)value;
|
||||
|
||||
/**
|
||||
* 停止播放音频的回调
|
||||
*
|
||||
* @param filePath 音频文件路径
|
||||
* @param error 错误信息
|
||||
*/
|
||||
- (void)stopPlayAudio:(NSString *)filePath didCompletedWithError:(nullable NSError *)error;
|
||||
|
||||
/**
|
||||
* 播放音频开始被打断回调
|
||||
*/
|
||||
- (void)playAudioInterruptionBegin;
|
||||
|
||||
/**
|
||||
* 播放音频结束被打断回调
|
||||
*/
|
||||
- (void)playAudioInterruptionEnd;
|
||||
|
||||
/**
|
||||
* 开始录制音频的回调
|
||||
*
|
||||
* @param filePath 录制的音频的文件路径
|
||||
* @param error 错误信息
|
||||
* @discussion 如果录音失败,filePath 有可能为 nil
|
||||
*/
|
||||
- (void)recordAudio:(nullable NSString *)filePath didBeganWithError:(nullable NSError *)error;
|
||||
|
||||
/**
|
||||
* 录制音频完成后的回调
|
||||
*
|
||||
* @param filePath 录制完成的音频文件路径
|
||||
* @param error 错误信息
|
||||
*/
|
||||
- (void)recordAudio:(nullable NSString *)filePath didCompletedWithError:(nullable NSError *)error;
|
||||
|
||||
/**
|
||||
* 录音被取消的回调
|
||||
*/
|
||||
- (void)recordAudioDidCancelled;
|
||||
|
||||
/**
|
||||
* 音频录制进度更新回调
|
||||
*
|
||||
* @param currentTime 当前录制的时间
|
||||
*/
|
||||
- (void)recordAudioProgress:(NSTimeInterval)currentTime;
|
||||
|
||||
/**
|
||||
* 录音开始被打断回调
|
||||
*/
|
||||
- (void)recordAudioInterruptionBegin;
|
||||
|
||||
/**
|
||||
* 录音结束被打断回调
|
||||
*/
|
||||
- (void)recordAudioInterruptionEnd;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 多媒体控制协议
|
||||
*/
|
||||
@protocol NIMMediaManager <NSObject>
|
||||
|
||||
@required
|
||||
|
||||
/**
|
||||
* 录音进度更新间隔
|
||||
* @discussion 如果值大于0,则会按照相应间隔调用recordAudioProgress:回调,默认值为0.3
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval recordProgressUpdateTimeInterval;
|
||||
|
||||
#pragma mark - play audio
|
||||
/**
|
||||
* 切换音频输出设备
|
||||
*
|
||||
* @param outputDevice 音频输出设备
|
||||
*
|
||||
* @return 是否切换成功
|
||||
*/
|
||||
- (BOOL)switchAudioOutputDevice:(NIMAudioOutputDevice)outputDevice;
|
||||
|
||||
|
||||
/**
|
||||
* 在播放声音的时候,如果手机贴近耳朵,是否需要自动切换成听筒播放
|
||||
*
|
||||
* @param needProximityMonitor 是否需要贴耳传感器监听
|
||||
*/
|
||||
- (void)setNeedProximityMonitor:(BOOL)needProximityMonitor;
|
||||
|
||||
|
||||
/**
|
||||
* 是否正在播放音频
|
||||
*
|
||||
*/
|
||||
- (BOOL)isPlaying;
|
||||
|
||||
/**
|
||||
* 播放音频文件
|
||||
*
|
||||
* @discussion 开始播放,NIMMediaManagerDelegate中的playAudio:didBeganWithError:回调会被触发,播放完成后, NIMMediaManagerDelegate中的playAudio:didCompletedWithError:回调会被触发
|
||||
* @param filepath 音频文件路径
|
||||
*/
|
||||
- (void)play:(NSString *)filepath;
|
||||
|
||||
/**
|
||||
* 停止播放音频
|
||||
*
|
||||
* @discussion 音频播放完成后NIMMediaManagerDelegate中的playAudio:didCompletedWithError:回调会被触发
|
||||
*/
|
||||
- (void)stopPlay;
|
||||
|
||||
|
||||
/**
|
||||
* 设置播放音频的起始时间
|
||||
* @param timestamp 起始时间
|
||||
* @discussion 起始时间不能大于整个音频的时间,否则播放无效。调用此方法后,不需要再调用 play: 方法,自动播放
|
||||
*/
|
||||
- (BOOL)seek:(NSTimeInterval)timestamp;
|
||||
|
||||
#pragma mark - record audio
|
||||
|
||||
/**
|
||||
* 是否正在录音
|
||||
*
|
||||
*/
|
||||
- (BOOL)isRecording;
|
||||
|
||||
/**
|
||||
* 开始录制音频
|
||||
*
|
||||
* @param duration 最长录音时间
|
||||
* @discussion 开始录音,NIMMediaManagerDelegate中的recordAudio:didBeganWithError:回调会被触发,录音完成后, NIMMediaManagerDelgate中的recordAudio:didCompletedWithError:回调会被触发
|
||||
* 默认使用 aac 编码格式
|
||||
*/
|
||||
- (void)recordForDuration:(NSTimeInterval)duration;
|
||||
/**
|
||||
* 开始录音
|
||||
*
|
||||
* @param type 音频类型
|
||||
* @param duration 最大时长
|
||||
* @discussion 开始录音,NIMMediaManagerDelegate中的recordAudio:didBeganWithError:回调会被触发,录音完成后, NIMMediaManagerDelegate中的recordAudio:didCompletedWithError:回调会被触发
|
||||
*/
|
||||
- (void)record:(NIMAudioType)type
|
||||
duration:(NSTimeInterval)duration;
|
||||
|
||||
/**
|
||||
* 停止录制音频
|
||||
*
|
||||
* @discussion 停止录音后NIMMediaManagerDelegate中的recordAudio:didCompletedWithError:回调会被触发
|
||||
*/
|
||||
- (void)stopRecord;
|
||||
|
||||
/**
|
||||
* 取消录制音频
|
||||
*
|
||||
* @discussion 录音取消后,NIMMediaManagerDelegate中的recordAudioDidCancelled回调会被触发
|
||||
*/
|
||||
- (void)cancelRecord;
|
||||
|
||||
/**
|
||||
* 获取录音分贝
|
||||
*
|
||||
*/
|
||||
- (float)recordPeakPower;
|
||||
|
||||
/**
|
||||
* 获取录音分贝
|
||||
*
|
||||
*/
|
||||
- (float)recordAveragePower;
|
||||
|
||||
|
||||
/**
|
||||
* 语音转文字
|
||||
*
|
||||
* @param option 语音转文字选项
|
||||
* @param result 完成回调
|
||||
*/
|
||||
- (void)transAudioToText:(NIMAudioToTextOption *)option
|
||||
result:(NIMAudioToTextBlock)result;
|
||||
|
||||
|
||||
#pragma mark - common setting
|
||||
|
||||
/**
|
||||
* 禁止在IM 录制、播放音频时设置AVAudioSession, 防止影响其他音视频效果
|
||||
* @param disabled YES则禁止重置
|
||||
*/
|
||||
- (void)disableResetAudioSession:(BOOL)disabled;
|
||||
|
||||
/**
|
||||
* 设置录制或者播放完成以后是否自动deactivate AVAudioSession
|
||||
*
|
||||
* @param deactivate 是否deactivate,默认为YES
|
||||
*/
|
||||
- (void)setDeactivateAudioSessionAfterComplete:(BOOL)deactivate;
|
||||
|
||||
#pragma mark - delegates
|
||||
/**
|
||||
* 添加多媒体委托
|
||||
*
|
||||
* @param delegate 多媒体委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMMediaManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除多媒体委托
|
||||
*
|
||||
* @param delegate 多媒体委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMMediaManagerDelegate>)delegate;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,395 @@
|
||||
//
|
||||
// NIMMessage.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMGlobalDefs.h"
|
||||
#import "NIMSession.h"
|
||||
#import "NIMLoginClient.h"
|
||||
#import "NIMImageObject.h"
|
||||
#import "NIMLocationObject.h"
|
||||
#import "NIMAudioObject.h"
|
||||
#import "NIMCustomObject.h"
|
||||
#import "NIMVideoObject.h"
|
||||
#import "NIMFileObject.h"
|
||||
#import "NIMNotificationObject.h"
|
||||
#import "NIMTipObject.h"
|
||||
#import "NIMRobotObject.h"
|
||||
#import "NIMMessageSetting.h"
|
||||
#import "NIMMessageReceipt.h"
|
||||
#import "NIMRtcCallRecordObject.h"
|
||||
#import "NIMTeamMessageReceiptDetail.h"
|
||||
#import "NIMAntiSpamOption.h"
|
||||
#import "NIMMessageApnsMemberOption.h"
|
||||
#import "NIMTeamMessageReceipt.h"
|
||||
#import "NIMMessageRobotInfo.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMMessageChatroomExtension;
|
||||
|
||||
/**
|
||||
* 消息送达状态枚举
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMMessageDeliveryState){
|
||||
/**
|
||||
* 消息发送失败
|
||||
*/
|
||||
NIMMessageDeliveryStateFailed,
|
||||
/**
|
||||
* 消息发送中
|
||||
*/
|
||||
NIMMessageDeliveryStateDelivering,
|
||||
/**
|
||||
* 消息发送成功
|
||||
*/
|
||||
NIMMessageDeliveryStateDeliveried
|
||||
};
|
||||
|
||||
/**
|
||||
* 消息附件下载状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMMessageAttachmentDownloadState){
|
||||
/**
|
||||
* 附件需要进行下载 (有附件但并没有下载过)
|
||||
*/
|
||||
NIMMessageAttachmentDownloadStateNeedDownload,
|
||||
/**
|
||||
* 附件收取失败 (尝试下载过一次并失败)
|
||||
*/
|
||||
NIMMessageAttachmentDownloadStateFailed,
|
||||
/**
|
||||
* 附件下载中
|
||||
*/
|
||||
NIMMessageAttachmentDownloadStateDownloading,
|
||||
/**
|
||||
* 附件下载成功/无附件
|
||||
*/
|
||||
NIMMessageAttachmentDownloadStateDownloaded
|
||||
};
|
||||
|
||||
/**
|
||||
* 消息处理状态
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMMessageStatus) {
|
||||
NIMMessageStatusNone = 0, //消息初始状态
|
||||
NIMMessageStatusRead = 1, //已读
|
||||
NIMMessageStatusDeleted = 2 //已删除 (必须是 message status 最大值)
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 消息结构
|
||||
*/
|
||||
@interface NIMMessage : NSObject
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMMessageType messageType;
|
||||
|
||||
/**
|
||||
* 消息子类型.(默认0。设置值需要大于0)
|
||||
*/
|
||||
@property (nonatomic,assign) NSInteger messageSubType;
|
||||
|
||||
/**
|
||||
* 消息来源
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *from;
|
||||
|
||||
/**
|
||||
* 消息所属会话
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NIMSession *session;
|
||||
|
||||
/**
|
||||
* 消息ID,唯一标识
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *messageId;
|
||||
|
||||
/**
|
||||
* 消息服务端ID
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString * serverID;
|
||||
|
||||
|
||||
/**
|
||||
* 消息文本
|
||||
* @discussion 消息中除 NIMMessageTypeText 和 NIMMessageTypeTip 外,其他消息 text 字段都为 nil
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *text;
|
||||
|
||||
/**
|
||||
* 消息附件内容
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) id<NIMMessageObject> messageObject;
|
||||
|
||||
/**
|
||||
* 消息附件原始字符串内容
|
||||
*/
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *rawAttachContent;
|
||||
|
||||
/**
|
||||
* 消息设置
|
||||
* @discussion 可以通过这个字段制定当前消息的各种设置,如是否需要计入未读,是否需要多端同步等
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMMessageSetting *setting;
|
||||
|
||||
/**
|
||||
* 消息反垃圾配置
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMAntiSpamOption *antiSpamOption;
|
||||
|
||||
|
||||
/**
|
||||
* 消息推送文案,长度限制500字,撤回消息时该字段无效
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *apnsContent;
|
||||
|
||||
/**
|
||||
* 消息推送Payload
|
||||
* @discussion 可以通过这个字段定义消息推送 Payload ,支持字段参考苹果技术文档,长度限制 2K,撤回消息时该字段无效
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSDictionary *apnsPayload;
|
||||
|
||||
/**
|
||||
* 指定成员推送选项
|
||||
* @discussion 通过这个选项进行一些更复杂的推送设定,目前只能在群会话中使用
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMMessageApnsMemberOption *apnsMemberOption;
|
||||
|
||||
|
||||
/**
|
||||
* 服务器扩展
|
||||
* @discussion 客户端可以设置这个字段,这个字段将在本地存储且发送至对端,上层需要保证 NSDictionary 可以转换为 JSON,长度限制 1K
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSDictionary *remoteExt;
|
||||
|
||||
/**
|
||||
* 客户端本地扩展
|
||||
* @discussion 客户端可以设置这个字段,这个字段只在本地存储,不会发送至对端,上层需要保证 NSDictionary 可以转换为 JSON
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSDictionary *localExt;
|
||||
|
||||
/**
|
||||
* 消息拓展字段
|
||||
* @discussion 服务器下发的消息拓展字段,并不在本地做持久化,目前只有聊天室中的消息才有该字段(NIMMessageChatroomExtension)
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) id messageExt;
|
||||
|
||||
/**
|
||||
* 消息发送时间
|
||||
* @discussion 本地存储消息可以通过修改时间戳来调整其在会话列表中的位置,发完服务器的消息时间戳将被服务器自动修正
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval timestamp;
|
||||
|
||||
/**
|
||||
* 易盾反垃圾增强反作弊专属字段
|
||||
* @discussion 透传易盾反垃圾增强反作弊专属字段
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSDictionary *yidunAntiCheating;
|
||||
|
||||
/**
|
||||
* 易盾反垃圾扩展字段,限制json,长度限制1024
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *yidunAntiSpamExt;
|
||||
|
||||
/**
|
||||
* 易盾反垃圾返回的结果字段
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *yidunAntiSpamRes;
|
||||
|
||||
/**
|
||||
* X坐标,仅用于聊天室
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *locationX;
|
||||
/**
|
||||
* Y坐标,仅用于聊天室
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *locationY;
|
||||
/**
|
||||
* Z坐标。仅用于聊天室
|
||||
*/
|
||||
@property (nonatomic, copy) NSNumber *locationZ;
|
||||
/**
|
||||
* 消息接受者列表,仅用于聊天室
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray<NSString *> *toAccIds;
|
||||
|
||||
/**
|
||||
* 消息的目标标签表达式
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *notifyTargetTags;
|
||||
|
||||
/**
|
||||
* 环境变量
|
||||
* @discussion 环境变量,用于指向不同的抄送、第三方回调等配置
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *env;
|
||||
|
||||
/**
|
||||
* 消息投递状态 仅针对发送的消息
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMMessageDeliveryState deliveryState;
|
||||
|
||||
|
||||
/**
|
||||
* 消息附件下载状态 仅针对收到的消息
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMMessageAttachmentDownloadState attachmentDownloadState;
|
||||
|
||||
|
||||
/**
|
||||
* 是否是收到的消息
|
||||
* @discussion 由于有漫游消息的概念,所以自己发出的消息漫游下来后仍旧是"收到的消息",这个字段用于消息出错是时判断需要重发还是重收
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) BOOL isReceivedMsg;
|
||||
|
||||
/**
|
||||
* 是否是往外发的消息
|
||||
* @discussion 由于能对自己发消息,所以并不是所有来源是自己的消息都是往外发的消息,这个字段用于判断头像排版位置(是左还是右)。
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) BOOL isOutgoingMsg;
|
||||
|
||||
/**
|
||||
* 消息是否被播放过
|
||||
* @discussion 修改这个属性,后台会自动更新 db 中对应的数据。聊天室消息里,此字段无效。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isPlayed;
|
||||
|
||||
|
||||
/**
|
||||
* 消息是否标记为已删除
|
||||
* @discussion 已删除的消息在获取本地消息列表时会被过滤掉,只有根据 messageId 获取消息的接口可能会返回已删除消息。聊天室消息里,此字段无效。
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) BOOL isDeleted;
|
||||
|
||||
|
||||
/**
|
||||
* 对端是否已读
|
||||
* @discussion 只有当当前消息为 P2P 消息且 isOutgoingMsg 为 YES 时这个字段才有效,需要对端调用过发送已读回执的接口
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) BOOL isRemoteRead;
|
||||
|
||||
/**
|
||||
* 是否已发送群回执
|
||||
* @discussion 只针对群消息有效
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) BOOL isTeamReceiptSended;
|
||||
|
||||
/**
|
||||
* 群已读回执信息
|
||||
* @discussion 只有当当前消息为 Team 消息且 teamReceiptEnabled 为 YES 时才有效,需要对端调用过发送已读回执的接口
|
||||
*/
|
||||
@property (nullable,nonatomic,strong,readonly) NIMTeamMessageReceipt *teamReceiptInfo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 消息发送者名字
|
||||
* @discussion 当发送者是自己时,这个值可能为空,这个值表示的是发送者当前的昵称,而不是发送消息时的昵称。聊天室消息里,此字段无效。
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *senderName;
|
||||
|
||||
|
||||
/**
|
||||
* 发送者客户端类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMLoginClientType senderClientType;
|
||||
|
||||
/**
|
||||
* 是否在黑名单中
|
||||
* @discussion YES 为被目标拉黑;
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) BOOL isBlackListed;
|
||||
|
||||
#pragma mark - Thread Talk
|
||||
|
||||
/**
|
||||
* 该消息回复的目标消息的消息ID
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
* @discussion A为一条普通消息,B消息为对A回复的消息,则A是B的 replied 消息和 thread 消息; 同时, C为回复B的消息,则C的 replied 消息是B, C的thread消息为A
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *repliedMessageId;
|
||||
|
||||
/**
|
||||
* 该消息回复的目标消息的服务端ID
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *repliedMessageServerId;
|
||||
|
||||
/**
|
||||
* 该消息回复的目标消息的发送者
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *repliedMessageFrom;
|
||||
|
||||
/**
|
||||
* 该消息回复的目标消息的接收者
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *repliedMessageTo;
|
||||
|
||||
/**
|
||||
* 该消息回复的目标消息的发送时间
|
||||
* @discussion 如果未回复其他消息则为0(单位:秒)
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSTimeInterval repliedMessageTime;
|
||||
|
||||
|
||||
/**
|
||||
* 该消息的父消息的消息ID
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *threadMessageId;
|
||||
|
||||
/**
|
||||
* 该消息的父消息的服务端ID
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *threadMessageServerId;
|
||||
|
||||
/**
|
||||
* 该消息回复的父消息的发送者
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *threadMessageFrom;
|
||||
|
||||
/**
|
||||
* 该消息回复的目标消息的接收者
|
||||
* @discussion 如果未回复其他消息,则为空
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *threadMessageTo;
|
||||
|
||||
/**
|
||||
* 该消息回复的父消息的发送时间
|
||||
* @discussion 如果未回复其他消息则为0(单位:秒)
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSTimeInterval threadMessageTime;
|
||||
|
||||
/**
|
||||
* 第三方回调回来的自定义扩展字段
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *callbackExt;
|
||||
|
||||
|
||||
/**
|
||||
* 消息处理状态
|
||||
*/
|
||||
@property (nonatomic, assign) NIMMessageStatus status;
|
||||
|
||||
/**
|
||||
* 消息机器人信息
|
||||
* @discussion 设置和获取消息的机器人相关信息
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) NIMMessageRobotInfo *robotInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// NIMMessageApnsMemberOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* 推送人员选项
|
||||
*/
|
||||
@interface NIMMessageApnsMemberOption : NSObject
|
||||
|
||||
/**
|
||||
* 需要特殊推送的用户列表
|
||||
* @discussion 设置为 nil 时表示推送给当前会话内的所有用户
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSArray<NSString *> *userIds;
|
||||
|
||||
/**
|
||||
* 是否强制推送
|
||||
* @discussion 默认为 YES. 设置为 YES 表示即使推送列表中的用户屏蔽了当前会话(如静音),仍能够推送当前这条推送内容给相应用户
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL forcePush;
|
||||
|
||||
/**
|
||||
* 推送文案,长度限制500字
|
||||
* @discussion 推送给制定用户的特定推送文案,如果设置为 nil 则使用消息本身的推送文案
|
||||
*
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *apnsContent;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// NIMMessageChatroomExtension.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 消息内的聊天室拓展信息
|
||||
* @discussion 用户进入聊天室时填的 NIMChatroomEnterRequest 中的额外信息将在发送聊天室信息时将转换为消息中聊天拓展信息
|
||||
*/
|
||||
@interface NIMMessageChatroomExtension : NSObject
|
||||
/**
|
||||
* 用户在聊天室内的昵称
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomNickname;
|
||||
|
||||
/**
|
||||
* 用户在聊天室内的头像
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomAvatar;
|
||||
|
||||
/**
|
||||
* 用户在聊天室内的头像缩略图
|
||||
* @discussion 仅适用于使用云信上传服务进行上传的资源,否则无效。
|
||||
*/
|
||||
|
||||
@property (nullable,nonatomic,copy,readonly) NSString *roomAvatarThumbnail;
|
||||
|
||||
/**
|
||||
* 用户在当前聊天室的拓展信息
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *roomExt;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// NIMMessageObjectProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMGlobalDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMQChatMessage;
|
||||
|
||||
/**
|
||||
* 消息体协议
|
||||
*/
|
||||
@protocol NIMMessageObject <NSObject>
|
||||
|
||||
/**
|
||||
* 消息体所在的消息对象
|
||||
*/
|
||||
@property (nullable,nonatomic, weak) NIMMessage *message;
|
||||
|
||||
/**
|
||||
* 消息体所在的消息对象(圈组消息)
|
||||
*/
|
||||
@property (nullable,nonatomic, weak) NIMQChatMessage *qchatMessage;
|
||||
|
||||
/**
|
||||
* 消息内容类型
|
||||
*
|
||||
* @return 消息内容类型
|
||||
*/
|
||||
- (NIMMessageType)type;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// NIMMessagePinItem.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 丁文超 on 2020/4/7.
|
||||
// Copyright © 2020 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMSession;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMMessagePinItem : NSObject
|
||||
|
||||
/**
|
||||
* 对应会话
|
||||
*/
|
||||
@property (nonatomic, copy) NIMSession *session;
|
||||
|
||||
/**
|
||||
* 消息发送方ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *messageFromAccount;
|
||||
|
||||
/**
|
||||
* 消息接收方ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *messageToAccount;
|
||||
|
||||
/**
|
||||
* 消息时间戳(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval messageTime;
|
||||
|
||||
/**
|
||||
* 服务端消息ID
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *messageServerID;
|
||||
|
||||
/**
|
||||
* 本地消息ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *messageId;
|
||||
|
||||
/**
|
||||
* 操作者,不传表示当前登录者
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *accountID;
|
||||
|
||||
/**
|
||||
* 扩展字段,string,最大512
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *ext;
|
||||
|
||||
/**
|
||||
* 创建时间(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
|
||||
/**
|
||||
* 更新时间(s)
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
|
||||
/**
|
||||
* 简便初始化方法
|
||||
*/
|
||||
- (instancetype)initWithMessage:(NIMMessage *)message;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// NIMMessageReceipt.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2016 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMSession;
|
||||
@class NIMMessage;
|
||||
@class NIMTeamMessageReceipt;
|
||||
|
||||
/**
|
||||
* 已读回执
|
||||
*/
|
||||
@interface NIMMessageReceipt : NSObject
|
||||
|
||||
/**
|
||||
* 已读回执对应的会话
|
||||
*/
|
||||
@property (nullable,nonatomic,copy,readonly) NIMSession *session;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
* @discussion 发送已读回执时,这个字段需要被设置为当前会话中的最后一条消息时间戳
|
||||
* 接受已读回执时,这个字段表示在这个时间戳之前的消息都已读
|
||||
* 此字段支持 P2P 会话类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NSTimeInterval timestamp;
|
||||
|
||||
|
||||
/**
|
||||
* 消息 Id
|
||||
* @discussion 只有 Team 会话有效,表示已读的这条消息的 Id
|
||||
*/
|
||||
@property (nonatomic,copy,readonly) NSString *messageId;
|
||||
|
||||
/**
|
||||
* 群已读回执相关信息
|
||||
*/
|
||||
@property (nonatomic,strong,readonly) NIMTeamMessageReceipt *teamReceiptInfo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过最后一条消息构造已读回执
|
||||
*
|
||||
* @param message 会话中的最后一条消息
|
||||
*
|
||||
* @return 已读回执实例
|
||||
*/
|
||||
- (instancetype)initWithMessage:(NIMMessage *)message;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// NIMMessageRobotInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2023年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 消息中机器人相关信息
|
||||
*/
|
||||
@interface NIMMessageRobotInfo : NSObject
|
||||
|
||||
/**
|
||||
* 机器人具体功能
|
||||
* @discussion
|
||||
*
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *function;
|
||||
|
||||
/**
|
||||
* 话题
|
||||
* @discussion
|
||||
*
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *topic;
|
||||
|
||||
/**
|
||||
* 自定义内容
|
||||
* @discussion
|
||||
*
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *customContent;
|
||||
|
||||
/**
|
||||
* 机器人账号
|
||||
* @discussion 仅群消息有效,指定要发送给群里的具体某个机器人账号
|
||||
*
|
||||
*/
|
||||
@property(nullable, nonatomic, copy) NSString *account;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,414 @@
|
||||
//
|
||||
// NIMMessageSearchOption.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMGlobalDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMMessage;
|
||||
@class NIMSession;
|
||||
/**
|
||||
* 云端消息自定义过滤回调
|
||||
*
|
||||
* @param message 待过滤的消息
|
||||
* @discussion 返回YES表示该消息被过滤,不入库不会在历史消息结果中返回;返回NO,表示正常处理该消息。
|
||||
*/
|
||||
typedef BOOL(^NIMHistoryMessageFilterBlock)(NIMMessage *message);
|
||||
|
||||
|
||||
/**
|
||||
* 搜索顺序
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger,NIMMessageSearchOrder) {
|
||||
/**
|
||||
* 从新消息往旧消息查询 forward
|
||||
*/
|
||||
NIMMessageSearchOrderDesc = 0,
|
||||
|
||||
/**
|
||||
* 从旧消息往新消息查询 backward
|
||||
*/
|
||||
NIMMessageSearchOrderAsc = 1,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 本地搜索选项
|
||||
* @discussion 搜索条件: 时间在(startTime,endTime) 内(不包含),类型为 messageTypes (或全类型) ,且匹配 searchContent 或 fromIds 的一定数量 (limit) 消息
|
||||
*/
|
||||
@interface NIMMessageSearchOption : NSObject
|
||||
|
||||
/**
|
||||
* 起始时间,默认为0
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 结束时间,默认为0
|
||||
* @discussion 搜索的结束时间,0 表示最大时间戳
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval endTime;
|
||||
|
||||
/**
|
||||
* 检索条数
|
||||
* @discussion 默认100条,设置为0表示无条数限制
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger limit;
|
||||
|
||||
/**
|
||||
* 检索顺序
|
||||
*
|
||||
* 默认从旧消息往新消息查询
|
||||
*/
|
||||
@property (nonatomic,assign) NIMMessageSearchOrder order;
|
||||
|
||||
/**
|
||||
* 查询的消息类型
|
||||
* @discusssion 消息类型组合,默认只搜索文本类型, 只有在 allMessageTypes 为 NO 时有效,取值范围为: NIMMessageType 枚举类型
|
||||
*/
|
||||
@property (nonatomic,copy) NSArray<NSNumber *> *messageTypes;
|
||||
|
||||
/**
|
||||
* 查询的消息子类型
|
||||
* @discusssion 消息子类型组合
|
||||
*/
|
||||
@property (nonatomic,strong) NSArray<NSNumber *> *messageSubTypes;
|
||||
|
||||
/**
|
||||
* 全部消息类型
|
||||
* @discussion 默认为 NO
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL allMessageTypes;
|
||||
|
||||
/**
|
||||
* 检索文本
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *searchContent;
|
||||
|
||||
/**
|
||||
* 消息发出者帐号列表
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSArray<NSString *> *fromIds;
|
||||
|
||||
/**
|
||||
* 将搜索文本中的正则特殊字符转义,默认 YES
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL enableContentTransfer;
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 检索服务器历史消息选项 (服务器)
|
||||
*/
|
||||
@interface NIMHistoryMessageSearchOption : NSObject
|
||||
|
||||
/**
|
||||
* 检索消息起始时间
|
||||
* @discussion 需要检索的起始时间,没有则传入0。
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval startTime;
|
||||
|
||||
/**
|
||||
* 检索条数
|
||||
* @discussion 最大限制100条
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger limit;
|
||||
|
||||
|
||||
/**
|
||||
* 检索消息终止时间,此参数对聊天室会话无效。
|
||||
* @discussion 当前最早的时间,没有则传入 0。
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval endTime;
|
||||
|
||||
|
||||
/**
|
||||
* 检索消息的当前参考消息,返回的消息结果集里不会包含这条消息,此参数对聊天室会话无效。优先级低于下面的serverId
|
||||
* @discussion 传入最早时间,没有则传入nil。
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMMessage *currentMessage;
|
||||
|
||||
/**
|
||||
* 检索消息的当前参考消息,返回的消息结果集里不会包含这条serverId对应的消息,此参数对聊天室会话无效。优先级高于 上面currentMessage的serverId
|
||||
* @discussion 传入最早时间,没有则传入nil。
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *serverId;
|
||||
|
||||
|
||||
/**
|
||||
* 检索顺序。
|
||||
*/
|
||||
@property (nonatomic,assign) NIMMessageSearchOrder order;
|
||||
|
||||
/**
|
||||
* 是否需要同步到 db,此参数对聊天室会话无效。
|
||||
* @discussion SDK 删除消息分为两种模式:标记删除和彻底删除(参见 NIMDeleteMessagesOption)。
|
||||
* 若消息集在本地被标记删除,则意味着消息仍存在本地,但被打上了特殊的记号,同步后写入 db 会失败。
|
||||
* 只有不存在本地的消息才可以通过 sync 标记进行 db 存储
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL sync;
|
||||
|
||||
|
||||
/**
|
||||
* 查询的消息类型
|
||||
* @discusssion 消息类型组合,默认为 nil ,搜索全类型。一旦设置了这个字段,则 sync 字段失效,查询结果不会写入 db,需要通过设置syncMessageTypes来同步 。
|
||||
*/
|
||||
@property (nonatomic,copy) NSArray<NSNumber *> *messageTypes;
|
||||
|
||||
/**
|
||||
* 是否需要同步特定类型到 db,此参数对聊天室会话无效。
|
||||
* @discussion SDK 删除消息分为两种模式:标记删除和彻底删除(参见 NIMDeleteMessagesOption)。
|
||||
* 若消息集在本地被标记删除,则意味着消息仍存在本地,但被打上了特殊的记号,同步后写入 db 会失败。
|
||||
* 只有不存在本地的消息才可以通过 syncMessageTypes 标记进行 db 存储
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL syncMessageTypes;
|
||||
|
||||
/**
|
||||
* 自定义消息过滤
|
||||
* @discusssion 自定义外部过滤回调方法。返回YES表示消息被过滤,不入库不回调,返回NO,表示消息正常入库和回调
|
||||
* 回调在内部工作线程,注意不要再该回调中执行阻塞或者耗时操作,防止影响内部的消息处理流程。
|
||||
*/
|
||||
@property (nullable,nonatomic,strong) NIMHistoryMessageFilterBlock customFilter;
|
||||
|
||||
/**
|
||||
* 同步云端消息到到本地时,如果消息所在的最近会话不存在,是否自动创建。默认为NO。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL createRecentSessionIfNotExists;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 服务端消息关键字检索选项
|
||||
* @discussion 搜索条件: 时间在(startTime,endTime) 内(不包含),类型为 messageTypes (或全类型) ,且匹配 searchContent 或 fromIds 的一定数量 (limit) 消息
|
||||
*/
|
||||
@interface NIMMessageServerRetrieveOption : NSObject
|
||||
|
||||
/**
|
||||
* 起始时间,默认为0
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 结束时间,默认为0
|
||||
* @discussion 搜索的结束时间,0 表示最大时间戳
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval endTime;
|
||||
|
||||
/**
|
||||
* 检索条数
|
||||
* @discussion 默认100条,设置为0表示无条数限制,最多100条
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger limit;
|
||||
|
||||
/**
|
||||
* 检索顺序
|
||||
*/
|
||||
@property (nonatomic,assign) NIMMessageSearchOrder order;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *keyword;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 服务端消息全量检索选项
|
||||
* @discussion 搜索条件: 时间在(startTime,endTime) 内(不包含),类型为 messageTypes (或全类型) ,且匹配 searchContent 或 fromIds 的一定数量 (limit) 消息
|
||||
*/
|
||||
@interface NIMMessageFullKeywordSearchOption : NSObject
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *keyword;
|
||||
|
||||
/**
|
||||
* 起始时间,默认为0
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 结束时间,默认为0
|
||||
* @discussion 搜索的结束时间,0 表示最大时间戳
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval endTime;
|
||||
|
||||
/**
|
||||
* 消息的检索条数
|
||||
* @discussion 消息条数限制
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger msgLimit;
|
||||
|
||||
/**
|
||||
* 会话的检索条数
|
||||
* @discussion 会话条数限制
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger sessionLimit;
|
||||
|
||||
/**
|
||||
* 检索结果的排列顺序
|
||||
* @diacussion 如果为true,结果按照升序排列,如果为false,按照时间降序排列
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL asc;
|
||||
|
||||
/**
|
||||
* P2P会话列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *p2pArray;
|
||||
|
||||
/**
|
||||
* 群列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *teamArray;
|
||||
|
||||
/**
|
||||
* 发送方列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *senderArray;
|
||||
|
||||
/**
|
||||
* 消息类型列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *msgTypeArray;
|
||||
|
||||
/**
|
||||
* 消息子类型列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *msgSubtypeArray;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 服务端消息全量检索选项
|
||||
* @discussion 搜索条件: 时间在(startTime,endTime) 内(不包含),类型为 messageTypes (或全类型) ,且匹配 searchContent 或 fromIds 的一定数量 (limit) 消息
|
||||
*/
|
||||
@interface NIMMessageFullKeywordSearchOrderByTimeOption : NSObject
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@property (nullable,nonatomic,copy) NSString *keyword;
|
||||
|
||||
/**
|
||||
* 起始时间,默认为0
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 结束时间,默认为0
|
||||
* @discussion 搜索的结束时间,0 表示最大时间戳
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval endTime;
|
||||
|
||||
/**
|
||||
* 消息的检索条数
|
||||
* @discussion 消息条数限制
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger msgLimit;
|
||||
|
||||
/**
|
||||
* 检索结果的排列顺序
|
||||
* @diacussion 如果为true,结果按照升序排列,如果为false,按照时间降序排列
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL asc;
|
||||
|
||||
/**
|
||||
* P2P会话列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *p2pArray;
|
||||
|
||||
/**
|
||||
* 群列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *teamArray;
|
||||
|
||||
/**
|
||||
* 发送方列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *senderArray;
|
||||
|
||||
/**
|
||||
* 消息类型列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *msgTypeArray;
|
||||
|
||||
/**
|
||||
* 消息子类型列表
|
||||
* @discussion
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSArray *msgSubtypeArray;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface NIMGetMessagesDynamicallyParam : NSObject <NSCopying>
|
||||
|
||||
/**
|
||||
* 会话session。
|
||||
*/
|
||||
@property (nonatomic, strong) NIMSession *session;
|
||||
|
||||
/**
|
||||
* 检索消息起始时间,
|
||||
* @discussion 需要检索的起始时间,时间段的小端,没有则传入0。
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval startTime;
|
||||
|
||||
/**
|
||||
* 检索条数
|
||||
* @discussion 最大限制100条。0相当于100
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger limit;
|
||||
|
||||
|
||||
/**
|
||||
* 检索消息终止时间,此参数对聊天室会话无效。
|
||||
* @discussion 时间段的大端, 没有则传入 0。
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval endTime;
|
||||
|
||||
|
||||
/**
|
||||
* 检索消息的当前参考消息本地id,返回的消息结果集里不会包含这条msgId对应的消息
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *anchorClientId;
|
||||
|
||||
/**
|
||||
* 检索消息的当前参考消息服务端id,返回的消息结果集里不会包含这条serverId对应的消息
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *anchorServerId;
|
||||
|
||||
/**
|
||||
* 检索顺序。
|
||||
*/
|
||||
@property (nonatomic,assign) NIMMessageSearchOrder order;
|
||||
|
||||
|
||||
- (NIMGetMessagesDynamicallyParam *) createStandardizedParam;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// NIMMessageSetting.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 消息配置
|
||||
*/
|
||||
@interface NIMMessageSetting : NSObject
|
||||
/**
|
||||
* 消息是否允许在消息历史中拉取(圈组支持)
|
||||
* @discussion 默认为YES。 正常而言所有消息都会出现在通过 NIMConversationManager 调用(fetchMessageHistory:option:result:)返回的结果中,但是可以通过设置这个值来使得消息不出现在这其中。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL historyEnabled;
|
||||
/**
|
||||
* 消息是否支持漫游
|
||||
* @discussion 默认为YES。 消息漫游的概念是指一定时间内发送的消息可以在另一端被同步到,以保证最大限度的消息同步。(如iOS上收发的消息过了一天登录PC仍旧会收到,这种消息我们称之为漫游消息)
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL roamingEnabled;
|
||||
/**
|
||||
* 消息是否支持多端同步
|
||||
* @discussion 默认为YES。在默认情况下,如果用户在 iOS端和其他端(如PC)同时登录一个帐号,那么iOS 端发送的消息会被同步到其他端,同样其他端发送的消息也会被同步到 iOS 端。但是需要注意的是因为 iOS 经常会退到后台,所以其他端发送的消息在 iOS 断线后是通过漫游消息来同步到的。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL syncEnabled;
|
||||
/**
|
||||
* 消息是否需要被计入未读计数(圈组支持)
|
||||
* @discussion 默认为YES。默认情况下,用户收到的所有消息都会被计入未读。设置这个为NO后,对应的消息被对端接受后将不计入未读消息计数内。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL shouldBeCounted;
|
||||
/**
|
||||
* 消息是否需要推送(圈组支持)
|
||||
* @discussion 默认为YES。将这个字段设为NO,消息将不再有苹果推送通知。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL apnsEnabled;
|
||||
/**
|
||||
* 推送是否需要带前缀(一般为昵称,圈组支持)
|
||||
* @discussion 默认为YES。将这个字段设为NO,推送消息将不带有前缀(xx:)。
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL apnsWithPrefix;
|
||||
|
||||
/**
|
||||
* 是否需要抄送
|
||||
* @discussion 默认为YES,即默认会抄送消息给开发者的服务器(如果有配置的话)
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL routeEnabled;
|
||||
|
||||
|
||||
/**
|
||||
* 其他群成员收到此消息是否需要发送已读回执
|
||||
* @discussion 默认为NO,设置成 YES 之后所有群回执相关操作才会生效
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL teamReceiptEnabled;
|
||||
|
||||
/**
|
||||
* 消息是否支持离线
|
||||
* @discussion 默认为YES,设置成 NO 之后消息将只会发送到在线的对端,对端不在线则会被丢弃。此开关对聊天室消息不生效
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL persistEnable;
|
||||
|
||||
/**
|
||||
* 消息对应的场景
|
||||
*/
|
||||
@property (nonatomic,strong) NSString* scene;
|
||||
|
||||
/**
|
||||
* 消息是否需要刷新到session服务。默认:是
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL isSessionUpdate;
|
||||
|
||||
/**
|
||||
* 消息是否需要快速投递
|
||||
* @discussion 默认为NO。将这个字段设为YES,消息在SDK内部将以最高优先级处理并发送,但会抢占其他业务的处理资源。此选项仅对点对点,群组,超大群会话类型有效
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL quickDeliveryEnabled;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// NIMMessageTimeConsumingStatistics.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2023年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 消息收发耗时统计
|
||||
*/
|
||||
@interface NIMTimeConsumingStatistics : NSObject
|
||||
|
||||
/**
|
||||
* 发送 调用api
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval sendTagInvokeAPI;
|
||||
|
||||
/**
|
||||
* 发送 进入发送队列
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval sendTagEnterSendQueue;
|
||||
|
||||
/**
|
||||
* 发送 收到服务器Ack
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval sendTagReceivedServerAck;
|
||||
|
||||
/**
|
||||
* 发送 回调应用层
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval sendTagCallbackApp;
|
||||
|
||||
/**
|
||||
* 接收 解析到消息包
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval recvTagParsedMessagePacket;
|
||||
|
||||
/**
|
||||
* 接收 回调应用层
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval recvTagCallbackApp;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by 陈吉力 on 2023/3/8.
|
||||
// Copyright (c) 2023 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMMessageSearchOption.h"
|
||||
|
||||
@class NIMSession;
|
||||
@class NIMMessage;
|
||||
|
||||
|
||||
@interface NIMMessagesInSessionOption : NSObject
|
||||
/** 会话 */
|
||||
@property(nonatomic, nonnull, copy) NIMSession *session;
|
||||
/** 锚点消息 */
|
||||
@property(nonatomic, nullable, copy) NIMMessage *message;
|
||||
/** 数量限制 */
|
||||
@property(nonatomic, assign) NSUInteger limit;
|
||||
/** 类型限制 */
|
||||
@property(nonatomic, nullable, copy)NSArray *filterTypes;
|
||||
/** 结束时间 */
|
||||
@property(nonatomic, assign) NSTimeInterval toTime;
|
||||
/** 查询方向 */
|
||||
@property(nonatomic, assign) NIMMessageSearchOrder order;
|
||||
@end
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// NIMNetCallNotificationContent.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMGlobalDefs.h"
|
||||
#import "NIMNotificationContent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 网络电话类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMNetCallEventType){
|
||||
/**
|
||||
* 对方无人接听
|
||||
*/
|
||||
NIMNetCallEventTypeNoResponse = -2,
|
||||
/**
|
||||
* 未接电话
|
||||
*/
|
||||
NIMNetCallEventTypeMiss = 101,
|
||||
/**
|
||||
* 电话回单
|
||||
*/
|
||||
NIMNetCallEventTypeBill = 102,
|
||||
/**
|
||||
* 对方拒接电话
|
||||
*/
|
||||
NIMNetCallEventTypeReject = 103,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 网络通话通知内容
|
||||
*/
|
||||
@interface NIMNetCallNotificationContent : NIMNotificationContent
|
||||
/**
|
||||
* 网络通话类型
|
||||
*/
|
||||
@property (nonatomic,assign) NIMNetCallType callType;
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
@property (nonatomic,assign) NIMNetCallEventType eventType;
|
||||
/**
|
||||
* call channel ID
|
||||
*/
|
||||
@property (nonatomic,assign) UInt64 callID;
|
||||
/**
|
||||
* 呼叫方 ID
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *from;
|
||||
/**
|
||||
* 发起时间
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval timetag;
|
||||
/**
|
||||
* 时长
|
||||
*/
|
||||
@property (nonatomic,assign) NSTimeInterval duration;
|
||||
|
||||
/**
|
||||
* 参与通话成员
|
||||
*/
|
||||
@property (nonatomic,strong) NSArray *members;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *extendMessage;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// NIMNotificationContent.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 通知类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMNotificationType){
|
||||
|
||||
/**
|
||||
* 未被支持的通知类型
|
||||
* @discussion 由于系统升级,旧版本的 SDK 可能无法解析新版本数据,所有无法解析的新通知显示为未被支持
|
||||
*/
|
||||
NIMNotificationTypeUnsupport = 0,
|
||||
/**
|
||||
* 群通知
|
||||
*/
|
||||
NIMNotificationTypeTeam = 1,
|
||||
/**
|
||||
* 网络电话通知
|
||||
*/
|
||||
NIMNotificationTypeNetCall = 2,
|
||||
/**
|
||||
* 聊天室通知
|
||||
*/
|
||||
NIMNotificationTypeChatroom = 3,
|
||||
/**
|
||||
* 超大群通知
|
||||
*/
|
||||
NIMNotificationTypeSuperTeam = 4,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 系统通知内容基类
|
||||
*/
|
||||
@interface NIMNotificationContent : NSObject
|
||||
/**
|
||||
* 通知内容类型
|
||||
*
|
||||
* @return 通知内容类型
|
||||
*/
|
||||
- (NIMNotificationType)notificationType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMNotificationObject.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NIMMessageObjectProtocol.h"
|
||||
#import "NIMTeamNotificationContent.h"
|
||||
#import "NIMNetCallNotificationContent.h"
|
||||
#import "NIMChatroomNotificationContent.h"
|
||||
#import "NIMUnsupportedNotificationContent.h"
|
||||
#import "NIMSuperTeamNotificationContent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 通知对象
|
||||
*/
|
||||
@interface NIMNotificationObject : NSObject<NIMMessageObject>
|
||||
/**
|
||||
* 通知内容
|
||||
*/
|
||||
@property (nonatomic,strong,readonly) NIMNotificationContent *content;
|
||||
|
||||
/**
|
||||
* 通知类型
|
||||
*/
|
||||
@property (nonatomic,assign,readonly) NIMNotificationType notificationType;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// NIMPassThroughManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease on 2019/12/19.
|
||||
// Copyright © 2019 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NIMPassThroughHttpData;
|
||||
@class NIMPassThroughMsgData;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 透传HTTP请求完成的回调block
|
||||
* @param response 透传请求的响应,如果错误则为nil
|
||||
* @param error 错误,如果成功则为nil
|
||||
*/
|
||||
typedef void(^NIMPassThroughCompletedBlock)(NIMPassThroughHttpData* __nullable response, NSError * __nullable error);
|
||||
|
||||
/**
|
||||
* 透传服务管理回调
|
||||
*/
|
||||
@protocol NIMPassThroughManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* 收到透传消息
|
||||
*
|
||||
* @param recvData 收到的透传消息数据
|
||||
*/
|
||||
- (void)didReceivedPassThroughMsg:(NIMPassThroughMsgData* __nullable)recvData;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* PassThrough接口
|
||||
*/
|
||||
@protocol NIMPassThroughManager <NSObject>
|
||||
|
||||
/**
|
||||
* 透传HTTP请求到应用服务
|
||||
*
|
||||
* @param reqData 透传的Http数据
|
||||
* @param completion 经验操作完成后的回调
|
||||
* @discussion 操作成功后,云信服务器会下发禁言的群通知消息
|
||||
*/
|
||||
- (void)passThroughHttpReq:(NIMPassThroughHttpData *)reqData
|
||||
completion:(nullable NIMPassThroughCompletedBlock)completion;
|
||||
|
||||
|
||||
/**
|
||||
* 添加透传管理的委托
|
||||
*
|
||||
* @param delegate 透传管理委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMPassThroughManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除透传管理的委托
|
||||
*
|
||||
* @param delegate 透传管理委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMPassThroughManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// NIMPassThroughOption.h
|
||||
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease on 2019/12/19.
|
||||
// Copyright © 2019 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, NIPassThroughHttpMethod){
|
||||
/*
|
||||
* Get
|
||||
*/
|
||||
NIPassThroughHttpMethodGet = 1,
|
||||
/*
|
||||
* POST
|
||||
*/
|
||||
NIPassThroughHttpMethodPost = 2,
|
||||
/*
|
||||
* Put
|
||||
*/
|
||||
NIPassThroughHttpMethodPut = 3,
|
||||
/*
|
||||
* Delete
|
||||
*/
|
||||
NIPassThroughHttpMethodDelete = 4,
|
||||
};
|
||||
|
||||
/**
|
||||
* 透传的HTTP数据
|
||||
*/
|
||||
@interface NIMPassThroughHttpData : NSObject
|
||||
|
||||
/**
|
||||
* 映射一个视频云upstream host
|
||||
* 不传则用默认配置
|
||||
* 选填
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *zone;
|
||||
|
||||
/**
|
||||
* url中除了host的path
|
||||
* 必填
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *path;
|
||||
|
||||
/**
|
||||
* Http Method
|
||||
* 默认post
|
||||
* 选填
|
||||
*/
|
||||
@property (nonatomic, assign) NIPassThroughHttpMethod method;
|
||||
|
||||
/**
|
||||
* Http Header
|
||||
* 必须为json格式
|
||||
* 选填
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *header;
|
||||
|
||||
/**
|
||||
* Http body
|
||||
* 格式自定
|
||||
* GET时必须为空, POST和PUT时必须为非空
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *body;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 收到的透传消息
|
||||
*/
|
||||
@interface NIMPassThroughMsgData : NSObject
|
||||
|
||||
/**
|
||||
* 发送方accid
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *fromAccid;
|
||||
|
||||
/**
|
||||
* 透传内容
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *body;
|
||||
|
||||
/**
|
||||
* 发送时间, 毫秒
|
||||
*/
|
||||
@property (nonatomic, assign) int64_t time;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// NIMPlatform.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2017年 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NIMPlatform_h
|
||||
#define NIMPlatform_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#define NIM_IOS 1
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
|
||||
#define NIM_MAC 1
|
||||
#endif
|
||||
|
||||
|
||||
#if NIM_IOS
|
||||
#import <UIKit/UIKit.h>
|
||||
#elif NIM_MAC
|
||||
#import <Cocoa/Cocoa.h>
|
||||
@compatibility_alias UIImage NSImage;
|
||||
@compatibility_alias UIView NSView;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* NIMPlatform_h */
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// NIMPushNotificationSetting.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright (c) 2015 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 推送消息显示类型
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMPushNotificationDisplayType){
|
||||
/**
|
||||
* 显示详情
|
||||
*/
|
||||
NIMPushNotificationDisplayTypeDetail = 1,
|
||||
/**
|
||||
* 不显示详情
|
||||
*/
|
||||
NIMPushNotificationDisplayTypeNoDetail = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* 推送消息等级配置类型
|
||||
* @discussion 低等级消息:普通消息等(没有具体目标、没有@意愿)。中等级消息:@所有人等(没有具体目标、有@意愿)。高等级消息: @某些人等(有具体目标、有@意愿)
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, NIMPushNotificationProfile){
|
||||
/**
|
||||
* 未指定
|
||||
*/
|
||||
NIMPushNotificationProfileNotSet = 0,
|
||||
|
||||
/**
|
||||
* 全部消息都收
|
||||
*/
|
||||
NIMPushNotificationProfileEnableAll = 1,
|
||||
|
||||
/**
|
||||
* 只收高、中等级消息
|
||||
*/
|
||||
NIMPushNotificationProfileOnlyHighAndMediumLevel = 2,
|
||||
|
||||
/**
|
||||
* 只收高等级消息
|
||||
*/
|
||||
NIMPushNotificationProfileOnlyHighLevel = 3,
|
||||
|
||||
/**
|
||||
* 全部消息都不收
|
||||
*/
|
||||
NIMPushNotificationProfileDisableAll = 4,
|
||||
|
||||
/**
|
||||
* 使用平台默认配置
|
||||
*/
|
||||
NIMPushNotificationProfilePlatformDefault = 5,
|
||||
};
|
||||
|
||||
/**
|
||||
* 消息推送免打扰参数设置
|
||||
*/
|
||||
@interface NIMPushNotificationSetting : NSObject<NSCopying>
|
||||
/**
|
||||
* 推送消息显示类型
|
||||
*/
|
||||
@property (nonatomic,assign) NIMPushNotificationDisplayType type;
|
||||
|
||||
/**
|
||||
* 推送消息是否开启免打扰 YES表示开启免打扰
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL noDisturbing;
|
||||
|
||||
/**
|
||||
* 免打扰开始时间:小时
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger noDisturbingStartH;
|
||||
|
||||
/**
|
||||
* 免打扰开始时间:分
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger noDisturbingStartM;
|
||||
|
||||
/**
|
||||
* 免打扰结束时间:小时
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger noDisturbingEndH;
|
||||
|
||||
/**
|
||||
* 免打扰结束时间:分
|
||||
*/
|
||||
@property (nonatomic,assign) NSUInteger noDisturbingEndM;
|
||||
|
||||
/**
|
||||
* 推送消息等级配置(当前仅在圈组中设置有效)
|
||||
*/
|
||||
@property (nonatomic,assign) NIMPushNotificationProfile profile;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
* 自定义消息多端推送策略配置项
|
||||
*/
|
||||
@interface NIMPushNotificationMultiportConfig : NSObject
|
||||
|
||||
/**
|
||||
* 桌面端在线时是否需要发送推送给手机端
|
||||
* @discussion 默认为 YES,即需要推送,桌面端包括 PC,web , macOS 等...
|
||||
*/
|
||||
@property (nonatomic,assign) BOOL shouldPushNotificationWhenPCOnline;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// NIMQChatAcceptServerApplyParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 接受申请的参数
|
||||
*/
|
||||
@interface NIMQChatAcceptServerApplyParam : NSObject
|
||||
|
||||
/**
|
||||
* 同意加入的服务器ID
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
/**
|
||||
* 申请者ID
|
||||
*/
|
||||
@property (nonnull, nonatomic, copy) NSString *accid;
|
||||
|
||||
/**
|
||||
* 请求id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long requestId;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// NIMQChatAcceptServerInviteParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 接受邀请的参数
|
||||
*/
|
||||
@interface NIMQChatAcceptServerInviteParam : NSObject <NSCopying>
|
||||
|
||||
/**
|
||||
* 接受加入的服务器Id,必填
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
/**
|
||||
* 发起邀请者的账号,必填
|
||||
*/
|
||||
@property (nonnull, nonatomic, copy) NSString * accid;
|
||||
|
||||
/**
|
||||
* 邀请ID
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long requestId;
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMQChatAddChannelCategoryMemberRoleParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 为某个人定制某频道分组的权限
|
||||
*/
|
||||
@interface NIMQChatAddChannelCategoryMemberRoleParam : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *accid;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMQChatAddChannelCategoryRoleParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 将某身份组加入某频道分组
|
||||
*/
|
||||
@interface NIMQChatAddChannelCategoryRoleParam : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
/**
|
||||
* 服务器身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long parentRoleId;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMQChatAddChannelRoleParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 将某身份组加入某频道
|
||||
*/
|
||||
@interface NIMQChatAddChannelRoleParam : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long channelId;
|
||||
/**
|
||||
* 服务器身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long parentRoleId;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NIMQChatAddMemberRoleParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 为某个人定制某频道的权限
|
||||
*/
|
||||
@interface NIMQChatAddMemberRoleParam : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long channelId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *accid;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// NIMQChatAddServerRoleMembersParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 将某些人加入某服务器身份组
|
||||
*/
|
||||
@interface NIMQChatAddServerRoleMembersParam : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
/**
|
||||
* 身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long roleId;
|
||||
/**
|
||||
* 用户accids
|
||||
*/
|
||||
@property (nonnull, nonatomic, copy) NSArray <NSString *> *accountArray;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// NIMQChatAddServerRoleMembersResult.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMQChatAddServerRoleMembersResult : NSObject
|
||||
|
||||
/**
|
||||
* 加入成功的accids
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray <NSString *> *successfulAccidArray;
|
||||
/**
|
||||
* 加入失败的accids
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray <NSString *> *failedAccidArray;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
//
|
||||
// NIMQChatApnsManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMQChatDefs.h"
|
||||
#import "NIMApnsManagerProtocol.h"
|
||||
#import "NIMPushNotificationSetting.h"
|
||||
#import "NIMQChatDefs.h"
|
||||
|
||||
@class NIMQChatChannelIdInfo;
|
||||
@class NIMQChatUserPushNotificationConfig;
|
||||
@class NIMQChatChannelCategoryIdInfo;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 圈组获取用户推送配置回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param config 配置信息
|
||||
*/
|
||||
typedef void(^NIMQChatGetUserPushNotificationConfigHandler)(NSError *__nullable error,
|
||||
NSArray<NIMQChatUserPushNotificationConfig *> *__nullable config);
|
||||
|
||||
/**
|
||||
* 推送委托
|
||||
*/
|
||||
@protocol NIMQChatApnsManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 推送协议
|
||||
*/
|
||||
@protocol NIMQChatApnsManager <NSObject>
|
||||
/**
|
||||
* 获取当前的推送免打扰设置
|
||||
*
|
||||
* @return 推送设置
|
||||
*/
|
||||
- (nullable NIMPushNotificationSetting *)currentSetting;
|
||||
|
||||
/**
|
||||
* 更新推送免打扰设置
|
||||
*
|
||||
* @param setting 推送设置
|
||||
* @param completion 完成的回调
|
||||
*/
|
||||
- (void)updateApnsSetting:(NIMPushNotificationSetting *)setting
|
||||
completion:(nullable NIMApnsHandler)completion;
|
||||
|
||||
/**
|
||||
* 注册获取 badge 数量的回调函数
|
||||
*
|
||||
* @param handler 获取 badge 回调
|
||||
* @discussion 默认场景下,云信会将所有未读数量统一汇报给服务器,包括需要提醒和不需要提醒的会话未读数,上层可以通过注册该接口进行调整
|
||||
*/
|
||||
- (void)registerBadgeCountHandler:(NIMBadgeHandler)handler;
|
||||
|
||||
/**
|
||||
* 更新服务器推送消息等级配置
|
||||
*
|
||||
* @param profile 推送消息等级配置
|
||||
* @param serverId 服务器ID
|
||||
* @param completion 完成的回调
|
||||
*/
|
||||
- (void)updatePushNotificationProfile:(NIMPushNotificationProfile)profile
|
||||
server:(unsigned long long)serverId
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新频道推送消息等级配置
|
||||
*
|
||||
* @param profile 推送消息等级配置
|
||||
* @param channelIdInfo 频道ID信息
|
||||
* @param completion 完成的回调
|
||||
*/
|
||||
- (void)updatePushNotificationProfile:(NIMPushNotificationProfile)profile
|
||||
channel:(NIMQChatChannelIdInfo *)channelIdInfo
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新频道分组推送消息等级配置
|
||||
*
|
||||
* @param profile 推送消息等级配置
|
||||
* @param categoryIdInfo 频道分组ID信息
|
||||
* @param completion 完成的回调
|
||||
*/
|
||||
- (void)updatePushNotificationProfile:(NIMPushNotificationProfile)profile
|
||||
channelCategory:(NIMQChatChannelCategoryIdInfo *)categoryIdInfo
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 获取服务器维度用户推送配置
|
||||
*
|
||||
* @param serverIds 服务器ID数组
|
||||
* @param completion 完成的回调
|
||||
* @discussion 限制单次查询服务器数量为10
|
||||
*/
|
||||
- (void)getUserPushNotificationConfigByServer:(NSArray<NSNumber *> *)serverIds
|
||||
completion:(nullable NIMQChatGetUserPushNotificationConfigHandler)completion;
|
||||
|
||||
/**
|
||||
* 获取频道维度用户推送配置
|
||||
*
|
||||
* @param channelIdInfo 频道ID信息数组
|
||||
* @param completion 完成的回调
|
||||
* @discussion 限制单次查询频道数量为10
|
||||
*/
|
||||
- (void)getUserPushNotificationConfigByChannel:(NSArray<NIMQChatChannelIdInfo *> *)channelIdInfo
|
||||
completion:(nullable NIMQChatGetUserPushNotificationConfigHandler)completion;
|
||||
/**
|
||||
* 获取频道分组维度用户推送配置
|
||||
*
|
||||
* @param categoryIdInfo 频道分组ID信息数组
|
||||
* @param completion 完成的回调
|
||||
* @discussion 限制单次查询频道数量为10
|
||||
*/
|
||||
- (void)getUserPushNotificationConfigByChannelCategories:(NSArray<NIMQChatChannelCategoryIdInfo *> *)categoryIdInfos
|
||||
completion:(nullable NIMQChatGetUserPushNotificationConfigHandler)completion;
|
||||
/**
|
||||
* 添加委托
|
||||
*
|
||||
* @param delegate 委托
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMQChatApnsManagerDelegate>)delegate;
|
||||
|
||||
|
||||
/**
|
||||
* 移除委托
|
||||
*
|
||||
* @param delegate 委托
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMQChatApnsManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// NIMQChatApplyServerJoinParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 申请加入服务器的参数
|
||||
*/
|
||||
@interface NIMQChatApplyServerJoinParam : NSObject
|
||||
|
||||
/**
|
||||
* 申请加入的服务器Id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
/**
|
||||
* 附言(最长5000)
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSString *postscript;
|
||||
|
||||
/**
|
||||
* 有效时间,秒的NSNumber包装
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) NSNumber *ttl;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// NIMQChatApplyServerJoinResult.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by lihuang on 2022/6/21.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 申请加入服务器的结果
|
||||
*/
|
||||
@interface NIMQChatApplyServerJoinResult : NSObject
|
||||
/**
|
||||
* 申请id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long requestId;
|
||||
|
||||
/**
|
||||
* 申请的有效时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval ttl;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
//
|
||||
// NIMQChatAreMentionedMeMessagesParam.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMQChatDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMQChatMessage;
|
||||
|
||||
/**
|
||||
* 批量查询消息是否 @ 当前用户的参数
|
||||
*/
|
||||
@interface NIMQChatAreMentionedMeMessagesParam : NSObject
|
||||
|
||||
/**
|
||||
* 要查询的圈组消息数组
|
||||
*/
|
||||
@property (nonatomic, copy)NSArray<NIMQChatMessage *> *messages;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
//
|
||||
// NIMQChatAreMentionedMeMessagesResult.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* 批量查询消息是否 @ 当前用户的结果
|
||||
*/
|
||||
@interface NIMQChatAreMentionedMeMessagesResult : NSObject
|
||||
|
||||
/**
|
||||
* 查询到的数据 消息 key:uuid value:YES/NO
|
||||
*/
|
||||
@property (nullable, nonatomic, copy)NSDictionary<NSString *,NSNumber*> *result;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// NIMQChatChannel.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMQChatDefs.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 频道
|
||||
*/
|
||||
@interface NIMQChatChannel : NSObject
|
||||
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long channelId;
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
/**
|
||||
* 应用id
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger appId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
|
||||
/**
|
||||
* 主题
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *topic;
|
||||
|
||||
/**
|
||||
* 自定义扩展
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *custom;
|
||||
|
||||
/**
|
||||
* 类型:0-消息频道,100自定义频道
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatChannelType type;
|
||||
|
||||
/**
|
||||
* 有效标志:0-无效,1-有效
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL validflag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
/**
|
||||
* 所有者
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *owner;
|
||||
|
||||
/**
|
||||
* 查看模式
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatChannelViewMode viewMode;
|
||||
|
||||
/**
|
||||
* 频道分组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
|
||||
/**
|
||||
* 是否与频道分组配置同步
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatChannelSyncMode syncMode;
|
||||
|
||||
/**
|
||||
* 自定义排序权重值
|
||||
*/
|
||||
@property (nonatomic, assign) long reorderWeight;
|
||||
|
||||
/**
|
||||
* 游客可见模式
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatVisitorMode visitorMode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// NIMQChatChannelCategory.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMQChatDefs.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 频道分组
|
||||
*/
|
||||
@interface NIMQChatChannelCategory : NSObject
|
||||
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
/**
|
||||
* 应用id
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger appId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
|
||||
/**
|
||||
* 自定义扩展
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *custom;
|
||||
|
||||
/**
|
||||
* 有效标志:0-无效,1-有效
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL validflag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
/**
|
||||
* 所有者
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *owner;
|
||||
|
||||
/**
|
||||
* 查看模式
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatChannelViewMode viewMode;
|
||||
|
||||
/**
|
||||
* 频道数量
|
||||
*/
|
||||
@property (nonatomic, assign) NSInteger channelNumber;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// NIMQChatChannelCategoryIdInfo.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Evang on 2022/4/28.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 频道分组id信息
|
||||
*/
|
||||
@interface NIMQChatChannelCategoryIdInfo : NSObject
|
||||
|
||||
/**
|
||||
* 频道分组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// NIMQChatChannelCategoryMemberRole.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "NIMQChatDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMQChatPermissionStatusInfo;
|
||||
|
||||
@interface NIMQChatChannelCategoryMemberRole : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 定制权限id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long roleId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *accid;
|
||||
/**
|
||||
* 频道分组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
/**
|
||||
* 该身份组各资源的权限状态
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray <NIMQChatPermissionStatusInfo *> *auths;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
/**
|
||||
* 昵称
|
||||
* */
|
||||
@property (nonatomic, copy) NSString *nick;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
/**
|
||||
* 自定义字段
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *custom;
|
||||
/**
|
||||
* 成员类型
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatServerMemberType type;
|
||||
/**
|
||||
* 加入时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval joinTime;
|
||||
/**
|
||||
* 邀请者accid
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *inviter;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// NIMQChatChannelCategoryRole.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMQChatDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class NIMQChatPermissionStatusInfo;
|
||||
@interface NIMQChatChannelCategoryRole : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long roleId;
|
||||
/**
|
||||
* 继承服务器的身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long parentRoleId;
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long categoryId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@property (nonnull, nonatomic, copy) NSString *name;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatRoleType type;
|
||||
/**
|
||||
* icon图
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *icon;
|
||||
/**
|
||||
* 自定义扩展
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *ext;
|
||||
/**
|
||||
* 该身份组各资源的权限状态
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray <NIMQChatPermissionStatusInfo *> *auths;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// NIMQChatChannelIdInfo.h
|
||||
// NIMSDK
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 频道ID
|
||||
*/
|
||||
@interface NIMQChatChannelIdInfo : NSObject<NSCopying>
|
||||
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long channelId;
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
|
||||
- (instancetype)initWithChannelId:(unsigned long long int)channelId serverId:(unsigned long long int)serverId;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+560
@@ -0,0 +1,560 @@
|
||||
//
|
||||
// NIMQChatChannelManagerProtocol.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "NIMQChatDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class NIMQChatChannel;
|
||||
|
||||
@class NIMQChatCreateChannelParam;
|
||||
@class NIMQChatDeleteChannelParam;
|
||||
@class NIMQChatUpdateChannelParam;
|
||||
@class NIMQChatGetChannelsParam;
|
||||
@class NIMQChatGetChannelsByPageParam;
|
||||
@class NIMQChatGetChannelMembersByPageParam;
|
||||
@class NIMQChatGetChannelBlackWhiteRolesByPageParam;
|
||||
@class NIMQChatGetChannelBlackWhiteMembersByPageParam;
|
||||
@class NIMQChatUpdateChannelBlackWhiteRoleParam;
|
||||
@class NIMQChatUpdateChannelBlackWhiteMembersParam;
|
||||
@class NIMQChatGetExistingChannelBlackWhiteRolesParam;
|
||||
@class NIMQChatGetExistingChannelBlackWhiteMembersParam;
|
||||
|
||||
@class NIMQChatGetChannelsResult;
|
||||
@class NIMQChatGetChannelMembersByPageResult;
|
||||
@class NIMQChatGetChannelBlackWhiteRolesByPageResult;
|
||||
@class NIMQChatGetChannelBlackWhiteMembersByPageResult;
|
||||
|
||||
@class NIMQChatSubscribeChannelParam;
|
||||
@class NIMQChatGetChannelUnreadInfosParam;
|
||||
@class NIMQChatGetChannelUnreadInfosResult;
|
||||
@class NIMQChatGetChannelsByPageResult;
|
||||
@class NIMQChatGetExistingChannelBlackWhiteRolesResult;
|
||||
@class NIMQChatGetExistingChannelBlackWhiteMembersResult;
|
||||
|
||||
@class NIMQChatServerRole;
|
||||
@class NIMQChatServerMember;
|
||||
@class NIMQChatChannelMember;
|
||||
|
||||
// 频道分组
|
||||
@class NIMQChatCreateChannelCategoryParam;
|
||||
@class NIMQChatUpdateChannelCategoryParam;
|
||||
@class NIMQChatDeleteChannelCategoryParam;
|
||||
@class NIMQChatGetChannelCategoriesParam;
|
||||
@class NIMQChatGetChannelCategoryBlackWhiteRolesByPageParam;
|
||||
@class NIMQChatGetChannelCategoryBlackWhiteMembersByPageParam;
|
||||
@class NIMQChatUpdateChannelCategoryBlackWhiteRoleParam;
|
||||
@class NIMQChatUpdateChannelCategoryBlackWhiteMembersParam;
|
||||
@class NIMQChatGetExistingChannelCategoryBlackWhiteRolesParam;
|
||||
@class NIMQChatGetExistingChannelCategoryBlackWhiteMembersParam;
|
||||
@class NIMQChatGetChannelsInCategoryByPageParam;
|
||||
@class NIMQChatGetCategoriesInServerByPageParam;
|
||||
|
||||
@class NIMQChatGetChannelCategoriesResult;
|
||||
@class NIMQChatGetChannelCategoryMembersByPageResult;
|
||||
@class NIMQChatGetChannelCategoryBlackWhiteRolesByPageResult;
|
||||
@class NIMQChatGetChannelCategoryBlackWhiteMembersByPageResult;
|
||||
|
||||
@class NIMQChatGetExistingChannelCategoryBlackWhiteRolesResult;
|
||||
@class NIMQChatGetExistingChannelCategoryBlackWhiteMembersResult;
|
||||
@class NIMQChatGetChannelsInCategoryByPageResult;
|
||||
@class NIMQChatGetCategoriesInServerByPageResult;
|
||||
@class NIMQChatUpdateCategoryInfoOfChannelParam;
|
||||
|
||||
@class NIMQChatChannelCategory;
|
||||
@class NIMQChatSearchChannelByPageResult;
|
||||
@class NIMQChatSearchChannelByPageParam;
|
||||
@class NIMQChatSubscribeChannelResult;
|
||||
@class NIMQChatSubscribeChannelAsVisitorResult;
|
||||
@class NIMQChatSubscribeChannelAsVisitorParam;
|
||||
|
||||
/**
|
||||
* 创建圈组频道的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatCreateChannelHandler)(NSError *__nullable error,
|
||||
NIMQChatChannel *__nullable result);
|
||||
|
||||
/**
|
||||
* 查询圈组频道信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelsHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelsResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询圈组频道信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelsByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelsByPageResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 更新圈组频道信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatUpdateChannelHandler)(NSError *__nullable error,
|
||||
NIMQChatChannel *__nullable result);
|
||||
|
||||
/**
|
||||
* 更新圈组频道中所属频道分组信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatUpdateCategoryInfoOfChannelHandler)(NSError *__nullable error,
|
||||
NIMQChatChannel *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询圈组频道成员的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelMembersByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelMembersByPageResult *__nullable result);
|
||||
/**
|
||||
* 分页查询频道黑白名单身份组列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelBlackWhiteRolesByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelBlackWhiteRolesByPageResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询频道黑白名单成员列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelBlackWhiteMembersByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelBlackWhiteMembersByPageResult *__nullable result);
|
||||
/**
|
||||
* 批量查询频道黑白名单身份组列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetExistingChannelBlackWhiteRolesHandler)(NSError *__nullable error,
|
||||
NIMQChatGetExistingChannelBlackWhiteRolesResult *__nullable result);
|
||||
/**
|
||||
* 批量查询频道黑白名单成员列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetExistingChannelBlackWhiteMembersHandler)(NSError *__nullable error,
|
||||
NIMQChatGetExistingChannelBlackWhiteMembersResult *__nullable result);
|
||||
/**
|
||||
* 查询未读信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelUnreadInfosHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelUnreadInfosResult *__nullable result);
|
||||
/**
|
||||
* 创建圈组频道分组的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatCreateChannelCategoryHandler)(NSError *__nullable error,
|
||||
NIMQChatChannelCategory *__nullable result);
|
||||
|
||||
/**
|
||||
* 更新圈组频道分组信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatUpdateChannelCategoryHandler)(NSError *__nullable error,
|
||||
NIMQChatChannelCategory *__nullable result);
|
||||
|
||||
/**
|
||||
* 查询圈组频道分组信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelCategoriesHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelCategoriesResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询频道分组黑白名单身份组列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelCategoryBlackWhiteRolesByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelCategoryBlackWhiteRolesByPageResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询频道分组黑白名单成员列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelCategoryBlackWhiteMembersByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelCategoryBlackWhiteMembersByPageResult *__nullable result);
|
||||
/**
|
||||
* 批量查询频道分组黑白名单身份组列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetExistingChannelCategoryBlackWhiteRolesHandler)(NSError *__nullable error,
|
||||
NIMQChatGetExistingChannelCategoryBlackWhiteRolesResult *__nullable result);
|
||||
/**
|
||||
* 批量查询频道分组黑白名单成员列表的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetExistingChannelCategoryBlackWhiteMembersHandler)(NSError *__nullable error,
|
||||
NIMQChatGetExistingChannelCategoryBlackWhiteMembersResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询频道分组中频道信息的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetChannelsInCategoryByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetChannelsInCategoryByPageResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页查询服务器内频道分组的回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatGetCategoriesInServerByPageHandler)(NSError *__nullable error,
|
||||
NIMQChatGetCategoriesInServerByPageResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 分页检索频道信息回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatSearchChannelByPageHandler)(NSError *__nullable error, NIMQChatSearchChannelByPageResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 订阅频道的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatSubscribeChannelHandler)(NSError *__nullable error, NIMQChatSubscribeChannelResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 以游客身份订阅频道的结果回调
|
||||
*
|
||||
* @param error 错误信息
|
||||
* @param result 回调结果
|
||||
*/
|
||||
typedef void(^NIMQChatSubscribeChannelAsVisitorHandler)(NSError *__nullable error, NIMQChatSubscribeChannelAsVisitorResult *__nullable result);
|
||||
|
||||
/**
|
||||
* 圈组频道管理器回调
|
||||
*/
|
||||
@protocol NIMQChatChannelManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* 圈组频道管理器
|
||||
*/
|
||||
@protocol NIMQChatChannelManager <NSObject>
|
||||
/**
|
||||
* 创建圈组频道
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)createChannel:(NIMQChatCreateChannelParam *)param
|
||||
completion:(nullable NIMQChatCreateChannelHandler)completion;
|
||||
|
||||
/**
|
||||
* 删除圈组频道
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)deleteChannel:(NIMQChatDeleteChannelParam *)param
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 修改圈组频道信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateChannel:(NIMQChatUpdateChannelParam *)param
|
||||
completion:(nullable NIMQChatUpdateChannelHandler)completion;
|
||||
|
||||
/**
|
||||
* 修改圈组频道中所属分组相关信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateCategoryInfoOfChannel:(NIMQChatUpdateCategoryInfoOfChannelParam *)param
|
||||
completion:(nullable NIMQChatUpdateCategoryInfoOfChannelHandler)completion;
|
||||
|
||||
/**
|
||||
* 查询圈组频道信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannels:(NIMQChatGetChannelsParam *)param
|
||||
completion:(nullable NIMQChatGetChannelsHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询圈组频道信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannelsByPage:(NIMQChatGetChannelsByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelsByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 订阅频道请求
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)subscribeChannel:(NIMQChatSubscribeChannelParam *)param
|
||||
completion:(nullable NIMQChatSubscribeChannelHandler)completion;
|
||||
|
||||
/**
|
||||
* 查询未读信息
|
||||
*/
|
||||
- (void)getChannelUnreadInfos:(NIMQChatGetChannelUnreadInfosParam *)param
|
||||
completion:(nullable NIMQChatGetChannelUnreadInfosHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询圈组频道成员
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannelMembersByPage:(NIMQChatGetChannelMembersByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelMembersByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询频道黑白名单成员列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getBlackWhiteMembersByPage:(NIMQChatGetChannelBlackWhiteMembersByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelBlackWhiteMembersByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新频道黑白名单成员
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateBlackWhiteMembers:(NIMQChatUpdateChannelBlackWhiteMembersParam *)param
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询频道黑白名单身份组列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getBlackWhiteRolesByPage:(NIMQChatGetChannelBlackWhiteRolesByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelBlackWhiteRolesByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新频道黑白名单身份组
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateBlackWhiteRole:(NIMQChatUpdateChannelBlackWhiteRoleParam *)param
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 批量查询频道黑白名单身份组列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getExistingChannelBlackWhiteRoles:(NIMQChatGetExistingChannelBlackWhiteRolesParam *)param
|
||||
completion:(nullable NIMQChatGetExistingChannelBlackWhiteRolesHandler)completion;
|
||||
/**
|
||||
* 批量查询频道黑白名单成员列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getExistingChannelBlackWhiteMembers:(NIMQChatGetExistingChannelBlackWhiteMembersParam *)param
|
||||
completion:(nullable NIMQChatGetExistingChannelBlackWhiteMembersHandler)completion;
|
||||
|
||||
#pragma mark -- 频道分组 --
|
||||
|
||||
/**
|
||||
* 创建圈组频道分组
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)createChannelCategory:(NIMQChatCreateChannelCategoryParam *)param
|
||||
completion:(nullable NIMQChatCreateChannelCategoryHandler)completion;
|
||||
|
||||
/**
|
||||
* 删除圈组频道分组
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)deleteChannelCategory:(NIMQChatDeleteChannelCategoryParam *)param
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 修改圈组频道分组信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateChannelCategory:(NIMQChatUpdateChannelCategoryParam *)param
|
||||
completion:(nullable NIMQChatUpdateChannelCategoryHandler)completion;
|
||||
|
||||
/**
|
||||
* 查询圈组频道分组信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannelCategories:(NIMQChatGetChannelCategoriesParam *)param
|
||||
completion:(nullable NIMQChatGetChannelCategoriesHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询频道分组黑白名单成员列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannelCategoryBlackWhiteMembersByPage:(NIMQChatGetChannelCategoryBlackWhiteMembersByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelCategoryBlackWhiteMembersByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新频道分组黑白名单成员
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateChannelCategoryBlackWhiteMembers:(NIMQChatUpdateChannelCategoryBlackWhiteMembersParam *)param
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询频道分组黑白名单身份组列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannelCategoryBlackWhiteRolesByPage:(NIMQChatGetChannelCategoryBlackWhiteRolesByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelCategoryBlackWhiteRolesByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 更新频道分组黑白名单身份组
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)updateChannelCategoryBlackWhiteRole:(NIMQChatUpdateChannelCategoryBlackWhiteRoleParam *)param
|
||||
completion:(nullable NIMQChatHandler)completion;
|
||||
|
||||
/**
|
||||
* 批量查询频道分组黑白名单身份组列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getExistingChannelCategoryBlackWhiteRoles:(NIMQChatGetExistingChannelCategoryBlackWhiteRolesParam *)param
|
||||
completion:(nullable NIMQChatGetExistingChannelCategoryBlackWhiteRolesHandler)completion;
|
||||
/**
|
||||
* 批量查询频道分组黑白名单成员列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getExistingChannelCategoryBlackWhiteMembers:(NIMQChatGetExistingChannelCategoryBlackWhiteMembersParam *)param
|
||||
completion:(nullable NIMQChatGetExistingChannelCategoryBlackWhiteMembersHandler)completion;
|
||||
/**
|
||||
* 分页查询频道分组内频道信息
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getChannelsInCategoryByPage:(NIMQChatGetChannelsInCategoryByPageParam *)param
|
||||
completion:(nullable NIMQChatGetChannelsInCategoryByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 分页查询服务器内频道分组
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)getCategoriesInServerByPage:(NIMQChatGetCategoriesInServerByPageParam *)param
|
||||
completion:(nullable NIMQChatGetCategoriesInServerByPageHandler)completion;
|
||||
|
||||
/**
|
||||
* 检索频道列表
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)searchChannelByPage:(NIMQChatSearchChannelByPageParam *)param completion:(nullable NIMQChatSearchChannelByPageHandler) completion;
|
||||
|
||||
/**
|
||||
* 以游客身份订阅频道
|
||||
*
|
||||
* @param param 传入参数
|
||||
* @param completion 结果回调
|
||||
*/
|
||||
- (void)subscribeAsVisitor:(nonnull NIMQChatSubscribeChannelAsVisitorParam*)param
|
||||
completion:(nullable NIMQChatSubscribeChannelAsVisitorHandler)completion;
|
||||
|
||||
/**
|
||||
* 添加通知对象
|
||||
*
|
||||
* @param delegate 通知对象
|
||||
*/
|
||||
- (void)addDelegate:(id<NIMQChatChannelManagerDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* 移除通知对象
|
||||
*
|
||||
* @param delegate 通知对象
|
||||
*/
|
||||
- (void)removeDelegate:(id<NIMQChatChannelManagerDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// NIMQChatChannelMember.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by 齐洪茹 on 2022/8/23.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NIMQChatChannelMember : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long channelId;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
|
||||
/**
|
||||
* 用户accid
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *accid;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *nick;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// NIMQChatChannelRole.h
|
||||
// NIMLib
|
||||
//
|
||||
// Created by Netease.
|
||||
// Copyright © 2022 Netease. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NIMQChatDefs.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class NIMQChatPermissionStatusInfo;
|
||||
@interface NIMQChatChannelRole : NSObject
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long serverId;
|
||||
/**
|
||||
* 身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long roleId;
|
||||
/**
|
||||
* 继承服务器的身份组id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long parentRoleId;
|
||||
/**
|
||||
* 频道id
|
||||
*/
|
||||
@property (nonatomic, assign) unsigned long long channelId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@property (nonnull, nonatomic, copy) NSString *name;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@property (nonatomic, assign) NIMQChatRoleType type;
|
||||
/**
|
||||
* icon图
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *icon;
|
||||
/**
|
||||
* 自定义扩展
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *ext;
|
||||
/**
|
||||
* 该身份组各资源的权限状态
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray <NIMQChatPermissionStatusInfo *> *auths;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval updateTime;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user