diff --git a/en/react-native-haptic-feedback.md b/en/react-native-haptic-feedback.md index 6027ed6d7bf7d9a54a19ff5a1ca35bae6f549f38..8a6c5fe714768cfa5848048d3151ac1c16a93ced 100644 --- a/en/react-native-haptic-feedback.md +++ b/en/react-native-haptic-feedback.md @@ -125,7 +125,7 @@ export default HapticFeedbackExample; ## Use Codegen -> [!TIP] V2.2.2 no need to execute Codegen +Version >= @react-native-ohos/react-native-haptic-feedback@2.2.2 now supports Autolink without requiring manual configuration, currently only supports 72 frameworks. 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). @@ -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-localization.md b/en/react-native-localization.md index b865e499d3662be14fb4026172b727469d71935c..90fd9bef27d5f1abaa6e9e73f42924592426609a 100644 --- a/en/react-native-localization.md +++ b/en/react-native-localization.md @@ -22,7 +22,7 @@ This third-party library has been migrated to Gitcode and is now available for d | Third-party Library Version | Release Information | Supported RN Version | |-------| ------------------------------------------------------------ | ---------- | -| <=2.3.2-0.0.1@deprecated | [@react-native-oh-tpl/react-native-localization Releases(deprecated)](https://github.com/react-native-oh-library/react-native-localization/releases) | 0.72 | +| <=2.3.2-0.0.1@deprecated | [@react-native-oh-tpl/react-native-localization Releases(deprecated)](https://github.com/react-native-oh-library/ReactNativeLocalization/releases) | 0.72 | | 2.3.3 | [@react-native-ohos/react-native-localization Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-localization/releases) | 0.72 | | 2.4.0 | [@react-native-ohos/react-native-localization Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-localization/releases) | 0.77 | diff --git a/en/react-native-ohos-community-auto-fill.md b/en/react-native-ohos-community-auto-fill.md index dc11dbb8e42f6082940717e1d6ee55c4bc75c4e1..dd03510585110f2e0b401d2543b2bd517af23c92 100644 --- a/en/react-native-ohos-community-auto-fill.md +++ b/en/react-native-ohos-community-auto-fill.md @@ -35,7 +35,7 @@ Please refer to the Releases page of the third-party library for the correspondi | 1.0.2 | [@react-native-ohos/auto-fill Releases](https://gitcode.com/openharmony-sig/rntpc_auto-fill/releases) | 0.72 | | 1.1.0 | [@react-native-ohos/auto-fill Releases](https://gitcode.com/openharmony-sig/rntpc_auto-fill/releases) | 0.77 | -For older versions not published on npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package. +For older versions not published on 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 instructions: diff --git a/en/react-native-system-setting.md b/en/react-native-system-setting.md index 73daaa46915a1ca53a678123b96be243823fcf70..b59e183ea3e5e252450e49fd4ae3410f56c1cbe3 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,11 +169,16 @@ 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. @@ -191,10 +203,11 @@ Method 1 (recommended): Use the HAR file. 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,7 +240,63 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 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) + }; +} +``` + +### 5. 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-view-pdf.md b/en/react-native-view-pdf.md index bada952e49a44c729ca14f7ae2d4dfaedf95ab59..02d47f2b32b5652cfe9437a5bd5305709a367e2e 100644 --- a/en/react-native-view-pdf.md +++ b/en/react-native-view-pdf.md @@ -21,8 +21,8 @@ Find the matching version information in the release address of a third-party li | Third-party Library Version | Release Information | Supported RN Version | | ---------- | ------------------------------------------------------------ | ---------- | | <=0.14.0-0.0.2@deprecated | [@react-native-oh-tpl/react-native-view-pdf Releases(deprecated)](https://github.com/react-native-oh-library/react-native-PDFView/releases) | 0.72 | -| 0.14.1 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-view-pdf/releases) | 0.72 | -| 0.15.0 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-view-pdf/releases) | 0.77 | +| 0.14.1 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-pdfview/releases) | 0.72 | +| 0.15.0 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-pdfview/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-zip-archive.md b/en/react-native-zip-archive.md index 7159185fa76364c847b548b03eead1da3512363f..f6cfce2d4d9b6ad16fcad855ba969772bb084f49 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,9 +535,6 @@ 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'; @@ -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 2be30ca3e05b74e0941f1826b1d2a6f52dd220db..de7b885d37fcf76f52bad7266ccf8b3d0a3d98ac 100644 --- a/zh-cn/react-native-haptic-feedback.md +++ b/zh-cn/react-native-haptic-feedback.md @@ -125,7 +125,7 @@ export default HapticFeedbackExample; ## 使用 Codegen -> [!TIP] V2.2.2 不需要执行 Codegen。 +Version >= @react-native-ohos/react-native-haptic-feedback@2.2.2,已适配codegen-lib生成桥接代码。 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 diff --git a/zh-cn/react-native-localization.md b/zh-cn/react-native-localization.md index 7a9022d5793393907022acc0413782c730ef2f68..02f1eec5e90b90aff85c1d2f355367eacd765d11 100644 --- a/zh-cn/react-native-localization.md +++ b/zh-cn/react-native-localization.md @@ -24,7 +24,7 @@ | 三方库版本 | 发布信息 | 支持RN版本 | |-------| ------------------------------------------------------------ | ---------- | -| <=2.3.2-0.0.1@deprecated | [@react-native-oh-tpl/react-native-localization Releases(deprecated)](https://github.com/react-native-oh-library/react-native-localization/releases) | 0.72 | +| <=2.3.2-0.0.1@deprecated | [@react-native-oh-tpl/react-native-localization Releases(deprecated)](https://github.com/react-native-oh-library/ReactNativeLocalization/releases) | 0.72 | | 2.3.3 | [@react-native-ohos/react-native-localization Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-localization/releases) | 0.72 | | 2.4.0 | [@react-native-ohos/react-native-localization Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-localization/releases) | 0.77 | diff --git a/zh-cn/react-native-system-setting.md b/zh-cn/react-native-system-setting.md index ca09561dae920c9c0678108831686048e96ea2a9..52963ecad9831cb7caf4be394f9c8b46f9c7887d 100644 --- a/zh-cn/react-native-system-setting.md +++ b/zh-cn/react-native-system-setting.md @@ -20,15 +20,21 @@ ## 安装与使用 +请到三方库的 Releases 发布地址查看配套的版本信息: + + 请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持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 +43,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,16 +174,17 @@ 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` +此步骤为手动配置原生依赖项的指导。 +首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` ### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 ```json @@ -208,16 +209,7 @@ 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 +233,7 @@ ohpm install ### 3.配置CMakeLists和引入RNSystemSettingPackage ->注:仅V1.7.6 for RN0.77需要配置CMakeLists和引入RNSystemSettingPackage +> 若使用的是 <= 1.7.6-0.0.1 版本,请跳过本章。 ```diff project(rnapp) @@ -302,10 +294,7 @@ std::vector> PackageProvider::getPackages(Package::Cont ```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,12 +324,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; ### 权限要求 diff --git a/zh-cn/react-native-view-pdf.md b/zh-cn/react-native-view-pdf.md index 5f1c096292af5284e2fb2060ff5b8d3a0e90ade8..aea62237a5e3c29bbc2c5877b944f6f866767de0 100644 --- a/zh-cn/react-native-view-pdf.md +++ b/zh-cn/react-native-view-pdf.md @@ -21,8 +21,8 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | | <=0.14.0-0.0.2@deprecated | [@react-native-oh-tpl/react-native-view-pdf Releases(deprecated)](https://github.com/react-native-oh-library/react-native-PDFView/releases) | 0.72 | -| 0.14.1 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-view-pdf/releases) | 0.72 | -| 0.15.0 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-view-pdf/releases) | 0.77 | +| 0.14.1 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-pdfview/releases) | 0.72 | +| 0.15.0 | [@react-native-ohos/react-native-view-pdf Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-pdfview/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 diff --git a/zh-cn/react-native-zip-archive.md b/zh-cn/react-native-zip-archive.md index ef30591714a4e733f95d385da205218d2f55d6a6..e6e1cb4d0f833945fb9f593f0f85b67bf9198602 100644 --- a/zh-cn/react-native-zip-archive.md +++ b/zh-cn/react-native-zip-archive.md @@ -15,40 +15,36 @@ > [!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包。 -## 安装与使用 + 进入到工程目录并输入以下命令: -#### **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 +415,16 @@ 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 +452,6 @@ 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 +475,8 @@ ohpm install ### 3.配置 CMakeLists 和引入zipArchive +> 若使用的是 <= 6.1.1-0.1.0 版本,请跳过本章。 + 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff @@ -511,18 +502,12 @@ 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 +549,7 @@ 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 +577,13 @@ 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; +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