@tencentcloud/sdk-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +20 -0
  2. package/index.js +16 -0
  3. package/index.js.map +1 -0
  4. package/package.json +37 -0
  5. package/resource/doc/tuicallkit/android/.gitkeep +0 -0
  6. package/resource/doc/tuicallkit/android/api_TUICallKit.md +663 -0
  7. package/resource/doc/tuicallkit/android/api_TUICallObserver.md +786 -0
  8. package/resource/doc/tuicallkit/android/how_to_integrated_android_callkit.md +302 -0
  9. package/resource/doc/tuicallkit/faq/faq.md +1068 -0
  10. package/resource/doc/tuicallkit/flutter/api_TUICallDefine.md +932 -0
  11. package/resource/doc/tuicallkit/flutter/api_TUICallKit.md +452 -0
  12. package/resource/doc/tuicallkit/flutter/api_TUICallObserver.md +926 -0
  13. package/resource/doc/tuicallkit/flutter/how_to_integrated_flutter_callkit.md +226 -0
  14. package/resource/doc/tuicallkit/flutter/how_to_run_flutter_callkit_demo.md +101 -0
  15. package/resource/doc/tuicallkit/iOS/api_TUICallKit.md +635 -0
  16. package/resource/doc/tuicallkit/iOS/api_TUICallObserver.md +779 -0
  17. package/resource/doc/tuicallkit/iOS/how_to_integrated_iOS_callkit.md +269 -0
  18. package/resource/doc/tuicallkit/iOS/how_to_run_iOS_callkit_demo.md +98 -0
  19. package/resource/doc/tuicallkit/react/.gitkeep +0 -0
  20. package/resource/doc/tuicallkit/react/api_TUICallKit.md +1909 -0
  21. package/resource/doc/tuicallkit/react/how_to_integrated_react_callkit.md +195 -0
  22. package/resource/doc/tuicallkit/react/how_to_run_react_callkit_demo.md +93 -0
  23. package/resource/doc/tuicallkit/vue/.gitkeep +0 -0
  24. package/resource/doc/tuicallkit/vue/api_TUICallKit.md +1909 -0
  25. package/resource/doc/tuicallkit/vue/api_TUICallObserver.md +926 -0
  26. package/resource/doc/tuicallkit/vue/how_to_integrated_vue_callkit.md +415 -0
  27. package/resource/doc/tuicallkit/vue/how_to_run_vue_callkit_demo.md +93 -0
  28. package/server.js +124 -0
  29. package/server.js.map +1 -0
  30. package/streamableHttp.js +74 -0
  31. package/streamableHttp.js.map +1 -0
