From 3a6eca30fdf40b0facbe6ffb87cd60f9fe8a8898 Mon Sep 17 00:00:00 2001 From: chenyihao9 <286884497@qq.com> Date: Tue, 25 Nov 2025 20:05:22 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=8C=89=E7=85=A7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BF=AE=E6=94=B9react-native-webview?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-webview.md | 28 +++++++++++++++++----------- zh-cn/react-native-webview.md | 27 +++++++++++++++++---------- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/en/react-native-webview.md b/en/react-native-webview.md index 9ac97546..95f8477a 100644 --- a/en/react-native-webview.md +++ b/en/react-native-webview.md @@ -14,17 +14,17 @@ > [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-webview) -This third-party library has been migrated to Gitcode and is now available for direct download from npm, the new package name is: `@react-native-ohos/react-native-webview`, After introducing the new version of the third-party library, The version correspondence details are as follows: - -| Version | Package Name | Repository | Release | -| ------------------------------ | --------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| <= 13.10.4@deprecated | @react-native-oh-tpl/react-native-webview | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-webview) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-webview/releases) | -| > 13.10.4 | @react-native-ohos/react-native-webview | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-webview) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | - ## Installation and Usage +Please refer to the Releases page of the third-party library for the corresponding version information: -Find the matching version information in the release address of the third-party library: [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases). For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 13.10.4@deprecated | [@react-native-oh-tpl/react-native-webview Releases(deprecated)](https://github.com/react-native-oh-library/react-native-webview/releases) | 0.72 | +| 13.10.5 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.72 | +| 13.15.1 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.77 | + +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. Go to the project directory and execute the following instruction: @@ -61,11 +61,11 @@ export default function WebViewDemo() { ## Link -Version > @react-native-ohos/react-native-webview@13.10.4 now supports Autolink without requiring manual configuration, currently only supports 72 frameworks. +Version >= @react-native-ohos/react-native-webview@13.10.5 now supports Autolink without requiring manual configuration, currently only supports 72 frameworks. Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md The 0.72 branch supports full Autolinking functionality starting from the RNOH 0.72.94 version (corresponding to the @react-native-oh/react-native-harmony-cli version 0.0.40). -Currently, Version <= @react-native-oh-tpl/react-native-webview@13.10.4@deprecated does not support AutoLink. Therefore, you need to manually configure the linking. +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -239,7 +239,13 @@ Then build and run the code. To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [ @react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) +Please refer to the Releases page of the third-party library for the corresponding version information: + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 13.10.4@deprecated | [@react-native-oh-tpl/react-native-webview Releases(deprecated)](https://github.com/react-native-oh-library/react-native-webview/releases) | 0.72 | +| 13.10.5 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.72 | +| 13.15.1 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.77 | ## Properties > [!WARNING] The "ignoreSilentHardwareSwitch" needs to be set to "true" for the web page to have sound when playing. diff --git a/zh-cn/react-native-webview.md b/zh-cn/react-native-webview.md index cc09ce73..27143185 100644 --- a/zh-cn/react-native-webview.md +++ b/zh-cn/react-native-webview.md @@ -14,16 +14,17 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-webview) -该第三方库的仓库已迁移至 Gitcode,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/react-native-webview`,具体版本所属关系如下: +## 安装与使用 -| Version | Package Name | Repository | Release | -| ------------------------------ | --------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| <= 13.10.4@deprecated | @react-native-oh-tpl/react-native-webview | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-webview) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-webview/releases) | -| > 13.10.4 | @react-native-ohos/react-native-webview | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-webview) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | +请到三方库的 Releases 发布地址查看配套的版本信息: -## 安装与使用 +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 13.10.4@deprecated | [@react-native-oh-tpl/react-native-webview Releases(deprecated)](https://github.com/react-native-oh-library/react-native-webview/releases) | 0.72 | +| 13.10.5 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.72 | +| 13.15.1 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.77 | -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -60,11 +61,11 @@ export default function WebViewDemo() { ## Link -Version > @react-native-ohos/react-native-webview@13.10.4,已支持 Autolink,无需手动配置,目前只支持72框架。 +Version >= @react-native-ohos/react-native-webview@13.10.5,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md 0.72分支从RNOH 0.72.94版本(对应 @react-native-oh/react-native-harmony-cli 版本是0.0.40)开始可使用完整的 Autolinking 功能。 -Version <= @react-native-oh-tpl/react-native-webview@13.10.4@deprecated 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -241,7 +242,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[ @react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 13.10.4@deprecated | [@react-native-oh-tpl/react-native-webview Releases(deprecated)](https://github.com/react-native-oh-library/react-native-webview/releases) | 0.72 | +| 13.10.5 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.72 | +| 13.15.1 | [@react-native-ohos/react-native-webview Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-webview/releases) | 0.77 | ## 属性 > [!WARNING]ignoreSilentHardwareSwitch需要设置true网页播放才有声音 -- Gitee