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

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

相关推荐
不爱记笔记3 小时前
苹果WWDC 2026全解析:Apple Intelligence+ 性能提升数据一览
macos·ios·wwdc
00后程序员张7 小时前
Jenkins 自动上传 IPA 到 App Store 把发布步骤融入 CI/CD
android·ios·小程序·https·uni-app·iphone·webview
小小程序员mono7 小时前
WWDC 2026 之后,M5 桌面 Mac 上市时间预测
macos·ios·wwdc
人月神话-Lee10 小时前
WWDC26 深度解析:如何在 iOS 27 中打造“秒开”的相机体验
ios·swift·相机·wwdc·用户体验
zhaocarbon11 小时前
OC HTTP SSE客户端
http·ios·objective-c
2501_9159090611 小时前
iOS IPA文件反编译与打包操作方法详解
android·ios·小程序·https·uni-app·iphone·webview
卡卡西Sensei11 小时前
2026 苹果 WWDC 完整总结
macos·ios·wwdc
健了个平_241 天前
iOS 27 适配笔记
ios·xcode·wwdc
Tr2e1 天前
🐱 从 0 到 1:用 Swift 手搓一个 macOS 桌面宠物(附源码)
macos·ios·swift