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

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

相关推荐
Thomas_YXQ40 分钟前
Unity3D在ios平台下内存的优化详解
开发语言·macos·ios·性能优化·cocoa
zhyongrui8 小时前
SwiftUI 光晕动画性能优化:消除托盘缩放卡顿的实战方案
ios·性能优化·swiftui
TheNextByte19 小时前
如何通过 6 种方式删除 iPhone/iPad 上的文件
ios·iphone·ipad
WeiAreYoung10 小时前
uni-app Xcode制作iOS谷歌广告Google Mobile Ads SDK插件
ios·uni-app
2501_9160088911 小时前
iOS 开发助手工具,设备信息查看、运行日志、文件管理等方面
android·ios·小程序·https·uni-app·iphone·webview
编程之路从0到112 小时前
React Native新架构之iOS端初始化源码分析
react native·ios·源码剖析·新架构·初始化流程
2501_9159214312 小时前
在没有源码的前提下,怎么对 Swift 做混淆,IPA 混淆
android·开发语言·ios·小程序·uni-app·iphone·swift
00后程序员张1 天前
对比 Ipa Guard 与 Swift Shield 在 iOS 应用安全处理中的使用差异
android·开发语言·ios·小程序·uni-app·iphone·swift
00后程序员张1 天前
在 iOS 设备上同时监控 CPU、GPU 与内存的方法
android·ios·小程序·https·uni-app·iphone·webview
TheNextByte11 天前
如何从锁定的 iPhone 中恢复照片?
ios·iphone