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];

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

相关推荐
Haha_bj21 小时前
Swift UI 状态管理
ios·app
2501_916007471 天前
iOS 应用性能测试的工程化流程,构建从指标采集到问题归因的多工具协同测试体系
android·ios·小程序·https·uni-app·iphone·webview
源码_V_saaskw1 天前
JAVA国际版同城跑腿源码快递代取帮买帮送同城服务源码支持Android+IOS+H5
android·java·ios·微信小程序
tbit1 天前
fluwx 拉起小程序WXLog:Error:fail to load Keychain status:-25300, keyData null:1
flutter·ios·微信小程序
Sheffi1 天前
iOS 内存管理深度解析:从原理到实践
ios
QuantumLeap丶1 天前
《Flutter全栈开发实战指南:从零到高级》- 19 -手势识别
flutter·ios·前端框架
00后程序员张1 天前
iOS 抓不到包怎么办?从 HTTPS 解密、QUIC 排查到 TCP 数据流分析的完整解决方案
android·tcp/ip·ios·小程序·https·uni-app·iphone
Haha_bj1 天前
Swift UI数据存储
ios
Zender Han2 天前
Flutter 新版 Google Sign-In 插件完整解析(含示例讲解)
android·flutter·ios·web
Digitally2 天前
如何在iPhone上共享日历
ios·iphone