mirror of
https://github.com/TencentCloud/TIMSDK.git
synced 2026-10-17 04:41:33 +08:00
Update README_ZH.md
This commit is contained in:
+23
-87
@@ -1,98 +1,34 @@
|
||||
[English](./README.md) | 简体中文
|
||||
|
||||
本文介绍如何快速跑通即时通信 IM 的体验 Demo。
|
||||
# Tencent Chat SDK — macOS
|
||||
|
||||
## 步骤1:创建应用
|
||||
1. 登录即时通信 IM [控制台](https://console.cloud.tencent.com/avc)。
|
||||
> 如果您已有应用,请记录其 SDKAppID 并 [配置应用](#step2)。
|
||||
2. 在应用管理页面,单击创建新应用,在弹出的对话框中输入应用名称,选择合适的数据中心,单击确定。
|
||||

|
||||

|
||||
3. 创建完成后,可在应用管理页面查看、搜索、管理应用。请记录 SDKAppID 信息。
|
||||

|
||||
[](https://github.com/TencentCloud/TIMSDK/stargazers)
|
||||
|
||||
## 步骤2:获取密钥信息
|
||||
macOS Core SDK,在经过大规模验证的消息基础设施之上构建专属 UI。
|
||||
|
||||
1. 在应用管理页面的操作中单击查看密钥。
|
||||

|
||||
2. 在弹出的对话框中,单击显示密钥,复制并保存密钥信息。
|
||||

|
||||
## 关于
|
||||
|
||||
> 请妥善保管密钥信息,谨防泄露。
|
||||
Tencent Chat SDK 每日承载数十亿条消息,植根于腾讯生态。接入预置 **UIKit**,10 分钟内上线完整聊天体验;或选用 **Core SDK**,在经过大规模验证的消息基础设施之上构建专属 UI。
|
||||
|
||||
## 快速开始
|
||||
|
||||
| 类型 | GitHub | 集成文档 |
|
||||
|---|---|---|
|
||||
| **macOS Core SDK**(无 UI) | [TIMSDK / Mac](https://github.com/TencentCloud/TIMSDK/tree/master/Mac/IMSDK) | [Mac SDK 集成](https://cloud.tencent.com/document/product/269/75288) |
|
||||
|
||||
|
||||
## 步骤3:下载并配置 Demo 源码
|
||||
## 快速链接
|
||||
|
||||
1. 从 [Github](https://github.com/tencentyun/TIMSDK) 克隆即时通信 IM Demo 工程。
|
||||
2. 打开所属终端目录的工程,找到对应的`GenerateTestUserSig`文件。
|
||||
<table>
|
||||
<tr>
|
||||
<th nowrap="nowrap">所属平台</th>
|
||||
<th nowrap="nowrap">文件相对路径</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td>Android/Demo/app/src/main/java/com/tencent/qcloud/tim/demo/signature/GenerateTestUserSig.java</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iOS</td>
|
||||
<td>iOS/Demo/TUIKitDemo/Debug/GenerateTestUserSig.h</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac</td>
|
||||
<td>Mac/Demo/TUIKitDemo/Debug/GenerateTestUserSig.h</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows</td>
|
||||
<td>Windows/Demo/IMApp/GenerateTestUserSig.h</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Web(通用)</td>
|
||||
<td>Web/Demo/public/GenerateTestUserSig.js</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>小程序</td>
|
||||
<td>MiniProgram/Demo/static/utils/GenerateTestUserSig.js</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
>?本文以使用 Android Studio 打开 Android 工程为例。
|
||||
>
|
||||
3. 设置`GenerateTestUserSig`文件中的相关参数:
|
||||
- SDKAPPID:请设置为 [步骤1](#step1) 中获取的实际应用 SDKAppID。
|
||||
- SECRETKEY:请设置为 [步骤2](#step2) 中获取的实际密钥信息。
|
||||

|
||||
|
||||
|
||||
>!本文提到的获取 UserSig 的方案是在客户端代码中配置 SECRETKEY,该方法中 SECRETKEY 很容易被反编译逆向破解,一旦您的密钥泄露,攻击者就可以盗用您的腾讯云流量,因此**该方法仅适合本地跑通 Demo 和功能调试**。
|
||||
>正确的 UserSig 签发方式是将 UserSig 的计算代码集成到您的服务端,并提供面向 App 的接口,在需要 UserSig 时由您的 App 向业务服务器发起请求获取动态 UserSig。更多详情请参见 [服务端生成 UserSig](https://cloud.tencent.com/document/product/269/32688#GeneratingdynamicUserSig)。
|
||||
|
||||
## 步骤4:编译运行
|
||||
1. 终端执行以下命令,检查 pod 版本。
|
||||
```
|
||||
pod --version
|
||||
```
|
||||
如果提示 pod 不存在,或则 pod 版本小于 1.7.5,请执行以下命令安装最新 pod。
|
||||
```
|
||||
//更换源
|
||||
gem sources --remove https://rubygems.org/
|
||||
gem sources --add https://gems.ruby-china.com/
|
||||
//安装 pod
|
||||
sudo gem install cocoapods -n /usr/local/bin
|
||||
//如果安装了多个 Xcode ,请使用下面的命令选择 Xcode 版本(一般选择最新的 Xcode 版本)
|
||||
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
|
||||
//更新 pod 本地库
|
||||
pod setup
|
||||
```
|
||||
2. 使用以下命令,加载 ImSDK 库。
|
||||
```
|
||||
cd Mac/TUIKitDemo
|
||||
pod install
|
||||
```
|
||||
3. 如果安装失败,运行以下命令更新本地的 CocoaPods 仓库列表
|
||||
```
|
||||
pod repo update
|
||||
```
|
||||
4. 进入 Mac/TUIKitDemo 文件夹,打开 `TUIKitDemo.xcworkspace` 编译运行。
|
||||
- 🤖 [AI 能力接入](https://trtc.io/document/72277) — 为聊天体验集成 AI 能力
|
||||
- 🎮 [在线 Demo](https://trtc.io/demo/homepage/#/detail?scene=messenger) — 在浏览器中体验 Tencent Chat SDK
|
||||
- 📡 [REST API 文档](https://trtc.io/document/34620?product=chat&menulabel=restfulapi) — 用户管理、消息收发等服务端 API
|
||||
- 🏠 [产品主页](https://trtc.io/products/chat) — 功能概览、定价及企业版特性
|
||||
- 🖥️ [控制台](https://console.trtc.io) — 管理应用及监控用量
|
||||
- 🔄 [Chat SDK V2 API 升级指南](https://docs.qq.com/sheet/DS3lMdHpoRmpWSEFW)
|
||||
|
||||
## 联系我们
|
||||
|
||||
- **Stack Overflow**:使用标签 [`trtc.io`](https://stackoverflow.com/questions/tagged/trtc.io) 提问
|
||||
- **Telegram**:[加入开发者社区](https://t.me/+EPk6TMZEZMM5OGY1)
|
||||
- **WhatsApp**:[联系我们的团队](https://chat.whatsapp.com/Gfbxk7rQBqc8Rz4pzzP27A)
|
||||
- **GitHub Issues**:[提交 Bug 或功能建议](https://github.com/TencentCloud/TIMSDK/issues)
|
||||
|
||||
Reference in New Issue
Block a user