Skip to content

chore: update rn #1384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/document/react-native/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
6. 更改配置文件(`examples/product-uikit-demo/src/env.ts`)内容, 设置 appKey 的值,其他字段有默认值。
7. 设置推送配置文件。如果没有,可以使用模板文件保证编译运行没有问题。如果有,则使用自己的配置文件。详见 [Firebase 相关文档](https://rnfirebase.io/)。
- Android 平台拷贝命令为 `cp -f templates/google-services.json.template examples/product-uikit-demo/android/app/google-services.json`。
- iOS 平台拷贝命令为 `cp -f templates/GoogleService-Info.plist.template examples/product-uikit-demo/android/app/GoogleService-Info.plist`。
- iOS 平台拷贝命令为 `cp templates/GoogleService-Info.plist.template examples/product-uikit-demo/ios/ChatUikitFullExample/GoogleService-Info.plist`。
8. 进入目录 `examples/product-uikit-demo`, 运行 `yarn android` 或 `yarn ios` 运行 Demo。
9. 启动本地服务 `yarn run start`,默认端口 8081。
10. 在登录页面连续点击 5 次以上版本号,将切换为用户 ID 和密码登录页面(再次连续点击返回手机号和验证码登录页面)。
Expand Down Expand Up @@ -93,3 +93,7 @@ App Server 为 Demo 提供以下功能:
| 联系人模块 | 展示如何依赖 UIKit 实现联系人列表的逻辑。 |
| 聊天设置模块 | 展示 IM SDK 提供的对于群聊对成员及群组属性的操作。 |
| 设置模块 | 展示 IM SDK 对于新消息的设置及消息免打扰,群组等通用设置。 |

## 常见问题

// todo: 请看xx章节或者可以点击链接
59 changes: 59 additions & 0 deletions docs/document/react-native/qa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 常见问题

## 1. 找不到 debug.keystore 文件

需要通过 `keytool` 工具生成。例如:`keytool -genkeypair -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"`

## 2. 找不到 google-services.json 文件

可以临时使用 template 文件夹的模板进行替换,通过编译。

## 3. 找不到 GoogleService-Info.plist

可以临时使用 template 文件夹的模板进行替换,通过编译。

## 4. 本地图片路径包含特殊符号,Image 组件加载失败

可以通过修改本地路径,符合 Image 组件要求来加载。

```js
function formatLocalImagePath(path) {
if (!path) return null;

// 添加 file:// 前缀(如果没有的话)
const formattedPath = path.startsWith("file://") ? path : `file://${path}`;

// 编码特殊字符
return encodeURI(formattedPath);
}

// 使用示例
<Image
source={{
uri: formatLocalImagePath("/storage/emulated/0/.../easemob#easeim/..."),
}}
style={{ width: 200, height: 200 }}
/>;
```

路径打印:

```js
const originalPath =
"/storage/emulated/0/Android/data/com.example/easemob#easeim/file.jpg";
const formattedPath = formatLocalImagePath(originalPath);

console.log("原始路径:", originalPath); // /storage/emulated/0/Android/data/com.example/easemob#easeim/file.jpg
console.log("格式化后:", formattedPath); // file:///storage/emulated/0/Android/data/com.example/easemob%23easeim/file.jpg
```

## 5. 初始化项目之后找不到 node_modules,怎么办?

`yarn 4.x.x`: 需要设置使用本地配置 `yarn config set nodeLinker node-modules`。
`yarn 1.x.x`: 不存在该问题。

## 6. 页面提示:No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.

需要确保本地调试服务已启动:yarn run start。
如果使用模拟器,按照终端或服务提示信息操作即可。
如果使用真机,需保证手机和开发电脑处于同一局域网内。
4 changes: 2 additions & 2 deletions docs/document/react-native/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
2. 打开终端,进入需要创建项目的目录,输入命令创建 React Native 项目:

```sh
npx @react-native-community/cli@latest init --version 0.76 simple_demo
npx @react-native-community/cli@latest init --version 0.76 simple_demo # 推荐创建稳定版本示例
```

创建好的项目名称是 `simple_demo`。
Expand All @@ -64,7 +64,7 @@ yarn set version 1.22.19
yarn
```

_同时,也可以使用 npm 等其他工具_
_也可以使用 npm 等其他工具_

