1v1音视频通话公共接口
implementation 'io.agora.opensource:1v1-call-api:1.0.14'
- 在登录成功后或在获取到登录token后,初始化sdk
// 初始化
CallConfig callConfig = new CallConfig.Builder(
"http://www.google.com/", // host url
"68e109f0f40ca72a15e05cc22786f8e6", // token
"", // platform json data
true) // is global integration
.setDebugEnable(true) // isDebug ? output log
.setFixHeartbeatApi(true) // heartbeat v2
.build();
// module方式集成,使用该方法初始化
CallKit.initForModule(this, callConfig);
// 插件化 方式集成,使用该方法初始化
CallKit.initForRePlugin(this, callConfig);
- 国内项目集成在宿主中创建固定包名
com.juzhionline.callplugin.callapi
并在该包名下创建固定类 ICallServiceImpl.java实现ICallService接口,实现对应方法中业务逻辑。
海外项目集成在宿主中创建固定包名io.agora.opensource.callapi
并在该包名下创建固定类 ICallServiceImpl.java实现ICallService接口,实现对应方法中业务逻辑。
由于CallActivity会有最小化功能,客户端在实现ICallService接口逻辑代码中出现的宿主Activity需要指定为singleTask启动模式,且taskAffinity为 ":common"(MainActivity除外)。
- ICallService 新增 onCallActivityMinimize() 回调方法
- CallKit randomMatch() 代码逻辑修改
- ICallService exceptionHandler() -> processException()
- ICallService onCallActivityFinish方法中新增boolean cancelMatch 是否取消匹配字段
- ICallService onCallActivityFinish方法中新增roomType通话类型
- 修复CallKit createRandomMatchIntentForGlobalModule() ComponentName设置错误。
- 修复Timber打印日志重复,使用系统日志打印。
- 废弃ICallService中有关当前用户基本信息的api 方法,使用 UserInfo getCurrentUserInfo() 方法替代。
- 更改getGiftIcon(String giftId, DownloadGiftDrawableListener listener) -> getGiftIconAsyn(String giftId, DownloadGiftDrawableListener listener) 方法名。
- 废弃ICallService中 interceptVip() interceptBalance() interceptNobleStar() 业务拦截api,使用exceptionHandler(ApiException e) 方法替代。
- 新增随机匹配相关api。
- RoomType 新增 随机视频:RANDOM_VIDEO_CALL = 11 随机语音:ANDOM_VOICE_CALL = 12。
- 修复心跳响应中返回的ext对象解析问题。
- CallConfig.Builder增加setFixHeartbeatApi() api用于修复服务端根据不同渠道返回心跳数据结构不同。