NIMSDK-iOS
|
登录协议 更多...
#import <V2NIMStorageServiceProtocol.h>
构造函数 | |
(void) | - addCustomStorageScene:expireTime: |
(V2NIMUploadFileTask *) | - createUploadFileTask: |
(void) | - uploadFile:success:failure:progress: |
(void) | - cancelUploadFile:success:failure: |
(NSArray< V2NIMStorageScene * > *) | - getStorageSceneList |
(void) | - shortUrlToLong:success:failure: |
(void) | - downloadFile:filePath:success:failure:progress: |
(void) | - downloadAttachment:success:failure:progress: |
(void) | - getImageThumbUrl:thumbSize:success:failure: |
(void) | - getVideoCoverUrl:thumbSize:success:failure: |
登录协议
- (void) addCustomStorageScene: | (NSString *) | sceneName | |
expireTime: | (NSUInteger) | expireTime | |
添加自定义存储场景
sceneName | 场景名 |
expireTime | 过期时间, 单位秒 |
- (void) cancelUploadFile: | (V2NIMUploadFileTask *) | fileTask | |
success: | (V2NIMSuccessCallback) | success | |
failure: | (V2NIMFailureCallback) | failure | |
- (V2NIMUploadFileTask *) createUploadFileTask: | (V2NIMUploadFileParams *) | fileParams |
创建文件上传任务
fileParams | 文件上传的相关参数 |
- (void) downloadAttachment: | (V2NIMDownloadMessageAttachmentParams *) | downloadParam | |
success: | (V2NIMDownloadAttachmentSuccess) | success | |
failure: | (V2NIMFailureCallback) | failure | |
progress: | (nullable V2NIMProgressCallback) | progress | |
下载消息附件
downloadParam | 下载参数 |
success | 下载消息附件成功回调 |
failure | 下载消息附件失败回调 |
progress | 下载消息附件进度回调 |
- (void) downloadFile: | (NSString *) | url | |
filePath: | (NSString *) | filePath | |
success: | (V2NIMFileDownloadSuccess) | success | |
failure: | (V2NIMFailureCallback) | failure | |
progress: | (nullable V2NIMProgressCallback) | progress | |
文件下载接口,可以下载指定连接对应的文件地址
url | 文件远程地址 |
filePath | 文件存储地址 |
success | 下载成功的回调 |
failure | 下载失败的回调 |
progress | 文件下载进度回调 |
- (void) getImageThumbUrl: | (V2NIMMessageAttachment *) | attachment | |
thumbSize: | (V2NIMSize *) | thumbSize | |
success: | (V2NIMGetImageThumbUrlSuccess) | success | |
failure: | (V2NIMFailureCallback) | failure | |
获取图片消息中的图片缩略图 传入短链自动获取长链地址并携带缩略图相关 URL 查询参数 旧的下载地址会做新的 CDN 加速域名地址替换 开启自定义鉴权会返回对应的鉴权信息
attachment | 消息附件 |
thumbSize | 缩略图尺寸 |
success | 成功回调 |
failure | 失败回调 |
- (NSArray< V2NIMStorageScene * > *) getStorageSceneList |
- (void) getVideoCoverUrl: | (V2NIMMessageAttachment *) | attachment | |
thumbSize: | (V2NIMSize *) | thumbSize | |
success: | (V2NIMGetVideoCoverUrlSuccess) | success | |
failure: | (V2NIMFailureCallback) | failure | |
获取视频消息中的视频封面 传入短链自动获取长链地址并携带视频封面相关 URL 查询参数 旧的下载地址会做新的 CDN 加速域名地址替换 开启自定义鉴权会返回对应的鉴权信息
attachment | 消息附件 |
thumbSize | 缩略图尺寸 |
success | 成功回调 |
failure | 失败回调 |
- (void) shortUrlToLong: | (NSString *) | url | |
success: | (V2NIMShortUrlToLongSuccess) | success | |
failure: | (V2NIMFailureCallback) | failure | |
短链接转长链接
url | 短链 |
success | 成功回调 |
failure | 失败回调 |
- (void) uploadFile: | (V2NIMUploadFileTask *) | fileTask | |
success: | (V2NIMFileUploadSuccess) | success | |
failure: | (V2NIMFileUploadFailure) | failure | |
progress: | (V2NIMFileUploadProgress) | progress | |