3. 在终端命令行,输入以下命令添加依赖:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
1. 创建项目

```sh
npx @react-native-community/cli@latest init --skip-install --version 0.76 simple_roomkit_demo
npx @react-native-community/cli@latest init --skip-install --version 0.76 simple_roomkit_demo # 推荐创建稳定版本示例
```

2. 初始化项目
Expand Down Expand Up @@ -294,3 +294,7 @@ yarn run android
| 登录 | 发送消息 |
| :--------------: | :-----: |
| <img src="/images/uikit/chatrn/room_quick_start_login.png" alt="description"> | <img src="/images/uikit/chatrn/room_quick_start_chat.png" alt="description"> |

## 常见问题

// todo: 请看xx章节或者可以点击链接
7 changes: 1 addition & 6 deletions docs/uikit/chatroomuikit/react-native/roomuikit_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,4 @@ yarn run android

## 常见问题

如遇到编译或运行问题,请参考:

1. 确保已安装所有必需的开发环境
2. 检查 appKey 是否正确配置
3. iOS 编译失败时,尝试清理项目:`cd ios && pod deintegrate && pod install`
4. Android 编译失败时,检查 Android Studio 配置和 SDK 安装情况
// todo: 请看xx章节或者可以点击链接
1 change: 0 additions & 1 deletion docs/uikit/chatuikit/react-native/chatuikit_integrated.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ react-native-create-thumbnail \
react-native-device-info \
@react-native-documents/picker \
react-native-chat-uikit \
react-native-fast-image \
react-native-file-access \
react-native-gesture-handler \
react-native-image-picker \
Expand Down
7 changes: 5 additions & 2 deletions docs/uikit/chatuikit/react-native/chatuikit_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
1. 创建项目

```sh
npx @react-native-community/cli@latest init --skip-install --version 0.76 simple_uikit_demo
npx @react-native-community/cli@latest init --skip-install --version 0.76 simple_uikit_demo # 推荐创建稳定版本示例
```

2. 初始化项目
Expand Down Expand Up @@ -54,7 +54,6 @@ react-native-create-thumbnail \
react-native-device-info \
@react-native-documents/picker \
react-native-chat-uikit \
react-native-fast-image \
react-native-file-access \
react-native-gesture-handler \
react-native-image-picker \
Expand Down Expand Up @@ -257,3 +256,7 @@ yarn run android
| 登录 | 发送消息 |
| :--------------: | :-----: |
| <img src="/images/uikit/chatuikit/rn/chatuikit_quick_start_login.png" alt="description"> | <img src="/images/uikit/chatuikit/rn/chatuikit_quick_start_chat.png" alt="description"> |

## 常见问题

// todo: 请看xx章节或者可以点击链接
7 changes: 1 addition & 6 deletions docs/uikit/chatuikit/react-native/chatuikit_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,4 @@ yarn run android

## 常见问题

如遇到编译或运行问题,可进行如下检查:

1. 确保已安装所有必需的开发环境。
2. 检查 App Key 是否正确配置。
3. iOS 编译失败时,尝试清理项目:`cd ios && pod deintegrate && pod install`。
4. Android 编译失败时,检查 Android Studio 配置和 SDK 安装情况。
// todo: 请看xx章节或者可以点击链接
7 changes: 2 additions & 5 deletions docs/uikit/chatuikit/react-native/ui_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
### 第一步 创建 RN 示例项目

```sh
npx @react-native-community/cli@latest init --skip-install --version 0.76.7 sample_app
npx @react-native-community/cli@latest init --skip-install --version 0.76 simple_demo # 推荐创建稳定版本示例
```

### 第二步 初始化项目
Expand All @@ -45,7 +45,6 @@ react-native-create-thumbnail \
react-native-device-info \
@react-native-documents/picker \
react-native-chat-uikit \
react-native-fast-image \
react-native-file-access \
react-native-gesture-handler \
react-native-image-picker \
Expand Down Expand Up @@ -213,6 +212,4 @@ yarn run android

## 常见问题

初始化项目之后找不到 node_modules,怎么办?
- `yarn 4.x.x`: 需要设置使用本地配置 `yarn config set nodeLinker node-modules`。
- `yarn 1.x.x`: 不存在该问题。
// todo: 请看xx章节或者可以点击链接