推流直播带货功能接入文档时序图接入方式本地集成cocoapods 集成新增 API ---------------- 前置条件 ----------------房间互动功能配置信息(代理方法)HDSInteractionConfigureModel获取互动组件Token(主动方法)---------------- 初始化直播带货组件 ----------------初始化直播带货组件SDK(主动方法)HDSLiveStoreFuncConfig---------------- 获取商品列表 ----------------获取商品列表(主动方法)HDSItemListModelHDSSingleItemModelHDSItemPageInformationModel---------------- 获取导入商品列表 ----------------获取导入商品列表 (主动方法)HDSImportItemListModelHDSImportSingleItemModelHDSItemPageInformationModel---------------- 导入商品 ----------------导入商品(主动方法)---------------- 删除商品 ----------------删除商品(主动方法)---------------- 推送商品 ----------------推送商品(主动方法)---------------- 取消推送 ----------------取消推送(主动方法)---------------- 置顶商品 ----------------置顶商品(主动方法)---------------- 取消置顶 ----------------取消置顶(主动方法)
新增依赖库(动态库) | 接入方式 | 签名选择 |
---|---|---|
HDSLivePushStoreModule.framework | 下载zip包中 SDK文件夹下 HDSLivePushStoreModule 文件夹下,将framework拖入项目中 | Embed & Sign |
新增依赖库(动态库) | 接入方式 | 是否必须 |
---|---|---|
HDSLivePushStoreModule.framework | 在Podfile文件中添加: pod 'HDSLivePushStoreModule' | 是 |
方法 | 注释 | 所在类文件 |
---|---|---|
(void)onInteractionConfigure: | 互动功能配置 | HDLiveKit/CCPushUtil.h |
示例代码
/// 房间互动配置
/// @param model 配置项
- (void)onInteractionConfigure:(HDSInteractionConfigureModel *)model;
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
isLiveStoreSwitch | BOOL | 直播带货开关 0:关闭 1:开启 | HDLiveKit/PushParameters.h |
方法 | 注释 | 所在类文件 |
---|---|---|
(void)getInteractionToken: token: | 获取互动组件 token | HDLiveKit/CCPushUtil.h |
示例代码
/// 获取互动token
/// @param closure 操作回调
/// @param token interactionTokenBlock token回调 "completeHandler回调中 result == YES ,返回token ,result == NO时返回@""(空字符串) "
- (void)getInteractionToken:(completeHandler)closure token:(interactionTokenBlock)token;
方法 | 注释 | 所在类文件 |
---|---|---|
(instancetype)initLivePushStoreFuncWithConfig: closure: | 初始化直播带货功能 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
/// 初始化
/// @param config 配置项
/// @param closure 操作回调
- (instancetype)initLivePushStoreFuncWithConfig:(HDSLivePushStoreFuncConfig *)config
closure:(completeHandler)closure;
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
token | String | token | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
方法 | 注释 | 所在类文件 |
---|---|---|
(void)getItemList: pageSize: closure: itemsModel: | 获取商品列表 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
/// 获取商品列表
/// @param pageNum 页码 (从 1 开始)
/// @param pageSize 每页展示条数
/// @param closure 操作回调
/// @param itemsClosure 商品列表回调
- (void)getItemList:(NSInteger)pageNum
pageSize:(NSInteger)pageSize
closure:(completeHandler)closure
itemsModel:(itemListClosure)itemsClosure;
typedef void (^itemListClosure)(HDSItemListModel *model);
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
records | HDSSingleItemModel(Array) | 商品列表 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
pagination | HDSItemPageInformationModel(Model) | 分页信息 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
id | String | 商品id | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
title | String | 商品名称 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
cover | String | 商品图片 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
desc | String | 商品描述 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
tags | Array | 商品标签 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
originPrice | Double | 商品原价(单位:分) | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
currentPrice | Double | 商品现价(单位:分) | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
buttonTitle | String | 按钮文案 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
top | Bool | 是否置顶 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
push | Bool | 是否推送 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
score | Integer | 商品序号 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
pageNo | Integer | 当前页 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
pageSize | Integer | 每页显示的数据条数 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
totalCount | Integer | 商品总数 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
pageCount | Integer | 总页码 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
方法 | 注释 | 所在类文件 |
---|---|---|
(void)getImportItemList: pageSize: closure: importItemsModel: | 获取导入商品列表 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
/// 获取导入商品列表
/// @param pageNum 页码 (从 1 开始)
/// @param pageSize 每页展示条数
/// @param closure 操作回调
/// @param importItemsClosure 商品列表回调
- (void)getImportItemList:(NSInteger)pageNum
pageSize:(NSInteger)pageSize
closure:(completeHandler)closure
importItemsModel:(importItemListClosure)importItemsClosure;
typedef void (^importItemListClosure)(HDSImportItemListModel *model);
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
records | HDSImportSingleItemModel(Array) | 商品列表 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
pagination | HDSItemPageInformationModel(Model) | 分页信息 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
id | String | 商品id | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
title | String | 商品名称 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
cover | String | 商品图片 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
originPrice | Double | 商品原价(单位:分) | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
currentPrice | Double | 商品现价(单位:分) | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
gmtCreate | Integer | 添加时间 (ms) | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
bind | Integer | 导入标记:0-未导入;1-已导入 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
参数 | 类型 | 注释 | 所在类文件 |
---|---|---|---|
pageNo | Integer | 当前页 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
pageSize | Integer | 每页显示的数据条数 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
totalCount | Integer | 商品总数 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
pageCount | Integer | 总页码 | HDSLivePushStoreModule/HDSLivePushStoreFuncConfig.h |
方法 | 注释 | 所在类文件 |
---|---|---|
(void)importItem: closure: | 导入商品 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
/// 导入商品
/// @param itemId 商品ID
/// @param closure 操作回调
- (void)importItem:(NSString *)itemId closure:(completeHandler)closure;
方法 | 注释 | 所在类文件 |
---|---|---|
(void)removeItem: closure: | 删除商品 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
xxxxxxxxxx
/// 移除商品
/// @param itemId 商品ID
/// @param closure 操作回调
- (void)removeItem:(NSString *)itemId closure:(completeHandler)closure;
方法 | 注释 | 所在类文件 |
---|---|---|
(void)pushItem: closure: | 推送商品 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
xxxxxxxxxx
/// 推送商品
/// @param itemId 商品ID
/// @param closure 操作回调
- (void)pushItem:(NSString *)itemId closure:(completeHandler)closure;
方法 | 注释 | 所在类文件 |
---|---|---|
(void)cancelPushItem: closure: | 取消推送 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
xxxxxxxxxx
/// 取消推送
/// @param itemId 商品ID
/// @param closure 操作回调
- (void)cancelPushItem:(NSString *)itemId closure:(completeHandler)closure;
方法 | 注释 | 所在类文件 |
---|---|---|
(void)toTopItem: closure: | 置顶商品 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
xxxxxxxxxx
/// 置顶商品
/// @param itemId 商品ID
/// @param closure 操作回调
- (void)toTopItem:(NSString *)itemId closure:(completeHandler)closure;
方法 | 注释 | 所在类文件 |
---|---|---|
(void)cancelToTopItem: closure: | 取消置顶 | HDSLivePushStoreModule/HDSLivePushStoreFunc.h |
示例代码
xxxxxxxxxx
/// 取消置顶
/// @param itemId 商品ID
/// @param closure 操作回调
- (void)cancelToTopItem:(NSString *)itemId closure:(completeHandler)closure;