mirror of
https://github.com/TencentCloud/TIMSDK.git
synced 2026-10-17 04:41:33 +08:00
feat: 支持 TUICallKit (#1312)
Co-authored-by: lindalli <lindalli@tencent.com>
This commit is contained in:
@@ -35,10 +35,10 @@
|
||||
uni.$aegis = aegis
|
||||
// 首先需要通过 uni.requireNativePlugin("ModuleName") 获取 module
|
||||
// #ifdef APP-PLUS
|
||||
const TUICalling = uni.requireNativePlugin('TUICallingUniPlugin-TUICallingModule');
|
||||
logger.log(`| app | TUICallingUniPlugin-TUICallingModule | TUICalling: ${TUICalling}`);
|
||||
if(typeof(TUICalling) == 'undefined') {
|
||||
logger.error('如果需要音视频功能,请集成原生插件,使用真机运行并且自定义基座调试哦~ 插件地址:https://ext.dcloud.net.cn/plugin?id=7097 , 调试地址:https://nativesupport.dcloud.net.cn/NativePlugin/use/use');
|
||||
const TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit');
|
||||
logger.log(`| app | TencentCloud-TUICallKit | TUICalling: ${TUICallKit}`);
|
||||
if(typeof(TUICallKit) == 'undefined') {
|
||||
logger.error('如果需要音视频功能,请集成原生插件,使用真机运行并且自定义基座调试哦~ 插件地址:https://ext.dcloud.net.cn/plugin?id=9035 , 调试地址:https://nativesupport.dcloud.net.cn/NativePlugin/use/use');
|
||||
}
|
||||
// #endif
|
||||
export default {
|
||||
@@ -67,9 +67,9 @@
|
||||
// #endif
|
||||
// 将原生插件挂载在 uni 上
|
||||
// #ifdef APP-PLUS
|
||||
uni.$TUICalling = TUICalling;
|
||||
uni.$TUICallKit = TUICallKit;
|
||||
// #endif
|
||||
// 如果您已创建了 tim,请将 tim 实例挂载在 wx 上,且不可以修改 wx.$TIM(修改变量可能导致 TUICalling 组件无法正常使用), 完成 TUICalling 初始化,
|
||||
// 如果您已创建了 tim,请将 tim 实例挂载在 wx 上,且不可以修改 wx.$TIM(修改变量可能导致 TUICallKit 组件无法正常使用), 完成 TUICallKit 初始化,
|
||||
// 如果您没有创建,可以不传
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.$TIM = uni.$TUIKit;
|
||||
|
||||
@@ -79,8 +79,8 @@ uni.$TUIKit.login({userID: 'your userID', userSig: 'your userSig'})
|
||||
```
|
||||
|
||||
## 开启音视频通话
|
||||
- 打包 App 集成,请参见原生音视频插件接入 [原生音视频插件](https://ext.dcloud.net.cn/plugin?id=7097)。
|
||||
- 打包小程序集成 ,请参见小程序音视频插件接入 [腾讯云小程序音视频插件](https://ext.dcloud.net.cn/plugin?id=7151)。
|
||||
- 打包到 APP 请参考官网文档: [音视频通话(uniapp-客户端)](https://cloud.tencent.com/document/product/269/83857)
|
||||
- 打包到小程序请参考官网文档:[音视频通话(uniapp-小程序)](https://cloud.tencent.com/document/product/269/83858)
|
||||
|
||||
## 常见问题
|
||||
[](id:Q1)
|
||||
|
||||
@@ -97,7 +97,7 @@ import TUIEmoji from '../message-elements/emoji/index';
|
||||
import TUICommonWords from '../message-private/common-words/index';
|
||||
import TUIOrderList from '../message-private/order-list/index';
|
||||
import TUIServiceEvaluation from '../message-private/service-evaluation/index';
|
||||
|
||||
import logger from '../../../utils/logger';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -437,7 +437,7 @@ export default {
|
||||
const { userID } = this.conversation.userProfile;
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
if(typeof(uni.$TUICalling) === 'undefined') {
|
||||
if(typeof(uni.$TUICallKit) === 'undefined') {
|
||||
logger.error('请使用真机运行并且自定义基座调试,可能影响音视频功能~ 插件地址:https://ext.dcloud.net.cn/plugin?id=7097 , 调试地址:https://nativesupport.dcloud.net.cn/NativePlugin/use/use');
|
||||
uni.showToast({
|
||||
title: '请使用真机运行并且自定义基座调试,可能影响音视频功能~ ',
|
||||
@@ -445,10 +445,10 @@ export default {
|
||||
duration: 3000
|
||||
});
|
||||
} else {
|
||||
uni.$TUICalling.call(
|
||||
uni.$TUICallKit.call(
|
||||
{
|
||||
userID: userID,
|
||||
type: value
|
||||
callMediaType: value
|
||||
},
|
||||
res => {
|
||||
console.log(JSON.stringify(res));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "云通信IM",
|
||||
"appid" : "__UNI__C42E036",
|
||||
"appid" : "__UNI__6E2D796",
|
||||
"description" : "基于 TIM 实现场景化接入方案",
|
||||
"versionName" : "1.0.1",
|
||||
"versionCode" : "100",
|
||||
@@ -55,24 +55,25 @@
|
||||
"NSPhotoLibraryAddUsageDescription" : "app 想访问你的相册",
|
||||
"NSCameraUsageDescription" : "app 想访问你的摄像头",
|
||||
"NSMicrophoneUsageDescription" : "app 想访问你的麦克风"
|
||||
}
|
||||
},
|
||||
"dSYMs" : false
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"ad" : {}
|
||||
}
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"TUICallingUniPlugin-TUICallingModule" : {
|
||||
"TencentCloud-TUICallKit" : {
|
||||
"__plugin_info__" : {
|
||||
"name" : "【官方】腾讯云原生音视频插件",
|
||||
"description" : "TUICalling 是 腾讯云官方推出 的基于腾讯云实时音视频 TRTC 和即时通信 IM 服务组合而成的插件,支持双人和多人音视频通话。插件提供了全套定制UI,开发者仅需三个 API 就可实现",
|
||||
"name" : "【官方】腾讯云音视频通话插件TencentCloud-TUICallKit",
|
||||
"description" : "TUICallKit 是腾讯云官方推出的音视频通话插件,支持 1v1 通话和群组通话,并提供“类微信\"的 UI 交互,开发者仅需三个 API 就可实现。",
|
||||
"platforms" : "Android,iOS",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=7097",
|
||||
"android_package_name" : "",
|
||||
"ios_bundle_id" : "",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=9035",
|
||||
"android_package_name" : "com.tencent.tuikit.demo.xa",
|
||||
"ios_bundle_id" : "com.tencent.tuikit.demo.xa",
|
||||
"isCloud" : true,
|
||||
"bought" : 1,
|
||||
"pid" : "7097",
|
||||
"pid" : "9035",
|
||||
"parameters" : {}
|
||||
}
|
||||
}
|
||||
@@ -80,7 +81,7 @@
|
||||
},
|
||||
"quickapp" : {},
|
||||
"mp-weixin" : {
|
||||
"appid": "appid",
|
||||
"appid" : "appid",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"es6" : true,
|
||||
|
||||
@@ -193,17 +193,17 @@ export default {
|
||||
|
||||
// 登录原生插件
|
||||
// #ifdef APP-PLUS
|
||||
if(typeof(uni.$TUICalling) == 'undefined') {
|
||||
if(typeof(uni.$TUICallKit) == 'undefined') {
|
||||
uni.showToast({
|
||||
title: '如果需要音视频功能,请集成插件使用真机运行并且自定义基座调试哦~',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
logger.error('请使用真机运行并且自定义基座调试,否则影响音视频功能~ 插件地址:https://ext.dcloud.net.cn/plugin?id=7097 , 调试地址:https://nativesupport.dcloud.net.cn/NativePlugin/use/use');
|
||||
logger.error('请使用真机运行并且自定义基座调试,否则影响音视频功能~ 插件地址:https://ext.dcloud.net.cn/plugin?id=9035 , 调试地址:https://nativesupport.dcloud.net.cn/NativePlugin/use/use');
|
||||
} else {
|
||||
uni.$TUICalling.login(
|
||||
uni.$TUICallKit.login(
|
||||
{
|
||||
sdkAppID: SDKAppID,
|
||||
SDKAppID: SDKAppID,
|
||||
userID: userID,
|
||||
userSig: userSig
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user