From 5e00cbdb905f0f028557b22ee5cbe844b440d742 Mon Sep 17 00:00:00 2001 From: dong_yaosen <3544880564@qq.com> Date: Wed, 10 Dec 2025 12:22:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E6=96=87=E6=A1=A3=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E9=93=BE=E6=8E=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-haptic-feedback.md | 2 +- en/react-native-skia.md | 55 ++++++---------- en/react-native-system-setting.md | 90 ++++++++++++++++++++++++--- en/react-native-version-number.md | 82 +++++++++++++++++++++--- en/react-native-zip-archive.md | 52 ++++++---------- zh-cn/react-native-haptic-feedback.md | 2 +- zh-cn/react-native-skia.md | 58 +++++++---------- zh-cn/react-native-system-setting.md | 43 ++++--------- zh-cn/react-native-version-number.md | 87 +++++++++++++++++++++++--- zh-cn/react-native-zip-archive.md | 60 +++++++----------- 10 files changed, 325 insertions(+), 206 deletions(-) diff --git a/en/react-native-haptic-feedback.md b/en/react-native-haptic-feedback.md index 8bf5ff13..8a6c5fe7 100644 --- a/en/react-native-haptic-feedback.md +++ b/en/react-native-haptic-feedback.md @@ -181,7 +181,7 @@ Method 2: Directly link to the source code. ### 3. Configure CMakeLists and import RNHapticFeedbackPackage -> If using version 2.2.1, please skip this chapter +> If you are using version <= 2.2.1, please skip this chapter. open `entry/src/main/cpp/CMakeLists.txt`,add: diff --git a/en/react-native-skia.md b/en/react-native-skia.md index 7e66f369..aa75cbc7 100644 --- a/en/react-native-skia.md +++ b/en/react-native-skia.md @@ -15,14 +15,17 @@ Template version: v0.2.2 > [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-skia) -| Version | Package Name | Repository | Release | Version for RN | -| ------------------------------ | ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------- | -| 1.3.8 | @react-native-oh-tpl/react-native-skia | [Github](https://github.com/react-native-oh-library/react-native-skia) | [Github Releases](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | -| 1.4.0 | @react-native-ohos/react-native-skia | [Github](https://github.com/react-native-oh-library/react-native-skia) | [Github Releases](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.77 | +## Installation and Usage -For older versions that have not been released to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package +Please refer to the Releases page of the third-party library for the corresponding version information: -## Installation and Usage +| Version | Package Name | Repository | Release | Version for RN | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | +| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | +| 1.4.0 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/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: @@ -33,20 +36,14 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -# RN0.72 -npm install @react-native-oh-tpl/react-native-skia -# RN0.77 npm install @react-native-ohos/react-native-skia ``` #### **yarn** ```bash -# RN0.72 -yarn add @react-native-oh-tpl/react-native-skia -# RN0.77 yarn add @react-native-ohos/react-native-skia ``` @@ -80,7 +77,9 @@ export default App; ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-skia@1.3.9, 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 + +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -105,17 +104,6 @@ Method 1 (recommended): Use the HAR file. Open `entry/oh-package.json5` file and add the following dependencies: -- RN0.72 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-skia": "file:../../node_modules/@react-native-oh-tpl/react-native-skia/harmony/skia.har" - } -``` - -- RN0.77 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -138,6 +126,8 @@ Method 2: Directly link to the source code. ### 3. Configuring CMakeLists and Introducing SkiaPackage +> If you are using version <= 1.3.8, please skip this chapter. + Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff @@ -159,8 +149,6 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# RN0.72 -+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-skia/src/main/cpp" ./skia) # RN0.77 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-skia/src/main/cpp" ./skia) @@ -207,8 +195,6 @@ Find `function buildCustomRNComponent()`, which is usually located in `entry/src ```diff ... -// RN0.72 -+ import { RNCSkiaDomView, SKIA_DOM_VIEW_TYPE } from '@react-native-oh-tpl/react-native-skia'; // RN0.77 + import { RNCSkiaDomView, SKIA_DOM_VIEW_TYPE } from '@react-native-ohos/react-native-skia'; @@ -246,8 +232,6 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -// RN0.72 -+ import {RNSkiaPackage} from '@react-native-oh-tpl/react-native-skia/ts'; // RN0.77 + import {RNSkiaPackage} from '@react-native-ohos/react-native-skia/ts'; @@ -279,14 +263,11 @@ 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. -Verified in the following version: - -1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18; -2. RNOH:0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112; - -[!TIP] [skia Official ducoments](https://shopify.github.io/react-native-skia/docs/getting-started/installation) +Verified in the following versions. -[!TIP] To use this library, you need to configure [@react-native-oh-tpl/react-native-reanimated](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-reanimated.md) +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## Components diff --git a/en/react-native-system-setting.md b/en/react-native-system-setting.md index 73daaa46..7c739495 100644 --- a/en/react-native-system-setting.md +++ b/en/react-native-system-setting.md @@ -17,10 +17,17 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/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. +Please refer to the Releases page of the third-party library for the corresponding version information: -Go to the project directory and execute the following instruction: +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 1.7.6-0.0.1@deprecated | [@react-native-oh-tpl/react-native-system-setting Releases(deprecated)](https://github.com/react-native-oh-library/react-native-system-setting/releases) | 0.72 | +| 1.7.7 | [@react-native-ohos/react-native-system-setting Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-system-setting/releases) | 0.72 | +| 1.8.0 | [@react-native-ohos/react-native-system-setting Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-system-setting/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: @@ -28,13 +35,13 @@ Go to the project directory and execute the following instruction: #### npm ```bash -npm install @react-native-oh-tpl/react-native-system-setting +npm install @react-native-ohos/react-native-system-setting ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-system-setting +yarn add @react-native-ohos/react-native-system-setting ``` @@ -162,14 +169,20 @@ export default SystemSettingDemo; ## Use Codegen +Version >= @react-native-ohos/react-native-system-setting@1.7.7, compatible with codegen-lib for generating bridge code. + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). + ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-system-setting@1.7.7 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 + +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. + ### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json @@ -194,7 +207,7 @@ Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-system-setting": "../../node_modules/@react-native-oh-tpl/react-native-system-setting/harmony/react_native_system_setting.har" + "@react-native-ohos/react-native-system-setting": "../../node_modules/@react-native-ohos/react-native-system-setting/harmony/react_native_system_setting.har" } ``` @@ -217,7 +230,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import { RNSystemSettingPackage } from '@react-native-oh-tpl/react-native-system-setting/ts'; ++ import { RNSystemSettingPackage } from '@react-native-ohos/react-native-system-setting/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -227,6 +240,62 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` +### 4. Configuring CMakeLists and Introducing RNSystemSettingPackage +> If you are using version <= 1.7.6-0.0.1, please skip this chapter. + +```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_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp") +set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated") +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(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") + +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +# (VM) Define a variable and assign it to the current module's cpp directory +set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +# Add the Header File directory, including cpp, cpp/include, and tell cmake to find the Header Files introduced by the code here +include_directories(${NATIVERENDER_ROOT_PATH} + ${NATIVERENDER_ROOT_PATH}/include) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-system-setting/src/main/cpp" ./system-setting) + +file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1 + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) ++ target_link_libraries(rnoh_app PUBLIC rnoh_system_setting) +``` + +Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code: + +```diff +#include "RNOH/PackageProvider.h" ++ #include "RNSystemSettingPackage.h" +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) +{ + return { ++ std::make_shared(ctx) + }; +} +``` + ### 4. Running Click the `sync` button in the upper right corner. @@ -246,7 +315,12 @@ 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-oh-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases)。 +Verified in the following versions. + +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; + ### Permission Requirements diff --git a/en/react-native-version-number.md b/en/react-native-version-number.md index 2cd619e7..87460006 100644 --- a/en/react-native-version-number.md +++ b/en/react-native-version-number.md @@ -18,10 +18,17 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/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. +Please refer to the Releases page of the third-party library for the corresponding version information -Go to the project directory and execute the following instruction: +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 0.3.6-0.0.1@deprecated | [@react-native-oh-tpl/react-native-version-number Releases(deprecated)](https://github.com/react-native-oh-library/react-native-version-number/releases) | 0.72 | +| 0.3.7 | [@react-native-ohos/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/releases) | 0.72 | +| 0.4.0 | [@react-native-ohos/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/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: @@ -29,13 +36,13 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-version-number +npm install @react-native-ohos/react-native-version-number ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-version-number +yarn add @react-native-ohos/react-native-version-number ``` @@ -61,11 +68,14 @@ export default function () { ## Use Codegen -If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). +Version >= @react-native-ohos/react-native-version-number@0.3.7, compatible with codegen-lib for generating bridge code. +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-version-number@0.3.7, 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 + +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -94,7 +104,7 @@ Open `entry/oh-package.json5` file and add the following dependencies: "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-version-number": "file:../../node_modules/@react-native-oh-tpl/react-native-version-number/harmony/rnoh_version_number.har" + "@react-native-ohos/react-native-version-number": "file:../../node_modules/@react-native-ohos/react-native-version-number/harmony/rnoh_version_number.har" } ``` @@ -117,7 +127,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import {RNVersionNumberPackage} from '@react-native-oh-tpl/react-native-version-number/ts'; ++ import {RNVersionNumberPackage} from '@react-native-ohos/react-native-version-number/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -127,7 +137,55 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 4. Configuring CMakeLists and Introducing RTNCameraKitPackage + +> If you are using version <= 0.3.6-0.0.1, please skip this chapter. + +Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: + +```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_END: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-version-number/src/main/cpp" ./rnoh_version_number) +# RNOH_END: manual_package_linking_1 + +add_library(rnoh_app SHARED + "./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_version_number) +# RNOH_BEGIN: manual_package_linking_2 +``` +Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code: + +```diff +#include "RNOH/PackageProvider.h" ++ #include "RNVersionNumberPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { ++ std::make_shared(ctx) +} +``` + +### 5. Running Click the `sync` button in the upper right corner. @@ -146,7 +204,11 @@ 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-oh-tpl/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/releases) +Verified in the following versions. + +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## API diff --git a/en/react-native-zip-archive.md b/en/react-native-zip-archive.md index 7159185f..08e51ec2 100644 --- a/en/react-native-zip-archive.md +++ b/en/react-native-zip-archive.md @@ -15,16 +15,18 @@ > [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-zip-archive) +## Installation and Usage + 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 | | ---------- | ------------------------------------------------------------ | ---------- | -| 7.0.0 | [@react-native-oh-tpl/react-native-zip-archive Releases](https://github.com/react-native-oh-library/react-native-zip-archive/releases) | 0.72 | -| 7.1.0 | [@react-native-ohos/react-native-zip-archive Releases]() | 0.77 | +| <= 6.1.1-0.1.0@deprecated | [@react-native-oh-tpl/react-native-zip-archive Releases(deprecated)](https://github.com/react-native-oh-library/react-native-zip-archive/releases) | 0.72 | +| 6.1.2 | [@react-native-ohos/react-native-zip-archive Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-zip-archive/releases) | 0.72 | +| 7.1.0 | [@react-native-ohos/react-native-zip-archive Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-zip-archive/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. -## Installation and Usage Go to the project directory and execute the following instruction: @@ -33,20 +35,14 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -# 0.72 -npm install @react-native-oh-tpl/react-native-zip-archive -# 0.77 npm install @react-native-ohos/react-native-zip-archive ``` #### **yarn** ```bash -# 0.72 -yarn add @react-native-oh-tpl/react-native-zip-archive -# 0.77 yarn add @react-native-ohos/react-native-zip-archive ``` @@ -409,13 +405,15 @@ const styles = StyleSheet.create({ ## Use Codegen -> [!TIP] V7.0.0 does not require executing Codegen. +Version >= @react-native-ohos/react-native-zip-archive@6.1.2, compatible with codegen-lib for generating bridge code. -This library has adapted Codegen, and before using it, you need to actively execute the generation of third-party library bridge code. For details, please refer to[Codegen Usage Document](/zh-cn/codegen.md)。 +This library has adapted Codegen, and before using it, you need to actively execute the generation of third-party library bridge code. For details, please refer to[Codegen Usage Document](/en/codegen.md). ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-zip-archive@6.1.2 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 + +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -440,16 +438,6 @@ Method 1 (recommended): Use the HAR file. Open `entry/oh-package.json5` file and add the following dependencies: -- 0.72 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", -+ "@react-native-oh-tpl/react-native-zip-archive": "file:../../node_modules/@react-native-oh-tpl/react-native-zip-archive/harmony/zipArchive_package.har" - } -``` - -- 0.77 ```json "dependencies": { @@ -473,6 +461,8 @@ Method 2: Directly link to the source code. ### 3. CMakeLists and Introducing zipArchive Package +> If you are using version <= 6.1.1-0.1.0, please skip this chapter. + Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff @@ -498,17 +488,11 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# 0.72 -+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-zip-archive/src/main/cpp" ./zipArchive-package) -# 0.77 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-zip-archive/src/main/cpp" ./zipArchive-package) # RNOH_END: manual_package_linking_1 -# 0.72 -file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") - # 0.77 + file(GLOB ZIP_ARCHIVE_GENERATED_CPP_FILES "${ZIP_ARCHIVE_CPP_DIR}/generated/*.cpp") @@ -551,10 +535,7 @@ std::vector> PackageProvider::getPackages(Package::Cont Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff -// 0.72 -+ import {ZipArchivePackage} from '@react-native-oh-tpl/react-native-zip-archive/ts'; -// 0.77 + import {ZipArchivePackage} from '@react-native-ohos/react-native-zip-archive/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -582,10 +563,13 @@ Then build and run the code. ### Compatibility -This document is verified based on the following versions: +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. + +Verified in the following versions. -1. RNOH: 0.72.20; SDK: HarmonyOS NEXT Developer Beta1; IDE: DevEco Studio 5.0.3.200; ROM: 3.0.0.18; -2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112; +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## API diff --git a/zh-cn/react-native-haptic-feedback.md b/zh-cn/react-native-haptic-feedback.md index de7b885d..7da2c987 100644 --- a/zh-cn/react-native-haptic-feedback.md +++ b/zh-cn/react-native-haptic-feedback.md @@ -184,7 +184,7 @@ ohpm install ### 3.配置 CMakeLists 和引入 RNHapticFeedbackPackage -> 若使用的是 2.2.1 版本,请跳过本章。 +> 若使用的是 <= 2.2.1 版本,请跳过本章。 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: diff --git a/zh-cn/react-native-skia.md b/zh-cn/react-native-skia.md index 8ec93207..c3e47503 100644 --- a/zh-cn/react-native-skia.md +++ b/zh-cn/react-native-skia.md @@ -15,37 +15,36 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-skia) -| Version | Package Name | Repository | Release | Version for RN | -| ------------------------------ | ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------- | -| 1.3.8 | @react-native-oh-tpl/react-native-skia | [Github](https://github.com/react-native-oh-library/react-native-skia) | [Github Releases](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | -| 1.4.0 | @react-native-ohos/react-native-skia | [Github](https://github.com/react-native-oh-library/react-native-skia) | [Github Releases](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.77 | - -对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 ## 安装与使用 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | +| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | +| 1.4.0 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 + 进入到工程目录并输入以下命令: + #### **npm** ```bash -# RN0.72 -npm install @react-native-oh-tpl/react-native-skia -# RN0.77 npm install @react-native-ohos/react-native-skia ``` #### **yarn** ```bash -# RN0.72 -yarn add @react-native-oh-tpl/react-native-skia -# RN0.77 yarn add @react-native-ohos/react-native-skia ``` @@ -79,7 +78,9 @@ export default App; ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-skia@1.3.9,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -107,16 +108,6 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 -- RN0.72 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-skia": "file:../../node_modules/@react-native-oh-tpl/react-native-skia/harmony/skia.har" - } -``` - -- RN0.77 ```json "dependencies": { @@ -140,6 +131,8 @@ ohpm install ### 3.配置 CMakeLists 和引入 SkiaPackage +> 若使用的是 <= 1.3.8 版本,请跳过本章。 + 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff @@ -161,9 +154,6 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# RN0.72 -+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-skia/src/main/cpp" ./skia) - # RN0.77 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-skia/src/main/cpp" ./skia) @@ -209,8 +199,6 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... -// RN0.72 -+ import { RNCSkiaDomView, SKIA_DOM_VIEW_TYPE } from '@react-native-oh-tpl/react-native-skia'; // RN0.77 + import { RNCSkiaDomView, SKIA_DOM_VIEW_TYPE } from '@react-native-ohos/react-native-skia'; @@ -248,8 +236,6 @@ const arkTsComponentNames: Array = [ ```diff ... -// RN0.72 -+ import {RNSkiaPackage} from '@react-native-oh-tpl/react-native-skia/ts'; // RN0.77 + import {RNSkiaPackage} from '@react-native-ohos/react-native-skia/ts'; @@ -279,16 +265,14 @@ ohpm install ### 兼容性 -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -在下述版本验证通过: - -1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18; -2. RNOH:0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112; +要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -> [!TIP] [skia 官方文档](https://shopify.github.io/react-native-skia/docs/getting-started/installation) +在以下版本验证通过: -> [!TIP] 使用此库需要配置 [@react-native-oh-tpl/react-native-reanimated](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-reanimated.md) +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## 组件 diff --git a/zh-cn/react-native-system-setting.md b/zh-cn/react-native-system-setting.md index ca09561d..61882de9 100644 --- a/zh-cn/react-native-system-setting.md +++ b/zh-cn/react-native-system-setting.md @@ -24,8 +24,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 1.7.6 | [@react-native-oh-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases) | 0.72 | -| 1.7.6 | [@react-native-oh-library/react-native-system-setting Releases]() | 0.77 | +| <= 1.7.6-0.0.1@deprecated | [@react-native-oh-tpl/react-native-system-setting Releases(deprecated)](https://github.com/react-native-oh-library/react-native-system-setting/releases) | 0.72 | +| 1.7.7 | [@react-native-ohos/react-native-system-setting Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-system-setting/releases) | 0.72 | +| 1.8.0 | [@react-native-ohos/react-native-system-setting Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-system-setting/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -37,20 +38,14 @@ #### npm ```bash -# V1.7.6 for RN0.72 -npm install @react-native-oh-tpl/react-native-system-setting -# V1.7.6 for RN0.77 npm install @react-native-ohos/react-native-system-setting ``` #### yarn ```bash -# V1.7.6 for RN0.72 -yarn add @react-native-oh-tpl/react-native-system-setting -# V1.7.6 for RN0.77 yarn add @react-native-ohos/react-native-system-setting ``` @@ -174,13 +169,15 @@ export default SystemSettingDemo ## 使用 Codegen -> [!TIP] V1.7.6 for RN0.77 不需要执行 Codegen。 +Version >= @react-native-ohos/react-native-system-setting@1.7.7,已适配codegen-lib生成桥接代码。 本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen 文档](/zh-cn/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-system-setting@1.7.7,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -208,16 +205,6 @@ export default SystemSettingDemo 打开 `entry/oh-package.json5`,添加以下依赖 -- V1.7.6 for RN0.72 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-system-setting": "../../node_modules/@react-native-oh-tpl/react-native-system-setting/harmony/react_native_system_setting.har" - } -``` - -- V1.7.6 for RN0.77 ```json "dependencies": { @@ -241,7 +228,7 @@ ohpm install ### 3.配置CMakeLists和引入RNSystemSettingPackage ->注:仅V1.7.6 for RN0.77需要配置CMakeLists和引入RNSystemSettingPackage +> 若使用的是 <= 1.7.6-0.0.1 版本,请跳过本章。 ```diff project(rnapp) @@ -301,11 +288,7 @@ std::vector> PackageProvider::getPackages(Package::Cont 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff - ... -// V1.7.6 for RN0.72 -+ import { RNSystemSettingPackage } from '@react-native-oh-tpl/react-native-system-setting/ts'; -// V1.7.6 for RN0.77 + import { RNSystemSettingPackage } from '@react-native-ohos/react-native-system-setting/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -335,13 +318,11 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: - -| 三方库版本 | 发布信息 | 支持RN版本 | -| ---------- | ------------------------------------------------------------ | ---------- | -| 1.7.6 | [@react-native-oh-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases) | 0.72 | -| 1.7.6 | [@react-native-oh-library/react-native-system-setting Releases]() | 0.77 | +在以下版本验证通过: +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ### 权限要求 由于此库涉及蓝牙、亮度等系统控制功能,使用对应接口时则需要配置对应的权限,权限需配置在entry/src/main目录下module.json5文件中。其中部分权限需弹窗向用户申请授权。具体权限配置见文档:[程序访问控制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/Readme-CN.md#/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/app-permission-mgmt-overview.md)。 diff --git a/zh-cn/react-native-version-number.md b/zh-cn/react-native-version-number.md index 48f8a620..26bc5608 100644 --- a/zh-cn/react-native-version-number.md +++ b/zh-cn/react-native-version-number.md @@ -18,22 +18,33 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 + +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 0.3.6-0.0.1@deprecated | [@react-native-oh-tpl/react-native-version-number Releases(deprecated)](https://github.com/react-native-oh-library/react-native-version-number/releases) | 0.72 | +| 0.3.7 | [@react-native-ohos/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/releases) | 0.72 | +| 0.4.0 | [@react-native-ohos/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: + + #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-version-number +npm install @react-native-ohos/react-native-version-number ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-version-number +yarn add @react-native-ohos/react-native-version-number ``` @@ -59,11 +70,15 @@ export default function () { ## 使用 Codegen +Version >= @react-native-ohos/react-native-version-number@0.3.7,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-version-number@0.3.7,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -95,7 +110,7 @@ export default function () { "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-version-number": "file:../../node_modules/@react-native-oh-tpl/react-native-version-number/harmony/rnoh_version_number.har" + "@react-native-ohos/react-native-version-number": "file:../../node_modules/@react-native-ohos/react-native-version-number/harmony/rnoh_version_number.har" } ``` @@ -118,7 +133,7 @@ ohpm install ```diff ... -+ import {RNVersionNumberPackage} from '@react-native-oh-tpl/react-native-version-number/ts'; ++ import {RNVersionNumberPackage} from '@react-native-ohos/react-native-version-number/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -128,7 +143,59 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 + +### 4.配置 CMakeLists 和引入 RNVersionNumberPackage + +> 若使用的是 <= 0.3.6-0.0.1 版本,请跳过本章。 + +打开 `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_END: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-version-number/src/main/cpp" ./rnoh_version_number) +# RNOH_END: manual_package_linking_1 + +add_library(rnoh_app SHARED + "./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_version_number) +# RNOH_BEGIN: manual_package_linking_2 +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +```diff +#include "RNOH/PackageProvider.h" ++ #include "RNVersionNumberPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { ++ std::make_shared(ctx) +} +``` + + + +### 5.运行 点击右上角的 `sync` 按钮 @@ -147,7 +214,11 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-version-number Releases](https://github.com/react-native-oh-library/react-native-version-number/releases) +在以下版本验证通过: + +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## API diff --git a/zh-cn/react-native-zip-archive.md b/zh-cn/react-native-zip-archive.md index ef305917..ec674128 100644 --- a/zh-cn/react-native-zip-archive.md +++ b/zh-cn/react-native-zip-archive.md @@ -15,16 +15,19 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-zip-archive) +## 安装与使用 + 请到三方库的 Releases 发布地址查看配套的版本信息: -| 三方库版本 | 发布信息 | 支持RN版本 | -| ---------- | ------------------------------------------------------------ | ---------- | -| 7.0.0 | [@react-native-oh-tpl/react-native-zip-archive Releases](https://github.com/react-native-oh-library/react-native-zip-archive/releases) | 0.72 | -| 7.1.0 | [@react-native-ohos/react-native-zip-archive Releases]() | 0.77 | +| 三方库版本 | 发布信息 | 支持RN版本 | +|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| ---------- | +| <= 6.1.1-0.1.0@deprecated | [@react-native-oh-tpl/react-native-zip-archive Releases(deprecated)](https://github.com/react-native-oh-library/react-native-zip-archive/releases) | 0.72 | +| 6.1.2 | [@react-native-ohos/react-native-zip-archive Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-zip-archive/releases) | 0.72 | +| 7.1.0 | [@react-native-ohos/react-native-zip-archive Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-zip-archive/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 -## 安装与使用 + 进入到工程目录并输入以下命令: @@ -32,23 +35,15 @@ #### **npm** -#### **npm** - ```bash -# 0.72 -npm install @react-native-oh-tpl/react-native-zip-archive -# 0.77 npm install @react-native-ohos/react-native-zip-archive ``` #### **yarn** ```bash -# 0.72 -yarn add @react-native-oh-tpl/react-native-zip-archive -# 0.77 yarn add @react-native-ohos/react-native-zip-archive ``` @@ -419,13 +414,15 @@ const styles = StyleSheet.create({ ## 使用 Codegen -> [!TIP] V7.0.0不需要执行Codegen。 +Version >= @react-native-ohos/react-native-zip-archive@6.1.2,已适配codegen-lib生成桥接代码。 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-zip-archive@6.1.2,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -453,16 +450,7 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 -- 0.72 -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", -+ "@react-native-oh-tpl/react-native-zip-archive": "file:../../node_modules/@react-native-oh-tpl/react-native-zip-archive/harmony/zipArchive_package.har" - } -``` - -- 0.77 ```json "dependencies": { @@ -486,6 +474,8 @@ ohpm install ### 3.配置 CMakeLists 和引入zipArchive +> 若使用的是 <= 6.1.1-0.1.0 版本,请跳过本章。 + 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff @@ -511,18 +501,10 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# 0.72 -+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-zip-archive/src/main/cpp" ./zipArchive-package) - -# 0.77 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-zip-archive/src/main/cpp" ./zipArchive-package) # RNOH_END: manual_package_linking_1 -# 0.72 -file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") - -# 0.77 + file(GLOB ZIP_ARCHIVE_GENERATED_CPP_FILES "${ZIP_ARCHIVE_CPP_DIR}/generated/*.cpp") add_library(rnoh_app SHARED @@ -564,10 +546,6 @@ std::vector> PackageProvider::getPackages(Package::Cont 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff -// 0.72 -+ import {ZipArchivePackage} from '@react-native-oh-tpl/react-native-zip-archive/ts'; - -// 0.77 + import {ZipArchivePackage} from '@react-native-ohos/react-native-zip-archive/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -595,10 +573,14 @@ ohpm install ### 兼容性 -本文档内容基于以下版本验证通过: +要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 + +在以下版本验证通过: + +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; -1. RNOH: 0.72.20; SDK: HarmonyOS NEXT Developer Beta1; IDE: DevEco Studio 5.0.3.200; ROM: 3.0.0.18; -2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112; ## API -- Gitee From f09d8f00d8575d88e305d14ac648caf3e54d36fd Mon Sep 17 00:00:00 2001 From: dong_yaosen <3544880564@qq.com> Date: Wed, 10 Dec 2025 17:13:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-skia.md | 6 +-- en/react-native-svg.md | 94 ++++++++++++++++++++------------------ zh-cn/react-native-skia.md | 5 +- zh-cn/react-native-svg.md | 33 +++++++++---- 4 files changed, 78 insertions(+), 60 deletions(-) diff --git a/en/react-native-skia.md b/en/react-native-skia.md index aa75cbc7..176b8764 100644 --- a/en/react-native-skia.md +++ b/en/react-native-skia.md @@ -19,10 +19,10 @@ Template version: v0.2.2 Please refer to the Releases page of the third-party library for the corresponding version information: -| Version | Package Name | Repository | Release | Version for RN | +| Third-party Library Version | Release Information | Supported RN Version | | ---------- | ------------------------------------------------------------ | ---------- | -| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | -| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | +| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | +| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | | 1.4.0 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/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. diff --git a/en/react-native-svg.md b/en/react-native-svg.md index daeff489..395f6faf 100644 --- a/en/react-native-svg.md +++ b/en/react-native-svg.md @@ -14,36 +14,38 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-svg) -## 安装与使用 +## Installation and Usage -> [!TIP] 本项目为 react-native-svg 的ArkTs版本,现已停止维护。 +Please refer to the Releases page of the third-party library for the corresponding version information: -> [!TIP] 如需继续使用请移步至[react-native-svg-capi](/zh-cn/react-native-svg-capi.md) 使用CAPI版本的 react-native-svg。 +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 15.0.1@deprecated | [@react-native-oh-tpl/react-native-svg Releases(deprecated)](https://github.com/react-native-oh-library/react-native-svg/releases) | 0.72 | +| 15.0.2 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.72 | +| 15.12.1 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.77 | -Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-svg Releases](https://github.com/react-native-oh-library/react-native-svg/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. +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: - #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-svg +npm install @react-native-ohos/react-native-svg ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-svg +yarn add @react-native-ohos/react-native-svg ``` - -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import Svg, { Path } from "react-native-svg"; @@ -55,11 +57,14 @@ import Svg, { Path } from "react-native-svg"; ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-svg@15.0.2 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 + +This step provides guidance for manually configuring native dependencies. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. + +### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project -### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 ```json { @@ -70,43 +75,40 @@ import Svg, { Path } from "react-native-svg"; } ``` -### 2.引入原生端代码 - -目前有两种方法: +### 2. Introducing Native Code -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 +Currently, two methods are available: -方法一:通过 har 包引入 +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/svg": "file:../../node_modules/@react-native-oh-tpl/react-native-svg/harmony/svg.har" + "@react-native-ohos/svg": "file:../../node_modules/@react-native-ohos/react-native-svg/harmony/svg.har" } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] or details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.配置 CMakeLists 和引入 SVGPackage +### 3.Configuring CMakeLists and Introducing SVGPackage -打开 `entry/src/main/cpp/CMakeLists.txt`,添加: +Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff project(rnapp) @@ -126,7 +128,7 @@ 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-oh-tpl/react-native-svg/src/main/cpp" ./svg) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-svg/src/main/cpp" ./svg) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -144,7 +146,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) # RNOH_END: link_packages ``` -打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: +Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code: ```diff #include "RNOH/PackageProvider.h" @@ -163,14 +165,14 @@ std::vector> PackageProvider::getPackages(Package::Cont } ``` -### 4.在 ArkTs 侧引入 SVG 组件 +### 4. Introduce SVG component to ArkTs -找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加: +Find `function buildCustomRNComponent()`, Generally located in `entry/src/main/ets/pages/index.ets ` or `entry/src/main/ets/rn/LoadBundle.ets`, add: ```diff ... import { createRNPackages } from '../RNPackagesFactory' -+ import { SVG_VIEW_TYPE_NAME, SVGView } from "@react-native-oh-tpl/svg" ++ import { SVG_VIEW_TYPE_NAME, SVGView } from "@react-native-ohos/svg" @Builder function buildCustomComponent(ctx: ComponentBuilderContext) { @@ -192,9 +194,9 @@ function buildCustomComponent(ctx: ComponentBuilderContext) { ... ``` -> [!TIP] 本库使用了混合方案,需要添加组件名。 +> [!TIP] If the repository uses a mixed solution, the component name needs to be added. -在`entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets` 找到常量 `arkTsComponentNames` 在其数组里添加组件名 +Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array. ```diff const arkTsComponentNames: Array = [ @@ -203,26 +205,30 @@ const arkTsComponentNames: Array = [ ]; ``` -### 5.运行 +### 5. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. + +## Constraints -## 约束与限制 +### Compatibility -### 兼容性 +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. -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +Verified in the following versions. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-svg Releases](https://github.com/react-native-oh-library/react-native-svg/releases) +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## 属性 diff --git a/zh-cn/react-native-skia.md b/zh-cn/react-native-skia.md index c3e47503..1ce3e2cc 100644 --- a/zh-cn/react-native-skia.md +++ b/zh-cn/react-native-skia.md @@ -16,15 +16,14 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-skia) - ## 安装与使用 请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | -| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | +| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | +| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | | 1.4.0 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 diff --git a/zh-cn/react-native-svg.md b/zh-cn/react-native-svg.md index 459e3d1c..bd80064a 100644 --- a/zh-cn/react-native-svg.md +++ b/zh-cn/react-native-svg.md @@ -16,11 +16,15 @@ ## 安装与使用 -> [!TIP] 本项目为 react-native-svg 的ArkTs版本,现已停止维护。 +请到三方库的 Releases 发布地址查看配套的版本信息: -> [!TIP] 如需继续使用请移步至[react-native-svg-capi](/zh-cn/react-native-svg-capi.md) 使用CAPI版本的 react-native-svg。 +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| <= 15.0.1@deprecated | [@react-native-oh-tpl/react-native-svg Releases(deprecated)](https://github.com/react-native-oh-library/react-native-svg/releases) | 0.72 | +| 15.0.2 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.72 | +| 15.12.1 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.77 | -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-svg Releases](https://github.com/react-native-oh-library/react-native-svg/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -29,13 +33,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-svg +npm install @react-native-ohos/react-native-svg ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-svg +yarn add @react-native-ohos/react-native-svg ``` @@ -54,7 +58,10 @@ import Svg, { Path } from "react-native-svg"; ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 + +Version >= @react-native-ohos/react-native-svg@15.0.2,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -86,7 +93,7 @@ import Svg, { Path } from "react-native-svg"; "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/svg": "file:../../node_modules/@react-native-oh-tpl/react-native-svg/harmony/svg.har" + "@react-native-ohos/svg": "file:../../node_modules/@react-native-ohos/react-native-svg/harmony/svg.har" } ``` @@ -105,6 +112,8 @@ ohpm install ### 3.配置 CMakeLists 和引入 SVGPackage +> 若使用的是 <= 15.0.1 版本,请跳过本章。 + 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff @@ -125,7 +134,7 @@ 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-oh-tpl/react-native-svg/src/main/cpp" ./svg) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-svg/src/main/cpp" ./svg) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -169,7 +178,7 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... import { createRNPackages } from '../RNPackagesFactory' -+ import { SVG_VIEW_TYPE_NAME, SVGView } from "@react-native-oh-tpl/svg" ++ import { SVG_VIEW_TYPE_NAME, SVGView } from "@react-native-ohos/svg" @Builder function buildCustomComponent(ctx: ComponentBuilderContext) { @@ -221,7 +230,11 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-svg Releases](https://github.com/react-native-oh-library/react-native-svg/releases) +在以下版本验证通过: + +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## 属性 -- Gitee From 857d2375ea385497b66e592d48eae21db29f1f45 Mon Sep 17 00:00:00 2001 From: dong_yaosen <3544880564@qq.com> Date: Wed, 10 Dec 2025 17:13:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-skia.md | 3 --- en/react-native-system-setting.md | 2 +- zh-cn/react-native-skia.md | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/en/react-native-skia.md b/en/react-native-skia.md index 176b8764..7cd2a6ab 100644 --- a/en/react-native-skia.md +++ b/en/react-native-skia.md @@ -150,7 +150,6 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# RN0.77 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-skia/src/main/cpp" ./skia) # RNOH_END: manual_package_linking_1 @@ -196,7 +195,6 @@ Find `function buildCustomRNComponent()`, which is usually located in `entry/src ```diff ... -// RN0.77 + import { RNCSkiaDomView, SKIA_DOM_VIEW_TYPE } from '@react-native-ohos/react-native-skia'; @Builder @@ -233,7 +231,6 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -// RN0.77 + import {RNSkiaPackage} from '@react-native-ohos/react-native-skia/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { diff --git a/en/react-native-system-setting.md b/en/react-native-system-setting.md index 7c739495..9055c3bd 100644 --- a/en/react-native-system-setting.md +++ b/en/react-native-system-setting.md @@ -296,7 +296,7 @@ std::vector> PackageProvider::getPackages(Package::Cont } ``` -### 4. Running +### 5. Running Click the `sync` button in the upper right corner. diff --git a/zh-cn/react-native-skia.md b/zh-cn/react-native-skia.md index 1ce3e2cc..97999260 100644 --- a/zh-cn/react-native-skia.md +++ b/zh-cn/react-native-skia.md @@ -153,7 +153,6 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -# RN0.77 + add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-skia/src/main/cpp" ./skia) # RNOH_END: manual_package_linking_1 @@ -199,7 +198,6 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... -// RN0.77 + import { RNCSkiaDomView, SKIA_DOM_VIEW_TYPE } from '@react-native-ohos/react-native-skia'; @Builder @@ -236,7 +234,6 @@ const arkTsComponentNames: Array = [ ```diff ... -// RN0.77 + import {RNSkiaPackage} from '@react-native-ohos/react-native-skia/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { -- Gitee From 1ec9f44943ca62e1f7b2e349f3713ad50dd2dd50 Mon Sep 17 00:00:00 2001 From: dong_yaosen <3544880564@qq.com> Date: Wed, 10 Dec 2025 17:19:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-skia.md | 7 +++---- en/react-native-svg.md | 6 ++++-- en/react-native-zip-archive.md | 6 +++--- zh-cn/react-native-svg.md | 4 ++-- zh-cn/react-native-zip-archive.md | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/en/react-native-skia.md b/en/react-native-skia.md index 7cd2a6ab..8bcf7230 100644 --- a/en/react-native-skia.md +++ b/en/react-native-skia.md @@ -21,16 +21,15 @@ Please refer to the Releases page of the third-party library for the correspondi | Third-party Library Version | Release Information | Supported RN Version | | ---------- | ------------------------------------------------------------ | ---------- | -| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | -| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | -| 1.4.0 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.77 | +| <= 1.3.8@deprecated | [@react-native-oh-tpl/react-native-skia Releases(deprecated)](https://github.com/react-native-oh-library/react-native-skia/releases) | 0.72 | +| 1.3.9 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/releases) | 0.72 | +| 1.4.0 | [@react-native-ohos/react-native-skia Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-skia/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: - #### **npm** diff --git a/en/react-native-svg.md b/en/react-native-svg.md index 395f6faf..c7003683 100644 --- a/en/react-native-svg.md +++ b/en/react-native-svg.md @@ -12,7 +12,7 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-svg) +> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-harmony-svg) ## Installation and Usage @@ -20,7 +20,7 @@ Please refer to the Releases page of the third-party library for the correspondi | Third-party Library Version | Release Information | Supported RN Version | | ---------- | ------------------------------------------------------------ | ---------- | -| <= 15.0.1@deprecated | [@react-native-oh-tpl/react-native-svg Releases(deprecated)](https://github.com/react-native-oh-library/react-native-svg/releases) | 0.72 | +| <= 15.0.1@deprecated | [@react-native-oh-tpl/react-native-svg Releases(deprecated)](https://github.com/react-native-oh-library/react-native-harmony-svg/releases) | 0.72 | | 15.0.2 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.72 | | 15.12.1 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.77 | @@ -108,6 +108,8 @@ Method 2: Directly link to the source code. ### 3.Configuring CMakeLists and Introducing SVGPackage +> If you are using version <= 15.0.1, please skip this chapter. + Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff diff --git a/en/react-native-zip-archive.md b/en/react-native-zip-archive.md index 08e51ec2..58ba46c1 100644 --- a/en/react-native-zip-archive.md +++ b/en/react-native-zip-archive.md @@ -474,7 +474,7 @@ 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") -# 0.77 + + set(ZIP_ARCHIVE_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@react-native-ohos/react-native-zip-archive/src/main/cpp") set(LOG_VERBOSITY_LEVEL 1) @@ -493,7 +493,7 @@ add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) # RNOH_END: manual_package_linking_1 -# 0.77 + + file(GLOB ZIP_ARCHIVE_GENERATED_CPP_FILES "${ZIP_ARCHIVE_CPP_DIR}/generated/*.cpp") add_library(rnoh_app SHARED @@ -503,7 +503,7 @@ add_library(rnoh_app SHARED "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" ) -# 0.77 + + target_include_directories(rnoh_app PUBLIC ${ZIP_ARCHIVE_CPP_DIR}) target_link_libraries(rnoh_app PUBLIC rnoh) diff --git a/zh-cn/react-native-svg.md b/zh-cn/react-native-svg.md index bd80064a..be689d56 100644 --- a/zh-cn/react-native-svg.md +++ b/zh-cn/react-native-svg.md @@ -12,7 +12,7 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-svg) +> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-harmony-svg) ## 安装与使用 @@ -20,7 +20,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| <= 15.0.1@deprecated | [@react-native-oh-tpl/react-native-svg Releases(deprecated)](https://github.com/react-native-oh-library/react-native-svg/releases) | 0.72 | +| <= 15.0.1@deprecated | [@react-native-oh-tpl/react-native-svg Releases(deprecated)](https://github.com/react-native-oh-library/react-native-harmony-svg/releases) | 0.72 | | 15.0.2 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.72 | | 15.12.1 | [@react-native-ohos/react-native-svg Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-svg/releases) | 0.77 | diff --git a/zh-cn/react-native-zip-archive.md b/zh-cn/react-native-zip-archive.md index ec674128..e1851e71 100644 --- a/zh-cn/react-native-zip-archive.md +++ b/zh-cn/react-native-zip-archive.md @@ -487,7 +487,7 @@ 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") -# 0.77 + + set(ZIP_ARCHIVE_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@react-native-ohos/react-native-zip-archive/src/main/cpp") set(LOG_VERBOSITY_LEVEL 1) @@ -514,7 +514,7 @@ add_library(rnoh_app SHARED "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" ) -# 0.77 + + target_include_directories(rnoh_app PUBLIC ${ZIP_ARCHIVE_CPP_DIR}) target_link_libraries(rnoh_app PUBLIC rnoh) -- Gitee