iOS 集成网易云信的音视频呼叫组件

云信官方文档在这

前提是集成了云信IM,并且已经IM登录成功,如果没有集成IM的看这里:iOS 集成网易云信IM-CSDN博客

1、CocoPods集成

objectivec 复制代码
#云信
pod 'NIMSDK_LITE', '10.8.0'
  
pod 'NERtcSDK', '5.6.50'#rtc基础SDK
pod 'NEChatUIKit'
  
#呼叫组件API组件
pod 'NERtcCallKit', '~> 3.5.0'
#呼叫组件UI组件
pod 'NERtcCallUIKit', '3.5.0'

//如果你集成了SDWebImage和MJRefresh,则需要固定这两个的版本为:
#pod 'SDWebImage', '5.15.4'
#pod 'MJRefresh', '3.7.5'

2、AppDelegate.m添加头文件

objectivec 复制代码
#import <NERtcCallUIKit/NERtcCallUIKit.h>

3、初始化

objectivec 复制代码
NESetupConfig *setupConfig = [[NESetupConfig alloc] initWithAppkey:@"6f6568e354026d2d658a7bf5a75cbeac"];
NECallUIKitConfig *config = [[NECallUIKitConfig alloc] init];
config.config = setupConfig;
config.appKey =  @"6f6568e354026d2d658a7bf5a75cbeac";
config.uiConfig.language = NECallUILanguageZhHans;
[[NECallEngine sharedInstance] setTimeout:30];
[[NERtcCallUIKit sharedInstance] setupWithConfig:config];

4、视频通话

objectivec 复制代码
//#import <NERtcCallUIKit/NERtcCallUIKit.h>

NEUICallParam *callParam = [[NEUICallParam alloc] init];
callParam.remoteUserAccid = @"remoteUserAccid";
callParam.remoteShowName = @"remoteShowName";
callParam.remoteAvatar = @"remoteAvatar";
callParam.channelName = @"";
callParam.remoteDefaultImage = [UIImage imageNamed:@"user_head"];
callParam.muteDefaultImage = [UIImage imageNamed:@"user_head"];
callParam.extra = @"";
callParam.callType = NECallTypeVideo;
[[NERtcCallUIKit sharedInstance] callWithParam:callParam];

结语:至此,网易云信音视频组件集成完成!不懂的可回复,看到了就回!

相关推荐
疯狂的程序猴13 小时前
iOS 多技术栈混淆实现,跨平台 App 混淆拆解与组合
后端·ios
2501_9160088917 小时前
iOS开发者工具有哪些?Xcode、Fastlane 与 kxapp 的组合使用
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
Digitally20 小时前
如何备份和恢复 iPhone:避免数据丢失(5 种方法)
ios·iphone
黑马源码库miui520861 天前
JAVA国际版同城上门服务上门送水桶装水配送源码同城上门配送系统源码支持Android+IOS+H5
android·java·ios
2501_915921431 天前
iPhone 定位功能测试时不越狱来修改手机位置的方法
android·ios·智能手机·小程序·uni-app·iphone·webview
spencer_tseng1 天前
HTML5 - Android - IOS
android·ios·html·html5
90后的晨仔1 天前
深入剖析 SDAnimatedImageView:如何优雅地在 iOS 中实现高性能动态图渲染
ios
游戏开发爱好者81 天前
iOS 开发进阶,用 SniffMaster 实现 iPhone 抓包深度分析
android·ios·小程序·https·uni-app·iphone·webview
开心就好20252 天前
本地执行 IPA 混淆 无需上传致云端且不修改工程的方案
后端·ios
报错小能手2 天前
ios开发方向——对于实习开发的app(Robopocket)讲解
开发语言·学习·ios·swift