@@ -0,0 +1,226 @@
1
+ 本文将引导您快速地完成 TUICallKit 组件的接入工作。跟随本文档,您可以在10分钟内完成接入,并最终获得一个具备完整用户界面以及音视频通话功能的应用程序。
2
+ <table>
3
+ <tr>
4
+ <td rowspan="1" colSpan="1" >视频通话</td>
5
+
6
+ <td rowspan="1" colSpan="1" >群组通话</td>
7
+ </tr>
8
+
9
+ <tr>
10
+ <td rowspan="1" colSpan="1" >![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027182394/f5820542180c11ef9c015254002977b6.png)</td>
11
+
12
+ <td rowspan="1" colSpan="1" >![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027182394/c772c312180c11efa66f525400f65c2a.png)</td>
13
+ </tr>
14
+ </table>
15
+
16
+
17
+ ## 环境准备
18
+
19
+ Flutter 3.0 及更高版本。
20
+
21
+ ## 步骤一:开通服务
22
+
23
+ 在使用腾讯云提供的音视频服务前,您需要前往控制台,为应用开通音视频服务,获取 `SDKAppID、SDKSecretKey`,它们将在 [步骤五](https://write.woa.com/document/94733646108913664) 中使用,具体步骤请参见 [开通服务。](https://write.woa.com/document/139743928960860160)
24
+
25
+ ## 步骤二:导入 TUICallKit 组件
26
+
27
+ 在工程的根目录下,通过命令行执行以下命令安装组件 [tencent_calls_uikit](https://pub.dev/packages/tencent_calls_uikit) 插件。
28
+ ``` bash
29
+ flutter pub add tencent_calls_uikit
30
+ ```
31
+
32
+ ## 步骤三:完成工程配置
33
+
34
+
35
+
36
+ 【Android】
37
+ 1. 如果您需要编译运行在 Android 平台,由于我们在 SDK 内部使用了Java 的反射特性,需要将 SDK 中的部分类加入不混淆名单。
38
+
39
+ - 首先,需要在工程的 `android/app/build.gradle` 文件中配置并开启混淆规则:
40
+
41
+ ``` java
42
+ android {
43
+ ......
44
+ buildTypes {
45
+ release {
46
+ ......
47
+ minifyEnabled true
48
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
49
+ }
50
+ }
51
+ }
52
+ ```
53
+ - 在工程的 `android/app` 目录下创建 `proguard-rules.pro` 文件,并 `proguard-rules.pro` 文件中添加如下代码:
54
+
55
+ ``` java
56
+ -keep class com.tencent.** { *; }
57
+ ```
58
+ 2. 在工程的 `android/app/build.gradle `文件中配置开启 Multidex 支持。
59
+
60
+ ``` java
61
+ android {
62
+ ......
63
+ defaultConfig {
64
+ ......
65
+ multiDexEnabled true
66
+ }
67
+ }
68
+ ```
69
+
70
+ 【iOS】
71
+
72
+ 由于 TUICallKit 会使用 iOS 的音视频功能,您需要授权麦克风和摄像头的使用权限。
73
+
74
+ 授权操作方法:在您的 iOS 工程的 `Info.plist` 的第一级`<dict>`目录下添加以下两项,分别对应麦克风和摄像头在系统弹出授权对话框时的提示信息。
75
+ ``` java
76
+ <key>NSCameraUsageDescription</key>
77
+ <string>CallingApp需要访问您的相机权限,开启后录制的视频才会有画面</string>
78
+ <key>NSMicrophoneUsageDescription</key>
79
+ <string>CallingApp需要访问您的麦克风权限,开启后录制的视频才会有声音</string>
80
+ ```
81
+
82
+ ## 步骤四:设置 navigatorObservers
83
+
84
+ 在 Flutter 应用框架的 navigatorObservers 中添加 TUICallKit.navigatorObserver,以 MateriaApp 框架为例,代码如下:
85
+ ``` java
86
+ import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';
87
+
88
+ ......
89
+
90
+ class XXX extends StatelessWidget {
91
+ const XXX({super.key});
92
+
93
+ @override
94
+ Widget build(BuildContext context) {
95
+ return MaterialApp(
96
+ navigatorObservers: [TUICallKit.navigatorObserver],
97
+ ......
98
+ );
99
+ }
100
+ }
101
+ ```
102
+
103
+ ## 步骤五:登录 TUICallKit 组件
104
+
105
+ 使用 [login](https://write.woa.com/document/94733520019521536) 接口完成登录,具体使用可参考如下代码:
106
+ ``` java
107
+ import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';
108
+ import 'package:tencent_calls_uikit/debug/generate_test_user_sig.dart';
109
+ ......
110
+
111
+ final String userID = 'xxxxx'; // 请替换为您的UserId
112
+ final int sdkAppID = 0; // 请替换为第一步在控制台得到的SDKAppID
113
+ final String secretKey = 'xxxx'; // 请替换为第一步在控制台得到的SecretKey
114
+
115
+ void login() async {
116
+ String userSig = GenerateTestUserSig.genTestSig(userID, sdkAppID, secretKey);
117
+ TUIResult result = await TUICallKit.instance.login(sdkAppID, userID, userSig);
118
+ if (result.code.isEmpty) {
119
+ print('Login success');
120
+ } else {
121
+ print('Login failed: ${result.code} ${result.message}');
122
+ }
123
+ }
124
+ ```
125
+ <table>
126
+ <tr>
127
+ <td rowspan="1" colSpan="1" >参数</td>
128
+
129
+ <td rowspan="1" colSpan="1" >类型</td>
130
+
131
+ <td rowspan="1" colSpan="1" >说明</td>
132
+ </tr>
133
+
134
+ <tr>
135
+ <td rowspan="1" colSpan="1" >userID</td>
136
+
137
+ <td rowspan="1" colSpan="1" >String</td>
138
+
139
+ <td rowspan="1" colSpan="1" >客户根据自己的业务自定义用户 ID,只允许包含大小写英文字母(a-z A-Z)、数字(0-9)及下划线和连词符。</td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <td rowspan="1" colSpan="1" >sdkAppID</td>
144
+
145
+ <td rowspan="1" colSpan="1" >int</td>
146
+
147
+ <td rowspan="1" colSpan="1" >在 [实时音视频 TRTC 控制台](https://console.cloud.tencent.com/trtc) 创建的音视频应用的唯一标识。</td>
148
+ </tr>
149
+
150
+ <tr>
151
+ <td rowspan="1" colSpan="1" >secretKey</td>
152
+
153
+ <td rowspan="1" colSpan="1" >String</td>
154
+
155
+ <td rowspan="1" colSpan="1" >在 [实时音视频 TRTC 控制台](https://console.cloud.tencent.com/trtc) 创建的音视频应用的 SDKSecretKey。</td>
156
+ </tr>
157
+
158
+ <tr>
159
+ <td rowspan="1" colSpan="1" >userSig</td>
160
+
161
+ <td rowspan="1" colSpan="1" >String</td>
162
+
163
+ <td rowspan="1" colSpan="1" >一种安全保护签名,用于对用户进行登录鉴权认证,确认用户是否真实,阻止恶意攻击者盗用您的云服务使用权。</td>
164
+ </tr>
165
+ </table>
166
+
167
+
168
+ > **注意:**
169
+ >
170
+ > - **开发环境**:如果您正在本地开发调试阶段,可以采用本地 `GenerateTestUserSig.genTestSig`函数生成 userSig。该方法中 SDKSecretKey 很容易被反编译逆向破解,一旦您的密钥泄露,攻击者就可以盗用您的腾讯云流量。
171
+ > - **生产环境**:如果您的项目要发布上线,请采用 [服务端生成 UserSig](https://write.woa.com/document/86735811695435776) 的方式。
172
+
173
+
174
+ ## 步骤六:拨打您的第一通电话
175
+
176
+ 主叫方与被叫方登录成功后,主叫方通过调用 TUICallKit 的 calls 方法并指定通话类型和被叫方的 userId,就可以发起语音或者视频通话,被叫方此时就可接受到来电邀请。
177
+ ``` java
178
+ import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';
179
+ ......
180
+
181
+ void call() {
182
+ List<String> userIdList = ['vince'];
183
+ TUICallKit.instance.calls(userIdList, TUICallMediaType.audio);
184
+ }
185
+ ```
186
+ <table>
187
+ <tr>
188
+ <td rowspan="1" colSpan="1" >![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027182394/5bc23051ec0a11eea93552540076ba55.png)</td>
189
+
190
+ <td rowspan="1" colSpan="1" >![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027182394/585e90f5ec0a11eeb5dc525400aa857d.png)</td>
191
+ </tr>
192
+
193
+ <tr>
194
+ <td rowspan="1" colSpan="1" >主叫方</td>
195
+
196
+ <td rowspan="1" colSpan="1" >被叫方</td>
197
+ </tr>
198
+ </table>
199
+
200
+
201
+ ## 更多特性
202
+ - [界面定制](https://write.woa.com/document/119102241864011776)
203
+
204
+ - [离线推送](https://write.woa.com/document/105314040792334336)
205
+
206
+ - [群组通话](https://write.woa.com/document/139754164343910400)
207
+
208
+ - [悬浮窗](https://write.woa.com/document/139754329641431040)
209
+
210
+ - [美颜特效](https://write.woa.com/document/116004083654770688)
211
+
212
+ - [自定义铃声](https://write.woa.com/document/139754559410786304)
213
+
214
+ - [监听通话状态](https://write.woa.com/document/139754713712799744)
215
+
216
+ - [云端录制](https://write.woa.com/document/89008877934485504)
217
+
218
+
219
+ ## 常见问题
220
+
221
+ 如果您的接入和使用中遇到问题,请参见 [常见问题](https://write.woa.com/document/98788861869330432)。
222
+
223
+ ## 交流与反馈
224
+ - 如果您在使用过程中,有什么建议或者意见,可以在这里反馈:[TUICallKit 产品反馈问卷](https://wj.qq.com/s2/10622244/b9ae),感谢您的反馈。
225
+
226
+ - 如果您是开发者,也欢迎您加入我们的 TUICallKit 技术交流平台 [zhiliao](https://zhiliao.qq.com/s/cWSPGIIM62CC/cEUPGIIM62CE),进行技术交流和产品沟通。
@@ -0,0 +1,101 @@
1
+ 本文将为您介绍如何快速跑通音视频通话 Demo。跟随本文档,您可以在 10 分钟内跑通 Demo,并最终体验一个包含完备 UI 界面的音视频通话功能。
2
+ <table>
3
+ <tr>
4
+ <td rowspan="1" colSpan="1" >视频通话</td>
5
+
6
+ <td rowspan="1" colSpan="1" >群组通话</td>
7
+ </tr>
8
+
9
+ <tr>
10
+ <td rowspan="1" colSpan="1" >![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027182394/f5820542180c11ef9c015254002977b6.png)</td>
11
+
12
+ <td rowspan="1" colSpan="1" >![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027182394/c772c312180c11efa66f525400f65c2a.png)</td>
13
+ </tr>
14
+ </table>
15
+
16
+
17
+ ## 环境准备
18
+
19
+ ### Flutter
20
+
21
+ Flutter 3.0 及以上版本。
22
+
23
+ ### Android
24
+ - Android Studio 3.5及以上版本。
25
+
26
+ - Android 4.1 及以上版本的 Android 设备。
27
+
28
+
29
+ ### iOS
30
+ - Xcode 13.0及以上版本。
31
+
32
+ - 请确保您的项目已设置有效的开发者签名。
33
+
34
+
35
+ ## 步骤一 : 下载 Demo
36
+ 1. 从 github 下载 [TUICallKit Demo](https://github.com/Tencent-RTC/TUICallKit/tree/main) 源码,或者直接在命令行运行以下命令:
37
+
38
+ ``` bash
39
+ git clone
40
+ ```
41
+ 2. 通过 Android Studio 或 VSCode 打开 TUICallKit Flutter 的 example 。以下流程将以 Android Studio 为例:
42
+
43
+
44
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/756d77dd1e6c11ef91395254000a29ac.png)
45
+
46
+
47
+ ## 步骤二 : 配置 Demo
48
+ 1. [开通音视频服务](https://write.woa.com/document/139743928960860160),获取 **SDKAppID** 和 **SDKSecretKey** 。
49
+
50
+
51
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/d02a72a41e7611efbef6525400a8a0fb.png)
52
+
53
+ 2. 打开`Flutter/example/lib/debug/generate_test_user_sig.dart`文件,将[开通服务](https://write.woa.com/document/139743928960860160)时获取到的对应的 SDKAppID 和 SDKSecretKey 填入其中:
54
+
55
+
56
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/7b8599c02d3d11efb8c45254005a8b94.png)
57
+
58
+
59
+ ## 步骤三 : 跑通 Demo
60
+ 1. 在 Android Studio 右上角如下图所示处选择您要将 Demo 运行的设备:
61
+
62
+
63
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/d5369ebd2d3e11efb0275254006c0558.png)
64
+
65
+ 2. 选择完成后点击运行,将 TUICallKit Android Demo 运行到目标设备上。
66
+
67
+
68
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/f1968bcf2d3e11ef918f52540005b090.png)
69
+
70
+
71
+ ## 拨打第一个电话
72
+
73
+ > **注意:**
74
+ >
75
+
76
+ > 为了使您可以体验完整的音视频通话流程,请将 Demo 分别在两台设备上登录两个用户,一方作为主叫,一方作为被叫。
77
+ >
78
+
79
+ 1. 登录 & 注册
80
+
81
+
82
+ 请您在 `用户ID`处输入 ID 。如果您当前的 UserID 未曾被使用过,此时会进入到**注册**界面,您可以在该界面为自己设置头像及昵称。
83
+
84
+
85
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/754cb1341e6c11efbef6525400a8a0fb.png)
86
+
87
+
88
+ > **注意:**
89
+ >
90
+
91
+ > 尽量避免使您的 UserID 被设置成“1”、“123”、“111”等简单字符串,由于 TRTC 不支持同一个 UserID 多端登录,所以在多人协作开发时,形如 “1”、“123”、“111” 这样的 UserID 很容易被您的同事占用,导致登录失败,因此我们建议您在调试的时候设置一些辨识度高的 UserID。
92
+ >
93
+
94
+ 2. 拨打电话
95
+
96
+ 1. 主叫方请点击界面上的 **1V1 通话**,在弹出的界面中输入被叫方的 UserID 并选择您想要的通话类型。
97
+
98
+ 2. 单击**发起通话**。
99
+
100
+
101
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100032451803/757339531e6c11efafe1525400db4520.png)