Skip to content

Commit

Permalink
feat: 支持 TUICallKit (#1312)
Browse files Browse the repository at this point in the history
Co-authored-by: lindalli <lindalli@tencent.com>
  • Loading branch information
chenximo and lindalli committed Jan 30, 2023
1 parent e00ee2d commit ea5020e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
12 changes: 6 additions & 6 deletions uni-app/TUIKit-vue2-js/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions uni-app/TUIKit-vue2-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -437,18 +437,18 @@ 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: '请使用真机运行并且自定义基座调试,可能影响音视频功能~ ',
icon: 'none',
duration: 3000
});
} else {
uni.$TUICalling.call(
uni.$TUICallKit.call(
{
userID: userID,
type: value
callMediaType: value
},
res => {
console.log(JSON.stringify(res));
Expand Down
21 changes: 11 additions & 10 deletions uni-app/TUIKit-vue2-js/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "云通信IM",
"appid" : "__UNI__C42E036",
"appid" : "__UNI__6E2D796",
"description" : "基于 TIM 实现场景化接入方案",
"versionName" : "1.0.1",
"versionCode" : "100",
Expand Down Expand Up @@ -55,32 +55,33 @@
"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" : {}
}
}
}
},
"quickapp" : {},
"mp-weixin" : {
"appid": "appid",
"appid" : "appid",
"setting" : {
"urlCheck" : false,
"es6" : true,
Expand Down
8 changes: 4 additions & 4 deletions uni-app/TUIKit-vue2-js/pages/TUI-Login/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down

0 comments on commit ea5020e

Please sign in to comment.