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

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

相关推荐
2501_915918412 小时前
掌握 iOS 26 App 运行状况,多工具协作下的监控策略
android·ios·小程序·https·uni-app·iphone·webview
2501_915909065 小时前
iOS 混淆实战,多工具组合完成 IPA 混淆与加固(源码 + 成品 + 运维一体化方案)
android·运维·ios·小程序·uni-app·iphone·webview
非专业程序员Ping13 小时前
新手小白也能看懂的LLDB技巧/逆向技巧
ios·assembly
QWQ___qwq14 小时前
SwiftUI 布局之美:Padding 让界面呼吸感拉满
ios·swiftui·swift
00后程序员张15 小时前
HTTPS 包 抓取与分析实战,从抓包到解密、故障定位与真机取证
网络协议·http·ios·小程序·https·uni-app·iphone
2501_9159214316 小时前
iOS混淆与IPA加固实战手记,如何构建苹果应用防反编译体系
android·macos·ios·小程序·uni-app·cocoa·iphone
用户0917 小时前
SwiftUI 键盘快捷键作用域深度解析
ios·面试·swiftui
用户0917 小时前
Xcode 26 的10个新特性解析
ios·面试·swift
RollingPin1 天前
iOS八股文之 多线程
ios·多线程·串行并行·gcd·ios面试·同步异步·nsoperation