ABCLiveKit开发手册V1.0.3(iOS)
[目录]
修订历史
版本 | 日期 | 修改者 | 变更内容 |
---|---|---|---|
1.0.3 | 2018-06-11 | Bing | 2.0.0 |
环境准备
请确保满足以下开发环境要求:
- Apple XCode 6.0 或以上版本
- iOS 9.0 或以上版本
- 此 SDK 提供了四个 framework:
1、ABCCoreKit.framework
2、ABCUIKit.framework
2、PenKit.framework
3、SocketIO.framework
添加ABCIMLib,ABCIMKit
添加ABCIMLib,ABCIMKit(使用Embedded Binaries 导入)
Pod 导入
pod 'ABCLive/ABCLiveCoreKit'
pod 'ABCLive/ABCLiveUIKit'
pod 'ABCLive/ABCLivePenKit'
由于SocketIO.framework 是swift库,请使用Embedded Binaries 导入,并在TARGETS->Build Settings ->Always Embed Swift Standard Libraries 设置为YES
快速接入直播互动
Step1 初始化SDK
token生成规则请查阅服务器文档(建议将appid和appsecret放在服务器上操作)
[[ABCLiveSDK shareABCLiveSDK] initWithToken:token];
[ABCLiveSDK shareABCLiveSDK].curUserMo = [ABCUserMo new];//设置用户id,用户nickname,用户avataUrl。用户id必须跟申请token的id一致
Step2 启动直播和互动页面
ABCInteractiveViewController *viewCtrl = [[ABCInteractiveViewController alloc] initABCInteractiveViewCtrlWithRoomMo:roomMo];
[self presentViewController:viewCtrl animated:YES completion:nil];
ABCLivingViewController *viewCtrl = [[ABCLivingViewController alloc] initABCLivingViewCtrlWithRoomMo:roomMo];
[self presentViewController:viewCtrl animated:YES completion:nil];