From e401510594763495d35e9e18819ded0816d91af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=A9=B7?= Date: Fri, 29 Aug 2025 18:06:19 +0800 Subject: [PATCH 1/9] =?UTF-8?q?docs:=20[Issues:#ICVHYY]=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=860.77=206=E4=B8=AA=E4=B8=89=E6=96=B9=E5=BA=93=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邱婷 --- zh-cn/react-native-QRCode.md | 26 ++++++++-- ...eact-native-async-storage-async-storage.md | 47 +++++++++++++++++- zh-cn/react-native-community-netinfo.md | 46 ++++++++++++++++- zh-cn/react-native-image-picker.md | 49 ++++++++++++++++++- zh-cn/react-native-network-info.md | 42 +++++++++++++--- zh-cn/react-native-orientation.md | 41 ++++++++++++++-- 6 files changed, 231 insertions(+), 20 deletions(-) diff --git a/zh-cn/react-native-QRCode.md b/zh-cn/react-native-QRCode.md index 818b6da97..dbbbcee9e 100644 --- a/zh-cn/react-native-QRCode.md +++ b/zh-cn/react-native-QRCode.md @@ -17,7 +17,14 @@ ## 安装与使用 -1、请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-qrcode](https://github.com/react-native-oh-library/react-native-qrcode/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ----------- | ------------------------------------------------------------ | ---------- | +| 0.2.7 | [@react-native-oh-tpl/react-native-qrcode Releases](https://github.com/react-native-oh-library/react-native-qrcode/releases) | 0.72 | +| 0.2.7 | @react-native-ohos/react-native-qrcode Releases | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](https://gitee.com/react-native-oh-library/usage-docs/blob/000c9a56a4c5ed4e8bcc5c8a849ee18bba92a374/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -26,13 +33,19 @@ #### **npm** ```bash +# V0.2.7 0.72 npm install @react-native-oh-tpl/react-native-qrcode +# V0.2.7 0.77 +npm install @react-native-ohos/react-native-qrcode ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-qrcode +# V0.2.7 0.72 +yarn install @react-native-oh-tpl/react-native-qrcode +# V0.2.7 0.77 +yarn install @react-native-ohos/react-native-qrcode ``` @@ -110,12 +123,17 @@ const styles = StyleSheet.create({ 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-qrcode](https://github.com/react-native-oh-library/react-native-qrcode/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.2.7 | [@react-native-oh-tpl/react-native-qrcode Releases](https://github.com/react-native-oh-library/react-native-qrcode/releases) | 0.72 | +| 0.2.7 | @react-native-ohos/react-native-qrcode Releases | 0.77 | ## 属性 > [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 - + > [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 ### QRCode diff --git a/zh-cn/react-native-async-storage-async-storage.md b/zh-cn/react-native-async-storage-async-storage.md index 11572d4b8..eccc86876 100644 --- a/zh-cn/react-native-async-storage-async-storage.md +++ b/zh-cn/react-native-async-storage-async-storage.md @@ -17,7 +17,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/async-storage Releases](https://github.com/react-native-oh-library/async-storage/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.21.0 | [@react-native-oh-tpl/async-storage Releases](https://github.com/react-native-oh-library/async-storage/releases) | 0.72 | +| 2.2.0 | [@react-native-ohos/async-storage Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -26,13 +33,21 @@ #### **npm** ```bash +# V1.21.0 npm install @react-native-oh-tpl/async-storage + +# V2.2.0 +npm install @react-native-ohos/async-storage ``` #### **yarn** ```bash +# V1.21.0 yarn add @react-native-oh-tpl/async-storage + +# V2.2.0 +yarn add @react-native-ohos/async-storage ``` @@ -137,6 +152,8 @@ export default function App() { 打开 `entry/oh-package.json5`,添加以下依赖 +- V1.21.0 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -145,6 +162,16 @@ export default function App() { } ``` +- V2.2.0 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + + "@react-native-ohos/async-storage": "file:../../node_modules/@react-native-ohos/async-storage/harmony/async_storage.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -180,7 +207,13 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) + +# V1.21.0 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/async-storage/src/main/cpp" ./async-storage) + +# V2.2.0 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/async-storage/src/main/cpp" ./async-storage) + # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -221,8 +254,13 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... + +# V1.21.0 + import {AsyncStoragePackage} from '@react-native-oh-tpl/async-storage/ts'; +# V2.2.0 ++ import {AsyncStoragePackage} from '@react-native-ohos/async-storage/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -249,7 +287,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/async-storage Releases](https://github.com/react-native-oh-library/async-storage/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.21.0 | [@react-native-oh-tpl/async-storage Releases](https://github.com/react-native-oh-library/async-storage/releases) | 0.72 | +| 2.2.0 | [@react-native-ohos/async-storage Releases]() | 0.77 | ## API diff --git a/zh-cn/react-native-community-netinfo.md b/zh-cn/react-native-community-netinfo.md index 733bc4120..5234a48a1 100644 --- a/zh-cn/react-native-community-netinfo.md +++ b/zh-cn/react-native-community-netinfo.md @@ -16,7 +16,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/netinfo Releases](https://github.com/react-native-oh-library/react-native-netinfo/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 11.1.0 | [@react-native-oh-tpl/netinfo Releases](https://github.com/react-native-oh-library/react-native-netinfo/releases) | 0.72 | +| 11.4.1 | [@react-native-ohos/netinfo Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +32,21 @@ #### **npm** ```bash +# V11.1.0 npm install @react-native-oh-tpl/netinfo + +# V11.4.1 +npm install @react-native-ohos/netinfo ``` #### **yarn** ```bash +# V11.1.0 yarn add @react-native-oh-tpl/netinfo + +# V11.4.1 +yarn add @react-native-ohos/netinfo ``` @@ -101,6 +116,8 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 +- V11.1.0 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -108,6 +125,15 @@ export default App; } ``` +- V11.4.1 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/netinfo": "file:../../node_modules/@react-native-ohos/netinfo/harmony/netinfo.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -143,7 +169,13 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) + +# V11.1.0 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/netinfo/src/main/cpp" ./netinfo) + +# V11.4.1 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/netinfo/src/main/cpp" ./netinfo) + # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -186,8 +218,13 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... + +# V11.1.0 + import {NetInfoPackage} from '@react-native-oh-tpl/netinfo/ts'; +# V11.4.1 ++ import {NetInfoPackage} from '@react-native-ohos/netinfo/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -215,7 +252,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/netinfo Releases](https://github.com/react-native-oh-library/react-native-netinfo/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 11.1.0 | [@react-native-oh-tpl/netinfo Releases](https://github.com/react-native-oh-library/react-native-netinfo/releases) | 0.72 | +| 11.4.1 | [@react-native-ohos/netinfo Releases]() | 0.77 | ## 属性 diff --git a/zh-cn/react-native-image-picker.md b/zh-cn/react-native-image-picker.md index cb295b9ca..39c012ba9 100644 --- a/zh-cn/react-native-image-picker.md +++ b/zh-cn/react-native-image-picker.md @@ -16,7 +16,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-image-picker Releases](https://github.com/react-native-oh-library/react-native-image-picker/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 7.0.3 | [@react-native-oh-tpl/react-native-image-picker Releases](https://github.com/react-native-oh-library/react-native-image-picker/releases) | 0.72 | +| 8.2.1 | [@react-native-ohos/react-native-image-picker Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +32,21 @@ #### **npm** ```bash +# V7.0.3 npm install @react-native-oh-tpl/react-native-image-picker + +# V8.2.1 +npm install @react-native-ohos/react-native-image-picker ``` #### **yarn** ```bash +# V7.0.3 yarn add @react-native-oh-tpl/react-native-image-picker + +# V8.2.1 +yarn add @react-native-ohos/react-native-image-picker ``` @@ -103,6 +118,8 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 +- V7.0.3 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -111,6 +128,16 @@ export default App; } ``` +- V8.2.1 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + + "@react-native-ohos/react-native-image-picker": "file:../../node_modules/@react-native-ohos/react-native-image-picker/harmony/image_picker.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -146,7 +173,13 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) + +# V7.0.3 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-image-picker/src/main/cpp" ./image_picker) + +# V8.2.1 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-picker/src/main/cpp" ./image_picker) + # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -189,8 +222,13 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... + +# V7.0.3 + import { ImagePickerViewPackage } from '@react-native-oh-tpl/react-native-image-picker/ts'; +# V8.2.1 ++ import { ImagePickerViewPackage } from '@react-native-ohos/react-native-image-picker/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -218,7 +256,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-image-picker Releases](https://github.com/react-native-oh-library/react-native-image-picker/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 7.0.3 | [@react-native-oh-tpl/react-native-image-picker Releases](https://github.com/react-native-oh-library/react-native-image-picker/releases) | 0.72 | +| 8.2.1 | [@react-native-ohos/react-native-image-picker Releases]() | 0.77 | ## 属性 @@ -231,11 +274,13 @@ ohpm install | Name | Description | Type | Required | Platform | HarmonyOS Support | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | --------------- | ----------------- | | mediaType | photo or video or mixed(launchCamera on Android does not support 'mixed'). Web only supports 'photo' for now. | string | yes | iOS Android Web | yes | +| restrictMimeTypes | Array containing the mime-types allowed to be picked. Default is empty (everything). | string | no | Android | yes | | maxWidth | To resize the image. | number | no | iOS Android | no | | maxHeight | To resize the image. | number | no | iOS Android | no | | videoQuality | low, medium, or high on iOS, low or high on Android. | string | no | iOS Android | no | | durationLimit | Video max duration (in seconds). | number | no | iOS Android | no | | quality | 0 to 1, photos. | number | no | iOS Android | no | +| conversionQuality | For conversion from HEIC/HEIF to JPEG, 0 to 1. Default is `0.92` (everything). | number | no | Android | no | | cameraType | 'back' or 'front' (May not be supported in few android devices). | string | no | iOS Android | yes | | includeBase64 | If true, creates base64 string of the image (Avoid using on large image files due to performance). | boolean | no | iOS Android Web | yes | | includeExtra | If true, will include extra data which requires library permissions to be requested (i.e. exif data). | boolean | no | iOS Android | no | diff --git a/zh-cn/react-native-network-info.md b/zh-cn/react-native-network-info.md index 307b4d8e0..6d34bddea 100644 --- a/zh-cn/react-native-network-info.md +++ b/zh-cn/react-native-network-info.md @@ -18,7 +18,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-network-info Releases](https://github.com/react-native-oh-library/react-native-network-info/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 5.2.1 | [@react-native-oh-tpl/react-native-network-info Releases](https://github.com/react-native-oh-library/react-native-network-info/releases) | 0.72 | +| 5.2.1 | @react-native-ohos/react-native-network-info Releases | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -27,13 +34,19 @@ #### **npm** ```bash +# V5.2.1 0.72 npm install @react-native-oh-tpl/react-native-network-info +# V5.2.1 0.77 +npm install @react-native-ohos/react-native-network-info ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-network-info +# V5.2.1 0.72 +yarn install @react-native-oh-tpl/react-native-network-info +# V5.2.1 0.77 +yarn install @react-native-ohos/react-native-network-info ``` @@ -185,6 +198,8 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 +* V5.2.1 0.72 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -192,6 +207,15 @@ const styles = StyleSheet.create({ } ``` +* V5.2.1 0.77 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-network-info": "file:../../node_modules/@react-native-ohos/react-native-network-info/harmony/rn_network_info.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -211,9 +235,10 @@ ohpm install ```diff ... - -+ import { RNNetworkInfoPackage } from '@react-native-oh-tpl/react-native-network-info/ts'; - + # V5.2.1 0.72 ++ import { RNNetworkInfoPackage } from '@react-native-oh-tpl/react-native-network-infoo/ts'; + # V5.2.1 0.77 ++ import { RNNetworkInfoPackage } from '@react-native-ohos/react-native-network-info/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -241,7 +266,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-network-info Releases](https://github.com/react-native-oh-library/react-native-network-info/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 5.2.1 | [@react-native-oh-tpl/react-native-network-info Releases](https://github.com/react-native-oh-library/react-native-network-info/releases) | 0.72 | +| 5.2.1 | @react-native-ohos/react-native-network-info Releases | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-orientation.md b/zh-cn/react-native-orientation.md index 8862a51a5..eccccc216 100644 --- a/zh-cn/react-native-orientation.md +++ b/zh-cn/react-native-orientation.md @@ -16,23 +16,35 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: -进入到工程目录并输入以下命令: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 3.1.3 | [@react-native-oh-tpl/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) | 0.72 | +| 3.1.3 | @react-native-ohos/react-native-webview Releases | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](https://gitee.com/react-native-oh-library/usage-docs/blob/000c9a56a4c5ed4e8bcc5c8a849ee18bba92a374/zh-cn/tgz-usage.md)安装tgz包。 +进入到工程目录并输入以下命令: #### npm ```bash +# V3.1.3 0.72 npm install @react-native-oh-tpl/react-native-orientation +# V3.1.3 0.77 +npm install @react-native-ohos/react-native-orientation ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-orientation +# V3.1.3 0.72 +yarn install @react-native-oh-tpl/react-native-orientation +# V3.1.3 0.77 +yarn install @react-native-ohos/react-native-orientation ``` @@ -206,6 +218,8 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 +* V3.1.3 0.72 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -213,6 +227,17 @@ const styles = StyleSheet.create({ } ``` +* V3.1.3 0.77 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-orientation": "file:../../node_modules/@react-native-ohos/react-native-orientation/harmony/rn_orientation.har", + } +``` + + + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -239,7 +264,10 @@ ohpm install --no-link ```diff ... + # V3.1.3 0.72 + import { RNOrientationPackage } from '@react-native-oh-tpl/react-native-orientation/ts'; + # V3.1.3 0.77 ++ import { RNOrientationPackage } from '@react-native-ohos/react-native-orientation/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -268,7 +296,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 3.1.3 | [@react-native-oh-tpl/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) | 0.72 | +| 3.1.3 | @react-native-ohos/react-native-webview Releases | 0.77 | ## API -- Gitee From 65b24def3300013076162e71507ae29c3e9b1a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=A9=B7?= Date: Mon, 1 Sep 2025 09:11:25 +0800 Subject: [PATCH 2/9] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9react-native-orien?= =?UTF-8?q?tation.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邱婷 --- zh-cn/react-native-orientation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-cn/react-native-orientation.md b/zh-cn/react-native-orientation.md index eccccc216..a20f38812 100644 --- a/zh-cn/react-native-orientation.md +++ b/zh-cn/react-native-orientation.md @@ -21,9 +21,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 3.1.3 | [@react-native-oh-tpl/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) | 0.72 | -| 3.1.3 | @react-native-ohos/react-native-webview Releases | 0.77 | +| 3.1.3 | @react-native-ohos/react-native-orientation Releases | 0.77 | -对于未发布到npm的旧版本,请参考[安装指南](https://gitee.com/react-native-oh-library/usage-docs/blob/000c9a56a4c5ed4e8bcc5c8a849ee18bba92a374/zh-cn/tgz-usage.md)安装tgz包。 +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: -- Gitee From 6a672b4a335bb97603dcbed66ed1213c03de0ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=A9=B7?= Date: Mon, 1 Sep 2025 10:48:52 +0800 Subject: [PATCH 3/9] =?UTF-8?q?docs:=20[Issues:#ICVHYY]=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=860.77=20react-native-community-progress-bar-android?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邱婷 --- ...t-native-community-progress-bar-android.md | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/zh-cn/react-native-community-progress-bar-android.md b/zh-cn/react-native-community-progress-bar-android.md index a1d4543fd..68948134d 100644 --- a/zh-cn/react-native-community-progress-bar-android.md +++ b/zh-cn/react-native-community-progress-bar-android.md @@ -16,7 +16,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/progress-bar-android Releases](https://github.com/react-native-oh-library/progress-bar-android/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.0.4 | [@react-native-oh-tpl/progress-bar-android Releases](https://github.com/react-native-oh-library/progress-bar-android/releases) | 0.72 | +| 1.0.5 | @react-native-ohos/progress-bar-android Releases | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +32,19 @@ #### **yarn** ```bash +# V1.0.4 yarn add @react-native-oh-tpl/progress-bar-android +# V1.0.5 +yarn add @react-native-ohos/progress-bar-android ``` #### **npm** ```bash +# V1.0.4 npm install @react-native-oh-tpl/progress-bar-android +# V1.0.5 +npm install @react-native-ohos/progress-bar-android ``` @@ -84,11 +97,21 @@ export default function ProgressBarExample() { 打开 `entry/oh-package.json5`,添加以下依赖 +* V1.0.4 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-oh-tpl/progress-bar-android": "file:../../node_modules/@react-native-oh-tpl/progress-bar-android/harmony/progress_bar_android.har" + } +``` + +* V1.0.5 - "@react-native-oh-tpl/progress-bar-android": "file:../../node_modules/@react-native-oh-tpl/progress-bar-android/harmony/progress_bar_android.har" +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/progress-bar-android": "file:../../node_modules/@react-native-ohos/progress-bar-android/harmony/progress_bar_android.har" } ``` @@ -128,7 +151,10 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) +# V1.0.4 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/progress-bar-android/src/main/cpp" ./progress-bar-android) +# V1.0.5 ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/progress-bar-android/src/main/cpp" ./progress-bar-android) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -171,8 +197,10 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... +# V1.0.4 + import { ProgressBarAndroid, PROGRESS_BAR_TYPE } from "@react-native-oh-tpl/progress-bar-android" - +# V1.0.5 ++ import { ProgressBarAndroid, PROGRESS_BAR_TYPE } from "@react-native-ohos/progress-bar-android" @Builder export function buildCustomRNComponent(ctx: ComponentBuilderContext) { ... @@ -220,7 +248,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/progress-bar-android Releases](https://github.com/react-native-oh-library/progress-bar-android/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.0.4 | [@react-native-oh-tpl/progress-bar-android Releases](https://github.com/react-native-oh-library/progress-bar-android/releases) | 0.72 | +| 1.0.5 | @react-native-ohos/progress-bar-android Releases | 0.77 | ## 属性 -- Gitee From d26817a41ce75654b548fd67027b8c0e1fc6b5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=A9=B7?= Date: Mon, 1 Sep 2025 17:37:27 +0800 Subject: [PATCH 4/9] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9react-native-orien?= =?UTF-8?q?tation.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邱婷 --- zh-cn/react-native-orientation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/react-native-orientation.md b/zh-cn/react-native-orientation.md index a20f38812..ae428287c 100644 --- a/zh-cn/react-native-orientation.md +++ b/zh-cn/react-native-orientation.md @@ -301,7 +301,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 3.1.3 | [@react-native-oh-tpl/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) | 0.72 | -| 3.1.3 | @react-native-ohos/react-native-webview Releases | 0.77 | +| 3.1.3 | @react-native-ohos/react-native-orientation Releases | 0.77 | ## API -- Gitee From 06a5efe41e485a43a640d828fbe711432f54743d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=A9=B7?= Date: Thu, 4 Sep 2025 11:07:00 +0800 Subject: [PATCH 5/9] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9react-native-orien?= =?UTF-8?q?tation.md=E4=BB=A5=E5=8F=8A=20react-native-network-info.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邱婷 --- zh-cn/react-native-network-info.md | 55 ++++++++++++++++++++++++++-- zh-cn/react-native-orientation.md | 57 ++++++++++++++++++++++++++++-- 2 files changed, 107 insertions(+), 5 deletions(-) diff --git a/zh-cn/react-native-network-info.md b/zh-cn/react-native-network-info.md index 6d34bddea..c5b33b6ff 100644 --- a/zh-cn/react-native-network-info.md +++ b/zh-cn/react-native-network-info.md @@ -229,7 +229,58 @@ ohpm install > [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) -### 3.在 ArkTs 侧引入 RNNetworkInfoPackage +### 3.配置 CMakeLists 和引入 RNOrientationPackage + +> [!TIP] 版本 `5.2.1 0.77` 及以上需要 + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-network-info/src/main/cpp" ./rn_network_info) +# RNOH_END: manual_package_linking_1 + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) + +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_network_info) +# RNOH_END: manual_package_linking_2 +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +```diff +#include "RNOH/PackageProvider.h" +#include "SamplePackage.h" ++ #include "NetworkInfoPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 4.在 ArkTs 侧引入 RNNetworkInfoPackage 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: @@ -247,7 +298,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 +### 5.运行 点击右上角的 `sync` 按钮 diff --git a/zh-cn/react-native-orientation.md b/zh-cn/react-native-orientation.md index ae428287c..a06142a35 100644 --- a/zh-cn/react-native-orientation.md +++ b/zh-cn/react-native-orientation.md @@ -195,7 +195,7 @@ const styles = StyleSheet.create({ 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` -### 在工程根目录的 `oh-package.json5` 添加 overrides字段 +### 1.在工程根目录的 `oh-package.json5` 添加 overrides字段 ```json { @@ -258,7 +258,58 @@ cd entry ohpm install --no-link ``` -### 3.在 ArkTs 侧引入 RNOrientationPackage +### 3.配置 CMakeLists 和引入 RNOrientationPackage + +> [!TIP] 版本 `3.1.3 0.77` 及以上需要 + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-orientation/src/main/cpp" ./rn_orientation) +# RNOH_END: manual_package_linking_1 + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) + +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_orientation) +# RNOH_END: manual_package_linking_2 +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +```diff +#include "RNOH/PackageProvider.h" +#include "SamplePackage.h" ++ #include "RNOritentionPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 4.在 ArkTs 侧引入 RNOrientationPackage 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: @@ -277,7 +328,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 +### 5.运行 点击右上角的 `sync` 按钮 -- Gitee From d75c676b3f8ca4bcee054bd0c2f532d9a0bc226b Mon Sep 17 00:00:00 2001 From: qiuting Date: Fri, 5 Sep 2025 09:08:53 +0800 Subject: [PATCH 6/9] =?UTF-8?q?docs:=20[Issues:#ICVHYY]=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=860.77=203=E4=B8=AA=E4=B8=89=E6=96=B9=E5=BA=93=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qiuting --- zh-cn/react-native-exit-app.md | 83 +++++++++++++++++++++++-- zh-cn/react-native-mlkit-ocr.md | 40 ++++++++++-- zh-cn/react-native-randombytes.md | 100 ++++++++++++++++++++++++++++-- 3 files changed, 209 insertions(+), 14 deletions(-) diff --git a/zh-cn/react-native-exit-app.md b/zh-cn/react-native-exit-app.md index e9627566e..7102bcfa0 100644 --- a/zh-cn/react-native-exit-app.md +++ b/zh-cn/react-native-exit-app.md @@ -17,7 +17,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) 。 + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.0.0 | [@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) | 0.72 | +| 2.0.0 | @react-native-ohos/react-native-exit-app Releases Releases | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +32,19 @@ #### **npm** ```bash +# V2.0.0 0.72 npm install @react-native-oh-tpl/react-native-exit-app +# V2.0.0 0.77 +npm install @react-native-ohos/react-native-exit-app ``` #### **yarn** ```bash +# V2.0.0 0.72 yarn add @react-native-oh-tpl/react-native-exit-app +# V2.0.0 0.77 +yarn add @react-native-ohos/react-native-exit-app ``` @@ -110,6 +123,8 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 +* V2.0.0 0.72 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -117,6 +132,15 @@ export default App; } ``` +* V2.0.0 0.77 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-exit-app": "file:../../node_modules/@react-native-ohos/react-native-exit-app/harmony/exit_app.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -130,14 +154,58 @@ ohpm install > [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) -### 3.在 ArkTs 侧引入 ExitAppPackage +### 3.配置 CMakeLists 和引入 RNMlkitOcrPackage + +[!TIP] 版本 `2.0.0 0.77` 及以上需要 + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-exit-app/src/main/cpp" ./exit_app) +# RNOH_END: manual_package_linking_1 + +file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_exit_app) +# RNOH_END: manual_package_linking_2 +``` + +### 4.在 ArkTs 侧引入 ExitAppPackage 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff ... - + # V2.0.0 0.72 + import { ExitAppPackage } from '@react-native-oh-tpl/react-native-exit-app/ts'; + # V2.0.0 0.77 ++ import { ExitAppPackage } from '@react-native-ohos/react-native-exit-app/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -147,7 +215,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 +### 5.运行 点击右上角的 `sync` 按钮 @@ -166,7 +234,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.0.0 | [@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) | 0.72 | +| 2.0.0 | @react-native-ohos/react-native-exit-app Releases Releases | 0.77 | ## 静态方法 diff --git a/zh-cn/react-native-mlkit-ocr.md b/zh-cn/react-native-mlkit-ocr.md index 5bdecace7..7fd155704 100644 --- a/zh-cn/react-native-mlkit-ocr.md +++ b/zh-cn/react-native-mlkit-ocr.md @@ -16,7 +16,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.3.0 | [@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases) | 0.72 | +| 0.3.0 | @react-native-ohos/react-native-mlkit-ocr Releases | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +32,19 @@ #### **npm** ```bash +# V0.3.0 0.72 npm install @react-native-oh-tpl/react-native-mlkit-ocr +# V0.3.0 0.77 +npm install @react-native-ohos/react-native-mlkit-ocr ``` #### **yarn** ```bash +# V0.3.0 0.72 yarn add @react-native-oh-tpl/react-native-mlkit-ocr +# V0.3.0 0.77 +yarn add @react-native-ohos/react-native-mlkit-ocr ``` @@ -166,14 +179,24 @@ export const OcrTest = () => { 打开 `entry/oh-package.json5`,添加以下依赖 +* V0.3.0 0.72 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-mlkit-ocr": "file:../../node_modules/@react-native-oh-tpl/react-native-mlkit-ocr/harmony/rn_mlkit_ocr.har" } ``` +* V0.3.0 0.77 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-mlkit-ocr": "file:../../node_modules/@react-native-ohos/react-native-mlkit-ocr/harmony/rn_mlkit_ocr.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -209,7 +232,10 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) +# V0.3.0 0.72 + add_subdirectory("${OH_MODULE_DIR}/@react-native-oh-tpl/react-native-mlkit-ocr/src/main/cpp" ./rn_mlkit_ocr) +# V0.3.0 0.77 ++ add_subdirectory("${OH_MODULE_DIR}/@react-native-ohos/react-native-mlkit-ocr/src/main/cpp" ./rn_mlkit_ocr) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -249,7 +275,10 @@ std::vector> PackageProvider::getPackages(Package::Cont 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff +# 0.3.0 0.72 + import { RNMlkitOcrPackage } from '@react-native-oh-tpl/react-native-mlkit-ocr/ts'; +# 0.3.0 0.77 ++ import { RNMlkitOcrPackage } from '@react-native-ohos/react-native-mlkit-ocr/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -303,9 +332,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases) - +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.3.0 | [@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases) | 0.72 | +| 0.3.0 | @react-native-ohos/react-native-mlkit-ocr Releases | 0.77 | ## API diff --git a/zh-cn/react-native-randombytes.md b/zh-cn/react-native-randombytes.md index 5fa1ecbfc..064d126ea 100644 --- a/zh-cn/react-native-randombytes.md +++ b/zh-cn/react-native-randombytes.md @@ -19,24 +19,35 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: -进入到工程目录并输入以下命令: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 3.6.1 | [@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) | 0.72 | +| 3.6.2 | @react-native-ohos/react-native-randombytes Releases | 0.77 | +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +进入到工程目录并输入以下命令: #### npm ```bash +V3.6.1 npm install @react-native-oh-tpl/react-native-randombytes +V3.6.2 +npm install @react-native-ohos/react-native-randombytes ``` #### yarn ```bash +V3.6.1 yarn add @react-native-oh-tpl/react-native-randombytes +V3.6.2 +yarn add @react-native-ohos/react-native-randombytes ``` @@ -135,6 +146,8 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 +* V3.6.1 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -142,6 +155,15 @@ const styles = StyleSheet.create({ } ``` +* V3.6.2 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-randombytes": "file:../../node_modules/@react-native-ohos/react-native-randombytes/harmony/random_bytes.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -155,13 +177,75 @@ ohpm install > [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) -### 3.在 ArkTs 侧引入 RandomBytesPackage +### 3.配置 CMakeLists 和引入 RNMlkitOcrPackage + +> [!TIP] 版本 `3.6.2 0.77` 及以上需要 + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-randombytes/src/main/cpp" ./random_bytes) +# RNOH_END: manual_package_linking_1 + +file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_random_bytes) +# RNOH_END: manual_package_linking_2 +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +```diff +#include "RNOH/PackageProvider.h" +#include "SamplePackage.h" ++ #include "RandomBytesNativePackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), ++ std::make_shared(ctx) + }; +} +``` + +### 4.在 ArkTs 侧引入 RandomBytesPackage 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff ... + # V3.6.1 + import { RandomBytesPackage } from '@react-native-oh-tpl/react-native-randombytes/ts'; + # V3.6.2 ++ import { RandomBytesPackage } from '@react-native-ohos/react-native-randombytes/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -171,7 +255,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 +### 5.运行 点击右上角的 `sync` 按钮 @@ -190,9 +274,15 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 3.6.1 | [@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) | 0.72 | +| 3.6.2 | @react-native-ohos/react-native-randombytes Releases | 0.77 | 本文档内容基于以下版本验证通过: + 1. RNOH: 0.72.20-CAPI; SDK: HarmonyOS NEXT Developer Beta1; IDE: DevEco Studio 5.0.3.200; ROM: 3.0.0.18; ## API -- Gitee From 330e22fed0cb46508628faccd89ef488e0580eb7 Mon Sep 17 00:00:00 2001 From: qiuting Date: Tue, 9 Sep 2025 10:05:48 +0800 Subject: [PATCH 7/9] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qiuting --- zh-cn/react-native-QRCode.md | 12 +++++----- ...eact-native-async-storage-async-storage.md | 14 +++++------ zh-cn/react-native-community-netinfo.md | 14 +++++------ ...t-native-community-progress-bar-android.md | 14 +++++------ zh-cn/react-native-exit-app.md | 22 ++++++++--------- zh-cn/react-native-image-picker.md | 14 +++++------ zh-cn/react-native-mlkit-ocr.md | 24 +++++++++---------- zh-cn/react-native-network-info.md | 22 ++++++++--------- zh-cn/react-native-orientation.md | 22 ++++++++--------- zh-cn/react-native-randombytes.md | 14 +++++------ 10 files changed, 86 insertions(+), 86 deletions(-) diff --git a/zh-cn/react-native-QRCode.md b/zh-cn/react-native-QRCode.md index dbbbcee9e..db198cb50 100644 --- a/zh-cn/react-native-QRCode.md +++ b/zh-cn/react-native-QRCode.md @@ -22,7 +22,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ----------- | ------------------------------------------------------------ | ---------- | | 0.2.7 | [@react-native-oh-tpl/react-native-qrcode Releases](https://github.com/react-native-oh-library/react-native-qrcode/releases) | 0.72 | -| 0.2.7 | @react-native-ohos/react-native-qrcode Releases | 0.77 | +| 0.2.8 | @react-native-ohos/react-native-qrcode Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](https://gitee.com/react-native-oh-library/usage-docs/blob/000c9a56a4c5ed4e8bcc5c8a849ee18bba92a374/zh-cn/tgz-usage.md)安装tgz包。 @@ -33,18 +33,18 @@ #### **npm** ```bash -# V0.2.7 0.72 +# V0.2.7 npm install @react-native-oh-tpl/react-native-qrcode -# V0.2.7 0.77 +# V0.2.8 npm install @react-native-ohos/react-native-qrcode ``` #### **yarn** ```bash -# V0.2.7 0.72 +# V0.2.7 yarn install @react-native-oh-tpl/react-native-qrcode -# V0.2.7 0.77 +# V0.2.8 yarn install @react-native-ohos/react-native-qrcode ``` @@ -128,7 +128,7 @@ const styles = StyleSheet.create({ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 0.2.7 | [@react-native-oh-tpl/react-native-qrcode Releases](https://github.com/react-native-oh-library/react-native-qrcode/releases) | 0.72 | -| 0.2.7 | @react-native-ohos/react-native-qrcode Releases | 0.77 | +| 0.2.8 | @react-native-ohos/react-native-qrcode Releases | 0.77 | ## 属性 diff --git a/zh-cn/react-native-async-storage-async-storage.md b/zh-cn/react-native-async-storage-async-storage.md index eccc86876..609445990 100644 --- a/zh-cn/react-native-async-storage-async-storage.md +++ b/zh-cn/react-native-async-storage-async-storage.md @@ -22,7 +22,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 1.21.0 | [@react-native-oh-tpl/async-storage Releases](https://github.com/react-native-oh-library/async-storage/releases) | 0.72 | -| 2.2.0 | [@react-native-ohos/async-storage Releases]() | 0.77 | +| 2.2.1 | [@react-native-ohos/async-storage Releases]() | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -36,7 +36,7 @@ # V1.21.0 npm install @react-native-oh-tpl/async-storage -# V2.2.0 +# V2.2.1 npm install @react-native-ohos/async-storage ``` @@ -46,7 +46,7 @@ npm install @react-native-ohos/async-storage # V1.21.0 yarn add @react-native-oh-tpl/async-storage -# V2.2.0 +# V2.2.1 yarn add @react-native-ohos/async-storage ``` @@ -162,7 +162,7 @@ export default function App() { } ``` -- V2.2.0 +- V2.2.1 ```json "dependencies": { @@ -211,7 +211,7 @@ add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) # V1.21.0 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/async-storage/src/main/cpp" ./async-storage) -# V2.2.0 +# V2.2.1 + add_subdirectory("${OH_MODULES}/@react-native-ohos/async-storage/src/main/cpp" ./async-storage) # RNOH_END: manual_package_linking_1 @@ -258,7 +258,7 @@ std::vector> PackageProvider::getPackages(Package::Cont # V1.21.0 + import {AsyncStoragePackage} from '@react-native-oh-tpl/async-storage/ts'; -# V2.2.0 +# V2.2.1 + import {AsyncStoragePackage} from '@react-native-ohos/async-storage/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -292,7 +292,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 1.21.0 | [@react-native-oh-tpl/async-storage Releases](https://github.com/react-native-oh-library/async-storage/releases) | 0.72 | -| 2.2.0 | [@react-native-ohos/async-storage Releases]() | 0.77 | +| 2.2.1 | [@react-native-ohos/async-storage Releases]() | 0.77 | ## API diff --git a/zh-cn/react-native-community-netinfo.md b/zh-cn/react-native-community-netinfo.md index 5234a48a1..8002c7cdc 100644 --- a/zh-cn/react-native-community-netinfo.md +++ b/zh-cn/react-native-community-netinfo.md @@ -21,7 +21,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 11.1.0 | [@react-native-oh-tpl/netinfo Releases](https://github.com/react-native-oh-library/react-native-netinfo/releases) | 0.72 | -| 11.4.1 | [@react-native-ohos/netinfo Releases]() | 0.77 | +| 11.4.2 | [@react-native-ohos/netinfo Releases]() | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -35,7 +35,7 @@ # V11.1.0 npm install @react-native-oh-tpl/netinfo -# V11.4.1 +# V11.4.2 npm install @react-native-ohos/netinfo ``` @@ -45,7 +45,7 @@ npm install @react-native-ohos/netinfo # V11.1.0 yarn add @react-native-oh-tpl/netinfo -# V11.4.1 +# V11.4.2 yarn add @react-native-ohos/netinfo ``` @@ -125,7 +125,7 @@ export default App; } ``` -- V11.4.1 +- V11.4.2 ```json "dependencies": { @@ -173,7 +173,7 @@ add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) # V11.1.0 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/netinfo/src/main/cpp" ./netinfo) -# V11.4.1 +# V11.4.2 + add_subdirectory("${OH_MODULES}/@react-native-ohos/netinfo/src/main/cpp" ./netinfo) # RNOH_END: manual_package_linking_1 @@ -222,7 +222,7 @@ std::vector> PackageProvider::getPackages(Package::Cont # V11.1.0 + import {NetInfoPackage} from '@react-native-oh-tpl/netinfo/ts'; -# V11.4.1 +# V11.4.2 + import {NetInfoPackage} from '@react-native-ohos/netinfo/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -257,7 +257,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 11.1.0 | [@react-native-oh-tpl/netinfo Releases](https://github.com/react-native-oh-library/react-native-netinfo/releases) | 0.72 | -| 11.4.1 | [@react-native-ohos/netinfo Releases]() | 0.77 | +| 11.4.2 | [@react-native-ohos/netinfo Releases]() | 0.77 | ## 属性 diff --git a/zh-cn/react-native-community-progress-bar-android.md b/zh-cn/react-native-community-progress-bar-android.md index 68948134d..ef8818615 100644 --- a/zh-cn/react-native-community-progress-bar-android.md +++ b/zh-cn/react-native-community-progress-bar-android.md @@ -21,7 +21,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 1.0.4 | [@react-native-oh-tpl/progress-bar-android Releases](https://github.com/react-native-oh-library/progress-bar-android/releases) | 0.72 | -| 1.0.5 | @react-native-ohos/progress-bar-android Releases | 0.77 | +| 1.0.6 | @react-native-ohos/progress-bar-android Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -34,7 +34,7 @@ ```bash # V1.0.4 yarn add @react-native-oh-tpl/progress-bar-android -# V1.0.5 +# V1.0.6 yarn add @react-native-ohos/progress-bar-android ``` @@ -43,7 +43,7 @@ yarn add @react-native-ohos/progress-bar-android ```bash # V1.0.4 npm install @react-native-oh-tpl/progress-bar-android -# V1.0.5 +# V1.0.6 npm install @react-native-ohos/progress-bar-android ``` @@ -106,7 +106,7 @@ export default function ProgressBarExample() { } ``` -* V1.0.5 +* V1.0.6 ```json "dependencies": { @@ -153,7 +153,7 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) # V1.0.4 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/progress-bar-android/src/main/cpp" ./progress-bar-android) -# V1.0.5 +# V1.0.6 + add_subdirectory("${OH_MODULES}/@react-native-ohos/progress-bar-android/src/main/cpp" ./progress-bar-android) # RNOH_END: manual_package_linking_1 @@ -199,7 +199,7 @@ std::vector> PackageProvider::getPackages(Package::Cont ... # V1.0.4 + import { ProgressBarAndroid, PROGRESS_BAR_TYPE } from "@react-native-oh-tpl/progress-bar-android" -# V1.0.5 +# V1.0.6 + import { ProgressBarAndroid, PROGRESS_BAR_TYPE } from "@react-native-ohos/progress-bar-android" @Builder export function buildCustomRNComponent(ctx: ComponentBuilderContext) { @@ -253,7 +253,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 1.0.4 | [@react-native-oh-tpl/progress-bar-android Releases](https://github.com/react-native-oh-library/progress-bar-android/releases) | 0.72 | -| 1.0.5 | @react-native-ohos/progress-bar-android Releases | 0.77 | +| 1.0.6 | @react-native-ohos/progress-bar-android Releases | 0.77 | ## 属性 diff --git a/zh-cn/react-native-exit-app.md b/zh-cn/react-native-exit-app.md index 7102bcfa0..0c6f342bf 100644 --- a/zh-cn/react-native-exit-app.md +++ b/zh-cn/react-native-exit-app.md @@ -22,7 +22,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 2.0.0 | [@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) | 0.72 | -| 2.0.0 | @react-native-ohos/react-native-exit-app Releases Releases | 0.77 | +| 2.0.1 | @react-native-ohos/react-native-exit-app Releases Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -32,18 +32,18 @@ #### **npm** ```bash -# V2.0.0 0.72 +# V2.0.0 npm install @react-native-oh-tpl/react-native-exit-app -# V2.0.0 0.77 +# V2.0.1 npm install @react-native-ohos/react-native-exit-app ``` #### **yarn** ```bash -# V2.0.0 0.72 +# V2.0.0 yarn add @react-native-oh-tpl/react-native-exit-app -# V2.0.0 0.77 +# V2.0.1 yarn add @react-native-ohos/react-native-exit-app ``` @@ -123,7 +123,7 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 -* V2.0.0 0.72 +* V2.0.0 ```json "dependencies": { @@ -132,7 +132,7 @@ export default App; } ``` -* V2.0.0 0.77 +* V2.0.1 ```json "dependencies": { @@ -156,7 +156,7 @@ ohpm install ### 3.配置 CMakeLists 和引入 RNMlkitOcrPackage -[!TIP] 版本 `2.0.0 0.77` 及以上需要 +[!TIP] 版本 `2.0.1 ` 及以上需要 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -202,9 +202,9 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ```diff ... - # V2.0.0 0.72 + # V2.0.0 + import { ExitAppPackage } from '@react-native-oh-tpl/react-native-exit-app/ts'; - # V2.0.0 0.77 + # V2.0.1 + import { ExitAppPackage } from '@react-native-ohos/react-native-exit-app/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -239,7 +239,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 2.0.0 | [@react-native-oh-tpl/react-native-exit-app Releases](https://github.com/react-native-oh-library/react-native-exit-app/releases) | 0.72 | -| 2.0.0 | @react-native-ohos/react-native-exit-app Releases Releases | 0.77 | +| 2.0.1 | @react-native-ohos/react-native-exit-app Releases Releases | 0.77 | ## 静态方法 diff --git a/zh-cn/react-native-image-picker.md b/zh-cn/react-native-image-picker.md index 39c012ba9..38c94739f 100644 --- a/zh-cn/react-native-image-picker.md +++ b/zh-cn/react-native-image-picker.md @@ -21,7 +21,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 7.0.3 | [@react-native-oh-tpl/react-native-image-picker Releases](https://github.com/react-native-oh-library/react-native-image-picker/releases) | 0.72 | -| 8.2.1 | [@react-native-ohos/react-native-image-picker Releases]() | 0.77 | +| 8.2.2 | [@react-native-ohos/react-native-image-picker Releases]() | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -35,7 +35,7 @@ # V7.0.3 npm install @react-native-oh-tpl/react-native-image-picker -# V8.2.1 +# V8.2.2 npm install @react-native-ohos/react-native-image-picker ``` @@ -45,7 +45,7 @@ npm install @react-native-ohos/react-native-image-picker # V7.0.3 yarn add @react-native-oh-tpl/react-native-image-picker -# V8.2.1 +# V8.2.2 yarn add @react-native-ohos/react-native-image-picker ``` @@ -128,7 +128,7 @@ export default App; } ``` -- V8.2.1 +- V8.2.2 ```json "dependencies": { @@ -177,7 +177,7 @@ add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) # V7.0.3 + add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-image-picker/src/main/cpp" ./image_picker) -# V8.2.1 +# V8.2.2 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-picker/src/main/cpp" ./image_picker) # RNOH_END: manual_package_linking_1 @@ -226,7 +226,7 @@ std::vector> PackageProvider::getPackages(Package::Cont # V7.0.3 + import { ImagePickerViewPackage } from '@react-native-oh-tpl/react-native-image-picker/ts'; -# V8.2.1 +# V8.2.2 + import { ImagePickerViewPackage } from '@react-native-ohos/react-native-image-picker/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -261,7 +261,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 7.0.3 | [@react-native-oh-tpl/react-native-image-picker Releases](https://github.com/react-native-oh-library/react-native-image-picker/releases) | 0.72 | -| 8.2.1 | [@react-native-ohos/react-native-image-picker Releases]() | 0.77 | +| 8.2.2 | [@react-native-ohos/react-native-image-picker Releases]() | 0.77 | ## 属性 diff --git a/zh-cn/react-native-mlkit-ocr.md b/zh-cn/react-native-mlkit-ocr.md index 7fd155704..15490bfd6 100644 --- a/zh-cn/react-native-mlkit-ocr.md +++ b/zh-cn/react-native-mlkit-ocr.md @@ -21,7 +21,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 0.3.0 | [@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases) | 0.72 | -| 0.3.0 | @react-native-ohos/react-native-mlkit-ocr Releases | 0.77 | +| 0.3.1 | @react-native-ohos/react-native-mlkit-ocr Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -32,18 +32,18 @@ #### **npm** ```bash -# V0.3.0 0.72 +# V0.3.0 npm install @react-native-oh-tpl/react-native-mlkit-ocr -# V0.3.0 0.77 +# V0.3.1 npm install @react-native-ohos/react-native-mlkit-ocr ``` #### **yarn** ```bash -# V0.3.0 0.72 +# V0.3.0 yarn add @react-native-oh-tpl/react-native-mlkit-ocr -# V0.3.0 0.77 +# V0.3.1 yarn add @react-native-ohos/react-native-mlkit-ocr ``` @@ -179,7 +179,7 @@ export const OcrTest = () => { 打开 `entry/oh-package.json5`,添加以下依赖 -* V0.3.0 0.72 +* V0.3.0 ```json "dependencies": { @@ -188,7 +188,7 @@ export const OcrTest = () => { } ``` -* V0.3.0 0.77 +* V0.3.1 ```json "dependencies": { @@ -232,9 +232,9 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# V0.3.0 0.72 +# V0.3.0 + add_subdirectory("${OH_MODULE_DIR}/@react-native-oh-tpl/react-native-mlkit-ocr/src/main/cpp" ./rn_mlkit_ocr) -# V0.3.0 0.77 +# V0.3.1 + add_subdirectory("${OH_MODULE_DIR}/@react-native-ohos/react-native-mlkit-ocr/src/main/cpp" ./rn_mlkit_ocr) # RNOH_END: manual_package_linking_1 @@ -275,9 +275,9 @@ std::vector> PackageProvider::getPackages(Package::Cont 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff -# 0.3.0 0.72 +# 0.3.0 + import { RNMlkitOcrPackage } from '@react-native-oh-tpl/react-native-mlkit-ocr/ts'; -# 0.3.0 0.77 +# 0.3.1 + import { RNMlkitOcrPackage } from '@react-native-ohos/react-native-mlkit-ocr/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -337,7 +337,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 0.3.0 | [@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases) | 0.72 | -| 0.3.0 | @react-native-ohos/react-native-mlkit-ocr Releases | 0.77 | +| 0.3.1 | @react-native-ohos/react-native-mlkit-ocr Releases | 0.77 | ## API diff --git a/zh-cn/react-native-network-info.md b/zh-cn/react-native-network-info.md index c5b33b6ff..f2b89165e 100644 --- a/zh-cn/react-native-network-info.md +++ b/zh-cn/react-native-network-info.md @@ -23,7 +23,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 5.2.1 | [@react-native-oh-tpl/react-native-network-info Releases](https://github.com/react-native-oh-library/react-native-network-info/releases) | 0.72 | -| 5.2.1 | @react-native-ohos/react-native-network-info Releases | 0.77 | +| 5.2.2 | @react-native-ohos/react-native-network-info Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -34,18 +34,18 @@ #### **npm** ```bash -# V5.2.1 0.72 +# V5.2.1 npm install @react-native-oh-tpl/react-native-network-info -# V5.2.1 0.77 +# V5.2.2 npm install @react-native-ohos/react-native-network-info ``` #### **yarn** ```bash -# V5.2.1 0.72 +# V5.2.1 yarn install @react-native-oh-tpl/react-native-network-info -# V5.2.1 0.77 +# V5.2.2 yarn install @react-native-ohos/react-native-network-info ``` @@ -198,7 +198,7 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 -* V5.2.1 0.72 +* V5.2.1 ```json "dependencies": { @@ -207,7 +207,7 @@ const styles = StyleSheet.create({ } ``` -* V5.2.1 0.77 +* V5.2.2 ```json "dependencies": { @@ -231,7 +231,7 @@ ohpm install ### 3.配置 CMakeLists 和引入 RNOrientationPackage -> [!TIP] 版本 `5.2.1 0.77` 及以上需要 +> [!TIP] 版本 `5.2.2` 及以上需要 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -286,9 +286,9 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... - # V5.2.1 0.72 + # V5.2.1 + import { RNNetworkInfoPackage } from '@react-native-oh-tpl/react-native-network-infoo/ts'; - # V5.2.1 0.77 + # V5.2.2 + import { RNNetworkInfoPackage } from '@react-native-ohos/react-native-network-info/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -322,7 +322,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 5.2.1 | [@react-native-oh-tpl/react-native-network-info Releases](https://github.com/react-native-oh-library/react-native-network-info/releases) | 0.72 | -| 5.2.1 | @react-native-ohos/react-native-network-info Releases | 0.77 | +| 5.2.2 | @react-native-ohos/react-native-network-info Releases | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-orientation.md b/zh-cn/react-native-orientation.md index a06142a35..6a29080bd 100644 --- a/zh-cn/react-native-orientation.md +++ b/zh-cn/react-native-orientation.md @@ -21,7 +21,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 3.1.3 | [@react-native-oh-tpl/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) | 0.72 | -| 3.1.3 | @react-native-ohos/react-native-orientation Releases | 0.77 | +| 3.1.4 | @react-native-ohos/react-native-orientation Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -32,18 +32,18 @@ #### npm ```bash -# V3.1.3 0.72 +# V3.1.3 npm install @react-native-oh-tpl/react-native-orientation -# V3.1.3 0.77 +# V3.1.4 npm install @react-native-ohos/react-native-orientation ``` #### yarn ```bash -# V3.1.3 0.72 +# V3.1.3 yarn install @react-native-oh-tpl/react-native-orientation -# V3.1.3 0.77 +# V3.1.4 yarn install @react-native-ohos/react-native-orientation ``` @@ -218,7 +218,7 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 -* V3.1.3 0.72 +* V3.1.3 ```json "dependencies": { @@ -227,7 +227,7 @@ const styles = StyleSheet.create({ } ``` -* V3.1.3 0.77 +* V3.1.4 ```json "dependencies": { @@ -260,7 +260,7 @@ ohpm install --no-link ### 3.配置 CMakeLists 和引入 RNOrientationPackage -> [!TIP] 版本 `3.1.3 0.77` 及以上需要 +> [!TIP] 版本 `3.1.4` 及以上需要 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -315,9 +315,9 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... - # V3.1.3 0.72 + # V3.1.3 + import { RNOrientationPackage } from '@react-native-oh-tpl/react-native-orientation/ts'; - # V3.1.3 0.77 + # V3.1.4 + import { RNOrientationPackage } from '@react-native-ohos/react-native-orientation/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -352,7 +352,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 3.1.3 | [@react-native-oh-tpl/react-native-orientation Releases](https://github.com/react-native-oh-library/react-native-orientation/releases) | 0.72 | -| 3.1.3 | @react-native-ohos/react-native-orientation Releases | 0.77 | +| 3.1.4 | @react-native-ohos/react-native-orientation Releases | 0.77 | ## API diff --git a/zh-cn/react-native-randombytes.md b/zh-cn/react-native-randombytes.md index 064d126ea..575ba4d76 100644 --- a/zh-cn/react-native-randombytes.md +++ b/zh-cn/react-native-randombytes.md @@ -24,7 +24,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 3.6.1 | [@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) | 0.72 | -| 3.6.2 | @react-native-ohos/react-native-randombytes Releases | 0.77 | +| 3.6.3 | @react-native-ohos/react-native-randombytes Releases | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -37,7 +37,7 @@ ```bash V3.6.1 npm install @react-native-oh-tpl/react-native-randombytes -V3.6.2 +V3.6.3 npm install @react-native-ohos/react-native-randombytes ``` @@ -46,7 +46,7 @@ npm install @react-native-ohos/react-native-randombytes ```bash V3.6.1 yarn add @react-native-oh-tpl/react-native-randombytes -V3.6.2 +V3.6.3 yarn add @react-native-ohos/react-native-randombytes ``` @@ -155,7 +155,7 @@ const styles = StyleSheet.create({ } ``` -* V3.6.2 +* V3.6.3 ```json "dependencies": { @@ -179,7 +179,7 @@ ohpm install ### 3.配置 CMakeLists 和引入 RNMlkitOcrPackage -> [!TIP] 版本 `3.6.2 0.77` 及以上需要 +> [!TIP] 版本 `3.6.3` 及以上需要 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -244,7 +244,7 @@ std::vector> PackageProvider::getPackages(Package::Cont ... # V3.6.1 + import { RandomBytesPackage } from '@react-native-oh-tpl/react-native-randombytes/ts'; - # V3.6.2 + # V3.6.3 + import { RandomBytesPackage } from '@react-native-ohos/react-native-randombytes/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -279,7 +279,7 @@ ohpm install | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | 3.6.1 | [@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) | 0.72 | -| 3.6.2 | @react-native-ohos/react-native-randombytes Releases | 0.77 | +| 3.6.3 | @react-native-ohos/react-native-randombytes Releases | 0.77 | 本文档内容基于以下版本验证通过: -- Gitee From 39c875b24aa600208c45230fc4f00de3cbffbd74 Mon Sep 17 00:00:00 2001 From: qiuting Date: Fri, 12 Sep 2025 09:43:56 +0800 Subject: [PATCH 8/9] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9react-native-image?= =?UTF-8?q?-picker.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qiuting --- zh-cn/react-native-image-picker.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zh-cn/react-native-image-picker.md b/zh-cn/react-native-image-picker.md index 38c94739f..154d0e4a0 100644 --- a/zh-cn/react-native-image-picker.md +++ b/zh-cn/react-native-image-picker.md @@ -274,13 +274,13 @@ ohpm install | Name | Description | Type | Required | Platform | HarmonyOS Support | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | --------------- | ----------------- | | mediaType | photo or video or mixed(launchCamera on Android does not support 'mixed'). Web only supports 'photo' for now. | string | yes | iOS Android Web | yes | -| restrictMimeTypes | Array containing the mime-types allowed to be picked. Default is empty (everything). | string | no | Android | yes | +| restrictMimeTypes8.2.2+ | Array containing the mime-types allowed to be picked. Default is empty (everything). | string | no | Android | yes | | maxWidth | To resize the image. | number | no | iOS Android | no | | maxHeight | To resize the image. | number | no | iOS Android | no | | videoQuality | low, medium, or high on iOS, low or high on Android. | string | no | iOS Android | no | | durationLimit | Video max duration (in seconds). | number | no | iOS Android | no | | quality | 0 to 1, photos. | number | no | iOS Android | no | -| conversionQuality | For conversion from HEIC/HEIF to JPEG, 0 to 1. Default is `0.92` (everything). | number | no | Android | no | +| conversionQuality8.2.2+ | For conversion from HEIC/HEIF to JPEG, 0 to 1. Default is `0.92` (everything). | number | no | Android | yes | | cameraType | 'back' or 'front' (May not be supported in few android devices). | string | no | iOS Android | yes | | includeBase64 | If true, creates base64 string of the image (Avoid using on large image files due to performance). | boolean | no | iOS Android Web | yes | | includeExtra | If true, will include extra data which requires library permissions to be requested (i.e. exif data). | boolean | no | iOS Android | no | @@ -322,6 +322,10 @@ ohpm install | ------------------ | -------------------------------------- | -------- | -------- | --------------- | ----------------- | | launchCamera | Launch camera to take photo or video. | function | yes | iOS Android Web | yes | | launchImageLibrary | Launch gallery to pick image or video. | function | yes | iOS Android Web | yes | +| openCamera8.2.2+ | Implement the photo-taking function of the webcam on the web. | function | yes | Web | no | +| stopCamera8.2.2+ | Used to release resources | function | yes | Web | no | + + ## 遗留问题 -- Gitee From 1bd0b473768e710b2053447c9ecab83073274bb1 Mon Sep 17 00:00:00 2001 From: qiuting Date: Mon, 13 Oct 2025 10:20:49 +0800 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=9A=84=E5=B1=9E=E6=80=A7=E6=9C=AA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qiuting --- zh-cn/react-native-async-storage-async-storage.md | 2 +- zh-cn/react-native-community-netinfo.md | 4 ++-- zh-cn/react-native-mlkit-ocr.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/react-native-async-storage-async-storage.md b/zh-cn/react-native-async-storage-async-storage.md index 609445990..28e81d78e 100644 --- a/zh-cn/react-native-async-storage-async-storage.md +++ b/zh-cn/react-native-async-storage-async-storage.md @@ -308,7 +308,7 @@ ohpm install | `removeItem` | Removes item for a key, invokes (optional) callback once completed. | function(key: string, [callback]: ?(error: ?Error) => void): Promise | No | All | yes | | `getAllKeys` | Returns all keys known to your App, for all callers, libraries, etc. Once completed, invokes callback with errors (if any) and array of keys. | function([callback]: ?(error: ?Error, keys: ?Array) => void): Promise | No | All | yes | | `multiGet` | Fetches multiple key-value pairs for given array of keys in a batch. Once completed, invokes callback with errors (if any) and results. | function(keys: Array, [callback]: ?(errors: ?Array, result: ?Array>) => void): Promise | No | All | yes | -| `multiSet` | Stores multiple key-value pairs in a batch. Once completed, callback with any errors will be called. | function(keyValuePairs: Array>, [callback]: ?(errors: ?Array) => void): Promise | No | All | yes | +| `multiSet`2.2.1+ | Stores multiple key-value pairs in a batch. Once completed, callback with any errors will be called . >1.21.0:multiSet: (keyValuePairs: [string,string][],callback?:MultiCallback)=>Promise 2.2.1: multiSet: ( keyValuePairs: ReadonlyArray, callback?: MultiCallback ) => Promise; | function(keyValuePairs: Array, [callback]: ?(errors: ?Array) => void): Promise | No | All | yes | | `multiMerge` | Multiple merging of existing and new values in a batch. Assumes that values are stringified JSON. Once completed, invokes callback with errors (if any). | function(keyValuePairs: Array>, [callback]: ?(errors: ?Array) => void): Promise | No | All | yes | | `multiRemove` | Clears multiple key-value entries for given array of keys in a batch. Once completed, invokes a callback with errors (if any). | function(keys: Array, [callback]: ?(errors: ?Array) => void) | No | All | yes | | `clear` | Removes whole AsyncStorage data, for all clients, libraries, etc. You probably want to use removeItem or multiRemove to clear only your App's keys. | function([callback]: ?(error: ?Error) => void): Promise | No | All | yes | diff --git a/zh-cn/react-native-community-netinfo.md b/zh-cn/react-native-community-netinfo.md index 8002c7cdc..15e2b4629 100644 --- a/zh-cn/react-native-community-netinfo.md +++ b/zh-cn/react-native-community-netinfo.md @@ -295,8 +295,8 @@ ohpm install | Name | Description | Type | Required | Platform | HarmonyOS Support | |-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|----------|-------------|-------------------| | `type` | The type of the current connection. | NetInfoStateType | yes | iOS Android | yes | -| `isConnected` | If there is an active network connection.
Defaults to null on most platforms for unknown networks.
Note: Web browsers report network type unknown for many otherwise valid networks (https://caniuse.com/netinfo),
so isConnected may be true or false and represent a real connection status even for unknown network types in certain cases. | boolean, null | yes | iOS Android | yes | -| `isInternetReachable` | If the internet is reachable with the currently active network connection.
If unknown defaults to null | boolean, null | yes | iOS Android | yes | +| `isConnected`11.4.2+ | If there is an active network connection.
Defaults to null on most platforms for unknown networks.
Note: Web browsers report network type unknown for many otherwise valid networks (https://caniuse.com/netinfo),
so isConnected may be true or false and represent a real connection status even for unknown network types in certain cases.
> 11.1.0 :连接时:isConnected:true;断开时:isConnected:false
11.4.2 : 不论连接还是断开:isConnected:boolean | boolean, null | yes | iOS Android | yes | +| `isInternetReachable`11.4.2+ | If the internet is reachable with the currently active network connection.
If unknown defaults to null
> 11.1.0 :连接时:isConnected:true;断开时:isInternetReachable:false
11.4.2 : 不论连接还是断开:isInternetReachable:boolean | boolean, null | yes | iOS Android | yes | | `isWifiEnabled` | (Android only) Whether the device's WiFi is ON or OFF. | boolean | yes | iOS Android | yes | | `details` | The value depends on the type value. See below. | object | yes | iOS Android | yes | diff --git a/zh-cn/react-native-mlkit-ocr.md b/zh-cn/react-native-mlkit-ocr.md index 15490bfd6..3fef591ac 100644 --- a/zh-cn/react-native-mlkit-ocr.md +++ b/zh-cn/react-native-mlkit-ocr.md @@ -349,7 +349,7 @@ ohpm install | ---------------- | ------------------------------------------ |--------------------------------- | ------ | -------- | -------- | | detectFromUri(uri)| 传入网络图片地址 | Function |Yes| All | Yes | | detectFromFile(path) | 传入本地图片地址 | Function |Yes| All | Yes | - +> [!TIP] [HTTP错误码-错误码-Network Kit(网络服务)-网络-系统 - 华为HarmonyOS开发者](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/errorcode-net-http#section2300023-向磁盘应用程序写入接收数据失败) 本地图片的内存不能超过5MB ## 遗留问题 -- Gitee