From 3022b75a28fbdf71599592215cde5fece316fc9a Mon Sep 17 00:00:00 2001 From: wangqiuyun1126 <727176064@qq.com> Date: Sat, 22 Nov 2025 17:48:31 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#ID7VS4]=20=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93=E9=80=82=E9=85=8Dcli=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=9C=80=E6=B1=827=E4=B8=AA=E4=B8=89=E6=96=B9=E5=BA=93?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqiuyun1126 <727176064@qq.com> --- en/klarna-platform-colors.md | 37 ++++-- en/react-native-background-fetch.md | 97 +++++++++++++-- en/react-native-document-picker.md | 27 +++-- en/react-native-print.md | 35 ++++-- en/react-native-securerandom.md | 33 ++++-- en/react-native-shake.md | 156 +++++++++++++++++++------ en/react-native-ssl-pinning.md | 38 ++++-- zh-cn/klarna-platform-colors.md | 36 ++++-- zh-cn/react-native-background-fetch.md | 50 +++----- zh-cn/react-native-document-picker.md | 29 +++-- zh-cn/react-native-print.md | 35 ++++-- zh-cn/react-native-securerandom.md | 33 ++++-- zh-cn/react-native-shake.md | 46 +++----- zh-cn/react-native-ssl-pinning.md | 42 ++++--- 14 files changed, 489 insertions(+), 205 deletions(-) diff --git a/en/klarna-platform-colors.md b/en/klarna-platform-colors.md index 7f54d4158..59d2e243e 100644 --- a/en/klarna-platform-colors.md +++ b/en/klarna-platform-colors.md @@ -17,7 +17,15 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/platform-colors Releases](https://github.com/react-native-oh-library/platform-colors/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 + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.4.0@deprecated | [@react-native-oh-tpl/platform-colors Releases(deprecated)](https://github.com/react-native-oh-library/platform-colors/releases) | 0.72 | +| 0.4.1 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.72 | +| 0.5.0 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/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. Go to the project directory and execute the following instruction: @@ -28,19 +36,19 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/platform-colors +npm install @react-native-ohos/platform-colors ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/platform-colors +yarn add @react-native-ohos/platform-colors ``` Generate resource files: ```bash -npx @react-native-oh-tpl/platform-colors +npx @react-native-ohos/platform-colors ``` > [!TIP] The first time you run the command it will prompt you which platforms you want to generate files for which will create a file with the following format: @@ -81,7 +89,7 @@ You need to re-run the command after each change to the config to update the gen After generating the resource files, it is necessary to copy the two color files generated in Harmony/AppScope/resources/to the corresponding directory of the Harmony project. ```bash -npx @react-native-oh-tpl/platform-colors +npx @react-native-ohos/platform-colors ``` @@ -175,11 +183,16 @@ const styles = StyleSheet.create({ ## Use Codegen +Version >= @react-native-ohos/platform-colors@0.4.1, 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/platform-colors@0.4.1 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. @@ -207,7 +220,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/platform-colors": "file:../../node_modules/@react-native-oh-tpl/platform-colors/harmony/platform_colors.har" + "@react-native-ohos/platform-colors": "file:../../node_modules/@react-native-ohos/platform-colors/harmony/platform_colors.har" } ``` @@ -230,7 +243,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import { RNPlatformColorsPackage } from '@react-native-oh-tpl/platform-colors/ts'; ++ import { RNPlatformColorsPackage } from '@react-native-ohos/platform-colors/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -259,7 +272,13 @@ Then build and run the code. To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/platform-colors Releases](https://github.com/react-native-oh-library/platform-colors/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.4.0@deprecated | [@react-native-oh-tpl/platform-colors Releases(deprecated)](https://github.com/react-native-oh-library/platform-colors/releases) | 0.72 | +| 0.4.1 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.72 | +| 0.5.0 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.77 | ## Properties diff --git a/en/react-native-background-fetch.md b/en/react-native-background-fetch.md index cdaa2c24c..aa14469b7 100644 --- a/en/react-native-background-fetch.md +++ b/en/react-native-background-fetch.md @@ -17,24 +17,30 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-background-fetch Releases](https://github.com/react-native-oh-library/react-native-background-fetch/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 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 4.2.5@deprecated | [@react-native-oh-tpl/react-native-background-fetch Releases(deprecated)](https://github.com/react-native-oh-library/react-native-background-fetch/releases) | 0.72 | +| 4.2.6 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.72 | +| 4.3.0 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/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. +Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-background-fetch +npm install @react-native-ohos/react-native-background-fetch ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-background-fetch +yarn add @react-native-ohos/react-native-background-fetch ``` @@ -200,11 +206,16 @@ export default App; ## Use Codegen +Version >= @react-native-ohos/react-native-background-fetch@4.2.6, 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-background-fetch@4.2.6 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. @@ -232,7 +243,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-background-fetch": "file:../../node_modules/@react-native-oh-tpl/react-native-background-fetch/harmony/background_fetch.har" + "@react-native-ohos/react-native-background-fetch": "file:../../node_modules/@react-native-ohos/react-native-background-fetch/harmony/background_fetch.har" } ``` @@ -249,13 +260,71 @@ Method 2: Directly link to the source code. > [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). +### Configure CMakeLists and import RNBackgroundFetchPackage + +> [!TIP] If using version 4.2.6, please configure CMakeLists and import ShakePackge + +open `entry/src/main/cpp/CMakeLists.txt`,add: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-background-fetch/src/main/cpp" ./background_fetch) +# RNOH_END: manual_package_linking_1 + +file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_background_fetch) +# RNOH_END: manual_package_linking_2 +``` + +open `entry/src/main/cpp/PackageProvider.cpp`,add: + +```diff +#include "RNOH/PackageProvider.h" ++ #include "RNBackgroundFetchPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) +{ + return { ++ std::make_shared(ctx) + }; +} +``` + ### Introducing RNBackgroundFetchPackage to ArkTS Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... -+ import { RNBackgroundFetchPackage } from "@react-native-oh-tpl/react-native-background-fetch/ts"; ++ import { RNBackgroundFetchPackage } from "@react-native-ohos/react-native-background-fetch/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -267,11 +336,11 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ### Introducing RNBackgroundFetchExtensionAbility to ArkTS -1. 打开 `entry/src/main/ets`,新建目录及 ArkTS 文件,新建一个目录并命名为 WorkSchedulerExtension。在 WorkSchedulerExtension 目录下,新建一个 ArkTS 文件并命名为 WorkSchedulerExtension.ets,用以实现延迟任务回调接口。 +1. Open'entry/src/main/ets', create a new directory and ArkTS file, and create a new directory and name it WorkSchedulerExtension. In the WorkSchedulerExtension directory, create an ArkTS file and name it WorkSchedulerExtension.ets to implement the delayed task callback interface. ```js import { workScheduler } from "@kit.BackgroundTasksKit"; -import RNBackgroundFetchExtensionAbility from "@react-native-oh-tpl/react-native-background-fetch/src/main/ets/WorkSchedulerExtension/WorkSchedulerExtension"; +import RNBackgroundFetchExtensionAbility from "@react-native-ohos/react-native-background-fetch/src/main/ets/WorkSchedulerExtension/WorkSchedulerExtension"; export default class MyWorkSchedulerExtensionAbility extends RNBackgroundFetchExtensionAbility { onWorkStart(workInfo: workScheduler.WorkInfo) { @@ -284,7 +353,7 @@ export default class MyWorkSchedulerExtensionAbility extends RNBackgroundFetchEx } ``` -2. 在`entry/src/main/module.json5`配置文件中注册 WorkSchedulerExtensionAbility,并设置如下标签: +2. Register WorkSchedulerExtensionAbility in the `entry/src/main/module.json5` configuration file and set the following tags: ```json { @@ -319,7 +388,13 @@ Then build and run the code. To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-background-fetch Releases](https://github.com/react-native-oh-library/react-native-background-fetch/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 4.2.5@deprecated | [@react-native-oh-tpl/react-native-background-fetch Releases(deprecated)](https://github.com/react-native-oh-library/react-native-background-fetch/releases) | 0.72 | +| 4.2.6 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.72 | +| 4.3.0 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.77 | ## API diff --git a/en/react-native-document-picker.md b/en/react-native-document-picker.md index 639c34335..c51b86e82 100644 --- a/en/react-native-document-picker.md +++ b/en/react-native-document-picker.md @@ -4,17 +4,19 @@

react-native-document-picker

+> [!tip] [GitHub address](https://github.com/react-native-documents/document-picker) -This project is based on [react-native-document-picker@9.2.0](https://github.com/react-native-documents/document-picker/tree/v9.2.0). +## 1. Installation and Usage -This third-party library has been migrated to Gitee and is now available for direct download from npm, the new package name is: `@react-native-ohos/react-native-document-picker`, The version correspondence details are as follows: -| Version | Package Name | Repository | Release | -| ------------------------------ | ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| <= 9.2.0@deprecated | @react-native-oh-tpl/react-native-document-picker | [Github(deprecated)](https://github.com/react-native-oh-library/document-picker) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/document-picker/releases) | -| > 9.2.0 | @react-native-ohos/react-native-document-picker | [Gitcode](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker) | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | +Please refer to the Releases page of the third-party library for the corresponding version information +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 9.2.0@deprecated | [@react-native-oh-tpl/react-native-document-picker Releases(deprecated)](https://github.com/react-native-oh-library/document-picker/releases) | 0.72 | +| 9.2.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.72 | +| 9.3.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.77 | -## 1. Installation and Usage +For older versions not published on npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package. Go to the project directory and execute the following instruction: @@ -312,6 +314,9 @@ const styles = StyleSheet.create({ ## 2. Manual Link +Version >= @react-native-ohos/react-native-document-picker@9.2.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. @@ -428,7 +433,13 @@ Then build and run the code. ## 3. Constraints ### 3.1 Compatibility -Check the release version information in the release address of the third-party library:[@react-native-ohos/react-native-document-picker Releases](https://gitee.com/openharmony-sig/rntpc_react-native-document-picker/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 9.2.0@deprecated | [@react-native-oh-tpl/react-native-document-picker Releases(deprecated)](https://github.com/react-native-oh-library/document-picker/releases) | 0.72 | +| 9.2.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.72 | +| 9.3.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.77 | ## 4. Properties diff --git a/en/react-native-print.md b/en/react-native-print.md index a2b58a95a..4f8d8b318 100644 --- a/en/react-native-print.md +++ b/en/react-native-print.md @@ -16,7 +16,15 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-print Releases](https://github.com/react-native-oh-library/react-native-print/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 + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.11.0@deprecated | [@react-native-oh-tpl/react-native-print Releases(deprecated)](https://github.com/react-native-oh-library/react-native-print/releases) | 0.72 | +| 0.11.1 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.72 | +| 0.12.0 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/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. Go to the project directory and execute the following instruction: @@ -27,13 +35,13 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-print +npm install @react-native-ohos/react-native-print ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-print +yarn add @react-native-ohos/react-native-print ``` @@ -42,7 +50,7 @@ The following code shows the basic use scenario of the repository: > [!WARNING] The name of the imported repository remains unchanged. -> [!TIP] This example depends on the react-native-document-picker library. For details, see [@react-native-oh-tpl/react-native-document-picker document](/en/react-native-document-picker.md). +> [!TIP] This example depends on the react-native-document-picker library. For details, see [@react-native-ohos/react-native-document-picker document](/en/react-native-document-picker.md). ```js import React, {useState} from 'react'; @@ -112,11 +120,16 @@ export default function RNPrint(): JSX.Element { ## Use Codegen +Version >= @react-native-ohos/react-native-print@0.11.1, 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](/zh-cn/codegen.md). ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-print@0.11.1 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. @@ -144,7 +157,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-print": "file:../../node_modules/@react-native-oh-tpl/react-native-print/harmony/print.har" + "@react-native-ohos/react-native-print": "file:../../node_modules/@react-native-ohos/react-native-print/harmony/print.har" } ``` @@ -167,7 +180,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import {RNPrintPackage} from '@react-native-oh-tpl/react-native-print/ts'; ++ import {RNPrintPackage} from '@react-native-ohos/react-native-print/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -196,7 +209,13 @@ Then build and run the code. To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-print Releases](https://github.com/react-native-oh-library/react-native-print/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.11.0@deprecated | [@react-native-oh-tpl/react-native-print Releases(deprecated)](https://github.com/react-native-oh-library/react-native-print/releases) | 0.72 | +| 0.11.1 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.72 | +| 0.12.0 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.77 | ### Permission Requirements diff --git a/en/react-native-securerandom.md b/en/react-native-securerandom.md index d189115fd..5f4d1338e 100644 --- a/en/react-native-securerandom.md +++ b/en/react-native-securerandom.md @@ -17,7 +17,15 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-library/react-native-securerandom Releases](https://github.com/react-native-oh-library/react-native-securerandom/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 + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.0.1@deprecated | [@react-native-oh-tpl/react-native-securerandom Releases(deprecated)](https://github.com/react-native-oh-library/react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/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. Go to the project directory and execute the following instruction: @@ -28,13 +36,13 @@ Go to the project directory and execute the following instruction: #### npm ```bash -npm install @react-native-oh-tpl/react-native-securerandom +npm install @react-native-ohos/react-native-securerandom ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-securerandom +yarn add @react-native-ohos/react-native-securerandom ``` @@ -111,11 +119,16 @@ const styles = StyleSheet.create({ ### Use Codegen +Version >= @react-native-ohos/react-native-securerandom@1.0.2, 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-securerandom@1.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. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -143,7 +156,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-securerandom": "file:../../node_modules/@react-native-oh-tpl/react-native-securerandom/harmony/secure_random.har" + "@react-native-ohos/react-native-securerandom": "file:../../node_modules/@react-native-ohos/react-native-securerandom/harmony/secure_random.har" } ``` @@ -166,7 +179,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import { SecureRandomPackage } from '@react-native-oh-tpl/react-native-securerandom/ts'; ++ import { SecureRandomPackage } from '@react-native-ohos/react-native-securerandom/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -195,7 +208,13 @@ Then build and run the code. To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-securerandom Releases](https://github.com/react-native-oh-library/react-native-securerandom/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.0.1@deprecated | [@react-native-oh-tpl/react-native-securerandom Releases(deprecated)](https://github.com/react-native-oh-library/react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.77 | ## API diff --git a/en/react-native-shake.md b/en/react-native-shake.md index da31c14e6..cfe5a4ea3 100644 --- a/en/react-native-shake.md +++ b/en/react-native-shake.md @@ -16,7 +16,15 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-shake Releases](https://github.com/react-native-oh-library/react-native-shake/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 + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 5.6.2@deprecated | [@react-native-oh-tpl/react-native-shake Releases(deprecated)](https://github.com/react-native-oh-library/react-native-shake/releases) | 0.72 | +| 5.6.3 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/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. Go to the project directory and execute the following instruction: @@ -27,13 +35,13 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-shake +npm install @react-native-ohos/react-native-shake ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-shake +yarn add @react-native-ohos/react-native-shake ``` @@ -43,42 +51,62 @@ The following code shows the basic use scenario of the repository: > [!WARNING] The name of the imported repository remains unchanged. ```js -import React, { useState } from "react"; -import { Text, View } from "react-native"; -import RNShake from "react-native-shake"; +import React, { useState } from 'react'; +import { Text, View, StyleSheet } from 'react-native' +import RNShake from 'react-native-shake'; export function ShakeExample() { - const [result, setResult] = useState < string > ""; - myComponent(setResult); - return ( - - shake your phone - {result} - - ); + const [result, setResult] = useState('') + myComponent(setResult) + return ( + + shake(摇晃手机) + {result} + + ) } -export const myComponent = ( - setResult: React.Dispatch> -) => { - React.useEffect(() => { - const subscription = RNShake.addListener(() => { - setResult("shake listen success"); - }); - return () => { - subscription.remove(); - }; - }, []); -}; -``` - -## Use Codegen +export const myComponent = (setResult: React.Dispatch>) => { + React.useEffect(() => { + const subscription = RNShake.addListener(() => { + setResult('shake listen success') + }) + return () => { + subscription.remove() + } + }, []) +} -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). +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: 'white', + width: '100%', + justifyContent: 'center', + alignItems: 'center', + padding: 20 + }, + title: { + fontSize: 18, + fontWeight: 'bold', + marginBottom: 15, + textAlign: 'center' + }, + resultText: { + fontSize: 16, + color: '#2196F3', + textAlign: 'center', + marginTop: 10 + } +}); +``` ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-shake@5.6.3 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. @@ -106,7 +134,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-shake": "file:../../node_modules/@react-native-oh-tpl/react-native-shake/harmony/shake_package.har" + "@react-native-ohos/react-native-shake": "file:../../node_modules/@react-native-ohos/react-native-shake/harmony/shake_package.har" } ``` @@ -129,8 +157,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... - -+ import { ShakePackage } from "@react-native-oh-tpl/react-native-shake/ts"; ++ import { ShakePackage } from "@react-native-ohos/react-native-shake/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -140,7 +167,58 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 4. Configure CMakeLists and import ShakePackge + +> [!TIP] If using version 5.6.3, please configure CMakeLists and import ShakePackge + +open `entry/src/main/cpp/CMakeLists.txt`,add: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") ++set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: add_package_subdirectories +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) + ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-shake/src/main/cpp" ./shake_package) +# RNOH_END: add_package_subdirectories + +add_library(rnoh_app SHARED + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) + +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: link_packages +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_shake) +# RNOH_END: link_packages +``` + +open `entry/src/main/cpp/PackageProvider.cpp`,add: + +```diff +#include "RNOH/PackageProvider.h" +#include "SamplePackage.h" ++ #include "ShakePackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), ++ std::make_shared(ctx) + }; +} +``` + +### 5. Running Click the `sync` button in the upper right corner. @@ -159,7 +237,13 @@ Then build and run the code. To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-shake Releases](https://github.com/react-native-oh-library/react-native-shake/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 5.6.2@deprecated | [@react-native-oh-tpl/react-native-shake Releases(deprecated)](https://github.com/react-native-oh-library/react-native-shake/releases) | 0.72 | +| 5.6.3 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.77 | ### Permission Requirements diff --git a/en/react-native-ssl-pinning.md b/en/react-native-ssl-pinning.md index 1b09e765c..4e8e90b9f 100644 --- a/en/react-native-ssl-pinning.md +++ b/en/react-native-ssl-pinning.md @@ -16,23 +16,30 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-safe-ssl-pinning Releases](https://github.com/react-native-oh-library/react-native-ssl-pinning/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.5.7@deprecated | [@react-native-oh-tpl/react-native-ssl-pinning Releases(deprecated)](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) | 0.72 | +| 1.5.8 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.72 | +| 1.6.0 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/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. +Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-spring-scrollview +npm install @react-native-ohos/react-native-ssl-pinning ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-spring-scrollview +yarn add @react-native-ohos/react-native-ssl-pinning ``` @@ -41,7 +48,7 @@ The following code shows the basic use scenario of the repository: > [!WARNING] The name of the imported repository remains unchanged. -> [!TIP] This example relies on react-native-file-selector and is introduced by referring to document [@react-native-oh-tpl/react-native-file-selector](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-file-selector.md). +> [!TIP] This example relies on react-native-file-selector and is introduced by referring to document [@react-native-ohos/react-native-file-selector](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-file-selector.md). ```js @@ -58,7 +65,7 @@ import { } from 'react-native'; import {Colors} from 'react-native/Libraries/NewAppScreen'; import {getCookies, fetch, removeCookieByName} from 'react-native-ssl-pinning'; -import FileSelector from '@react-native-oh-tpl/react-native-file-selector'; +import FileSelector from '@react-native-ohos/react-native-file-selector'; function SslPingDemo() : React.JSX.Element{ return ( <> @@ -235,11 +242,16 @@ export default SslPingDemo; ## Use Codegen +Version >= @react-native-ohos/react-native-ssl-pinning@1.5.8, compatible with codegen-lib for generating bridge code. + 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-ssl-pinning@1.5.8 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. @@ -267,7 +279,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-ssl-pinning": "file:../../node_modules/@react-native-oh-tpl/react-native-ssl-pinning/harmony/ssl_pinning.har" + "@react-native-ohos/react-native-ssl-pinning": "file:../../node_modules/@react-native-ohos/react-native-ssl-pinning/harmony/ssl_pinning.har" } ``` @@ -290,7 +302,7 @@ Open the entry/src/main/ets/RNPackagesFactory.ts file and add the following code ```diff ... -+ import { SslPinningPackage } from "@react-native-oh-tpl/react-native-ssl-pinning/ts" ++ import { SslPinningPackage } from "@react-native-ohos/react-native-ssl-pinning/ts" export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -318,7 +330,13 @@ Then build and run the code. ### 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. -Check the release version information in the release address of the third-party library::[@react-native-oh-tpl/react-native-ssl-pinning Releases](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) +Please refer to the Releases page of the third-party library for the corresponding version information + +| Third-party Library Version | Release Information | Supported RN Version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.5.7@deprecated | [@react-native-oh-tpl/react-native-ssl-pinning Releases(deprecated)](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) | 0.72 | +| 1.5.8 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.72 | +| 1.6.0 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.77 | ### Permission Requirements diff --git a/zh-cn/klarna-platform-colors.md b/zh-cn/klarna-platform-colors.md index 2a2be928c..42b211d37 100644 --- a/zh-cn/klarna-platform-colors.md +++ b/zh-cn/klarna-platform-colors.md @@ -17,7 +17,15 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/platform-colors Releases](https://github.com/react-native-oh-library/platform-colors/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 0.4.0@deprecated | [@react-native-oh-tpl/platform-colors Releases(deprecated)](https://github.com/react-native-oh-library/platform-colors/releases) | 0.72 | +| 0.4.1 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.72 | +| 0.5.0 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -26,19 +34,19 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/platform-colors +npm install @react-native-ohos/platform-colors ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/platform-colors +yarn add @react-native-ohos/platform-colors ``` 生成资源文件: ```bash -npx @react-native-oh-tpl/platform-colors +npx @react-native-ohos/platform-colors ``` > [!TIP] 第一次运行该命令时,它将提示您要为哪些平台生成文件,确定后将在工程根目录创建具有以下格式的文件: @@ -79,7 +87,7 @@ module.exports = { 资源文件生成后需要将harmony/AppScope/resources/内的生成的2个color文件复制到harmony工程的对应目录下。 ```bash -npx @react-native-oh-tpl/platform-colors +npx @react-native-ohos/platform-colors ``` @@ -173,11 +181,15 @@ const styles = StyleSheet.create({ ## 使用 Codegen +Version >= @react-native-ohos/platform-colors@0.4.1,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/platform-colors@0.4.1,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony` @@ -208,7 +220,7 @@ const styles = StyleSheet.create({ ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/platform-colors": "file:../../node_modules/@react-native-oh-tpl/platform-colors/harmony/platform_colors.har" + "@react-native-ohos/platform-colors": "file:../../node_modules/@react-native-ohos/platform-colors/harmony/platform_colors.har" } ``` @@ -231,7 +243,7 @@ ohpm install ```diff ... -+ import { RNPlatformColorsPackage } from '@react-native-oh-tpl/platform-colors/ts'; ++ import { RNPlatformColorsPackage } from '@react-native-ohos/platform-colors/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -260,7 +272,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/platform-colors Releases](https://github.com/react-native-oh-library/platform-colors/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 0.4.0@deprecated | [@react-native-oh-tpl/platform-colors Releases(deprecated)](https://github.com/react-native-oh-library/platform-colors/releases) | 0.72 | +| 0.4.1 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.72 | +| 0.5.0 | [@react-native-ohos/platform-colors Releases](https://gitcode.com/openharmony-sig/rntpc_platform-colors/releases) | 0.77 | ## 属性 diff --git a/zh-cn/react-native-background-fetch.md b/zh-cn/react-native-background-fetch.md index cb89ab17a..60ae4d7db 100644 --- a/zh-cn/react-native-background-fetch.md +++ b/zh-cn/react-native-background-fetch.md @@ -21,8 +21,11 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 4.2.5 | [@react-native-oh-tpl/react-native-background-fetch Releases](https://github.com/react-native-oh-library/react-native-background-fetch/releases) | 0.72 | -| 4.2.8 | [@react-native-ohos/react-native-background-fetch Releases]() | 0.77 | +| 4.2.5@deprecated | [@react-native-oh-tpl/react-native-background-fetch Releases(deprecated)](https://github.com/react-native-oh-library/react-native-background-fetch/releases) | 0.72 | +| 4.2.6 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.72 | +| 4.3.0 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -31,20 +34,12 @@ #### **npm** ```bash -# V4.2.5 -npm install @react-native-oh-tpl/react-native-background-fetch - -# V4.2.8 npm install @react-native-ohos/react-native-background-fetch ``` #### **yarn** ```bash -# V4.2.5 -yarn add @react-native-oh-tpl/react-native-background-fetch - -# V4.2.8 yarn add @react-native-ohos/react-native-background-fetch ``` @@ -211,13 +206,15 @@ export default App; ## 使用 Codegen -> [!TIP] V4.2.8 不需要执行 Codegen。 +Version >= @react-native-ohos/react-native-background-fetch@4.2.6,已适配codegen-lib生成桥接代码。 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-background-fetch@4.2.6,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony` @@ -245,17 +242,6 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 -- V4.2.5 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-background-fetch": "file:../../node_modules/@react-native-oh-tpl/react-native-background-fetch/harmony/background_fetch.har" - } -``` - -- V4.2.8 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -278,7 +264,7 @@ ohpm install ### 配置 CMakeLists 和引入 RNBackgroundFetchPackage -> [!TIP] V4.2.8 需要配置CMakeLists 和引入 RNBackgroundFetchPackage。 +> [!TIP] V4.2.6 需要配置CMakeLists 和引入 RNBackgroundFetchPackage。 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -340,10 +326,6 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... -// V4.2.5 -+ import { RNBackgroundFetchPackage } from "@react-native-oh-tpl/react-native-background-fetch/ts"; - -// V4.2.8 + import { RNBackgroundFetchPackage } from "@react-native-ohos/react-native-background-fetch/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -360,11 +342,6 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ```js import { workScheduler } from "@kit.BackgroundTasksKit"; - -// V4.2.5 -import RNBackgroundFetchExtensionAbility from "@react-native-oh-tpl/react-native-background-fetch/src/main/ets/WorkSchedulerExtension/WorkSchedulerExtension"; - -// V4.2.8 import RNBackgroundFetchExtensionAbility from "@react-native-ohos/react-native-background-fetch/src/main/ets/WorkSchedulerExtension/WorkSchedulerExtension"; export default class MyWorkSchedulerExtensionAbility extends RNBackgroundFetchExtensionAbility { @@ -415,12 +392,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 4.2.5 | [@react-native-oh-tpl/react-native-background-fetch Releases](https://github.com/react-native-oh-library/react-native-background-fetch/releases) | 0.72 | -| 4.2.8 | [@react-native-ohos/react-native-background-fetch Releases]() | 0.77 | +| 4.2.5@deprecated | [@react-native-oh-tpl/react-native-background-fetch Releases(deprecated)](https://github.com/react-native-oh-library/react-native-background-fetch/releases) | 0.72 | +| 4.2.6 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.72 | +| 4.3.0 | [@react-native-ohos/react-native-background-fetch Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-background-fetch/releases) | 0.77 | ## API diff --git a/zh-cn/react-native-document-picker.md b/zh-cn/react-native-document-picker.md index 5e1198ab8..df76dcf49 100644 --- a/zh-cn/react-native-document-picker.md +++ b/zh-cn/react-native-document-picker.md @@ -4,23 +4,22 @@

react-native-document-picker

+> [!TIP] [Github 地址](https://github.com/react-native-documents/document-picker) -本项目基于 [react-native-document-picker@9.2.0](https://github.com/react-native-documents/document-picker/tree/v9.2.0) 开发。 - -该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/react-native-document-picker`,具体版本所属关系如下: +## 1. 安装与使用 -| Version | Package Name | Repository | Release | -| ------------------------------ | ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| <= 9.2.0@deprecated | @react-native-oh-tpl/react-native-document-picker | [Github(deprecated)](https://github.com/react-native-oh-library/document-picker) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/document-picker/releases) | -| > 9.2.0 | @react-native-ohos/react-native-document-picker | [Gitcode](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker) | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | +请到三方库的 Releases 发布地址查看配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 9.2.0@deprecated | [@react-native-oh-tpl/react-native-document-picker Releases(deprecated)](https://github.com/react-native-oh-library/document-picker/releases) | 0.72 | +| 9.2.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.72 | +| 9.3.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.77 | -## 1. 安装与使用 +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: - - #### npm @@ -252,6 +251,8 @@ const styles = StyleSheet.create({ ## 2. Manual Link +Version >= @react-native-ohos/react-native-document-picker@9.2.2,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + 此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。 @@ -371,7 +372,13 @@ ohpm install ## 3. 约束与限制 ### 3.1 兼容性 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/react-native-document-picker Releases](https://gitee.com/openharmony-sig/rntpc_react-native-document-picker/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 9.2.0@deprecated | [@react-native-oh-tpl/react-native-document-picker Releases(deprecated)](https://github.com/react-native-oh-library/document-picker/releases) | 0.72 | +| 9.2.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.72 | +| 9.3.2 | [@react-native-ohos/react-native-document-picker Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-document-picker/releases) | 0.77 | ## 4. 属性 diff --git a/zh-cn/react-native-print.md b/zh-cn/react-native-print.md index 34f390ffd..92fc1aa4a 100644 --- a/zh-cn/react-native-print.md +++ b/zh-cn/react-native-print.md @@ -16,7 +16,15 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-print Releases](https://github.com/react-native-oh-library/react-native-print/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 0.11.0@deprecated | [@react-native-oh-tpl/react-native-print Releases(deprecated)](https://github.com/react-native-oh-library/react-native-print/releases) | 0.72 | +| 0.11.1 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.72 | +| 0.12.0 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +33,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-print +npm install @react-native-ohos/react-native-print ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-print +yarn add @react-native-ohos/react-native-print ``` @@ -40,7 +48,7 @@ yarn add @react-native-oh-tpl/react-native-print > [!WARNING] 使用时 import 的库名不变。 -> [!TIP] 本示例依赖 react-native-document-picker 库,参照[@react-native-oh-tpl/react-native-document-picker 文档](/zh-cn/react-native-document-picker.md)进行引入。 +> [!TIP] 本示例依赖 react-native-document-picker 库,参照[@react-native-ohos/react-native-document-picker 文档](/zh-cn/react-native-document-picker.md)进行引入。 ```js import React, {useState} from 'react'; @@ -110,11 +118,16 @@ export default function RNPrint(): JSX.Element { ## 使用 Codegen +Version >= @react-native-ohos/react-native-print@0.11.1,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-print@0.11.1,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -145,7 +158,7 @@ export default function RNPrint(): JSX.Element { ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-print": "file:../../node_modules/@react-native-oh-tpl/react-native-print/harmony/print.har" + "@react-native-ohos/react-native-print": "file:../../node_modules/@react-native-ohos/react-native-print/harmony/print.har" } ``` @@ -168,7 +181,7 @@ ohpm install ```diff ... -+ import {RNPrintPackage} from '@react-native-oh-tpl/react-native-print/ts'; ++ import {RNPrintPackage} from '@react-native-ohos/react-native-print/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -197,7 +210,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-print Releases](https://github.com/react-native-oh-library/react-native-print/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 0.11.0@deprecated | [@react-native-oh-tpl/react-native-print Releases(deprecated)](https://github.com/react-native-oh-library/react-native-print/releases) | 0.72 | +| 0.11.1 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.72 | +| 0.12.0 | [@react-native-ohos/react-native-print Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-print/releases) | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-securerandom.md b/zh-cn/react-native-securerandom.md index c4522c24a..2d3098016 100644 --- a/zh-cn/react-native-securerandom.md +++ b/zh-cn/react-native-securerandom.md @@ -17,7 +17,15 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-securerandom Releases](https://github.com/react-native-oh-library/react-native-securerandom/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ------------- | ------------------------------------------------------------ | ---------- | +| 1.0.1@deprecated | [@react-native-oh-tpl/react-native-securerandom Releases(deprecated)](https://github.com/react-native-oh-library/react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -27,13 +35,13 @@ #### npm ```bash -npm install @react-native-oh-tpl/react-native-securerandom +npm install @react-native-ohos/react-native-securerandom ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-securerandom +yarn add @react-native-ohos/react-native-securerandom ``` @@ -83,11 +91,16 @@ const styles = StyleSheet.create({ ``` ### 使用 Codegen +Version >= @react-native-ohos/react-native-securerandom@1.0.2,已适配codegen-lib生成桥接代码。 + 本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen](/zh-cn/link-source-code.md) 使用文档。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-securerandom@1.0.2,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -118,7 +131,7 @@ const styles = StyleSheet.create({ ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-securerandom": "file:../../node_modules/@react-native-oh-tpl/react-native-securerandom/harmony/secure_random.har" + "@react-native-ohos/react-native-securerandom": "file:../../node_modules/@react-native-ohos/react-native-securerandom/harmony/secure_random.har" } ``` @@ -141,7 +154,7 @@ ohpm install ```diff ... -+ import { SecureRandomPackage } from '@react-native-oh-tpl/react-native-securerandom/ts'; ++ import { SecureRandomPackage } from '@react-native-ohos/react-native-securerandom/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -170,7 +183,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-securerandom Releases](https://github.com/react-native-oh-library/react-native-securerandom/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ------------- | ------------------------------------------------------------ | ---------- | +| 1.0.1@deprecated | [@react-native-oh-tpl/react-native-securerandom Releases(deprecated)](https://github.com/react-native-oh-library/react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.72 | +| 1.0.2 | [@react-native-ohos/react-native-securerandom Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-securerandom/releases) | 0.77 | ## API diff --git a/zh-cn/react-native-shake.md b/zh-cn/react-native-shake.md index dced8811d..f0f49c29f 100644 --- a/zh-cn/react-native-shake.md +++ b/zh-cn/react-native-shake.md @@ -20,8 +20,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ------------- | ------------------------------------------------------------ | ---------- | -| 5.6.2 | [@react-native-oh-tpl/react-native-shake Releases](https://github.com/react-native-oh-library/react-native-shake/releases) | 0.72 | -| v6.0.0-beta.2 | [@react-native-ohos/react-native-shake Releases]() | 0.77 | +| 5.6.2@deprecated | [@react-native-oh-tpl/react-native-shake Releases(deprecated)](https://github.com/react-native-oh-library/react-native-shake/releases) | 0.72 | +| 5.6.3 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -33,20 +34,12 @@ #### **npm** ```bash -# V5.6.2 -npm install @react-native-oh-tpl/react-native-shake - -# V6.0.0-beta.2 npm install @react-native-ohos/react-native-shake ``` #### **yarn** ```bash -# V5.6.2 -yarn add @react-native-oh-tpl/react-native-shake - -# V6.0.0-beta.2 yarn add @react-native-ohos/react-native-shake ``` @@ -110,7 +103,10 @@ const styles = StyleSheet.create({ ## Link -目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-shake@5.6.3,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony` @@ -138,22 +134,9 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 -- V5.6.2 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - - "@react-native-oh-tpl/react-native-shake": "file:../../node_modules/@react-native-oh-tpl/react-native-shake/harmony/shake_package.har" - } -``` - -- V6.0.0-beta.2 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-ohos/react-native-shake": "file:../../node_modules/@react-native-ohos/react-native-shake/harmony/shake_package.har" } ``` @@ -178,10 +161,6 @@ ohpm install ```diff ... -// V5.6.2 -+ import { ShakePackage } from "@react-native-oh-tpl/react-native-shake/ts"; - -// V6.0.0-beta.2 + import { ShakePackage } from "@react-native-ohos/react-native-shake/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -194,7 +173,9 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ### 4.配置 CMakeLists 和引入 ShakePackge -> [!TIP] V6.0.0-beta.2 需要配置 CMakeLists 和引入 ShakePackge。 +> [!TIP] V5.6.3 需要配置 CMakeLists 和引入 ShakePackge。 + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff project(rnapp) @@ -261,12 +242,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ------------- | ------------------------------------------------------------ | ---------- | -| 5.6.2 | [@react-native-oh-tpl/react-native-shake Releases](https://github.com/react-native-oh-library/react-native-shake/releases) | 0.72 | -| v6.0.0-beta.2 | [@react-native-ohos/react-native-shake Releases]() | 0.77 | +| 5.6.2@deprecated | [@react-native-oh-tpl/react-native-shake Releases(deprecated)](https://github.com/react-native-oh-library/react-native-shake/releases) | 0.72 | +| 5.6.3 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-shake Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-shake/releases) | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-ssl-pinning.md b/zh-cn/react-native-ssl-pinning.md index 0c19101c3..1f7613120 100644 --- a/zh-cn/react-native-ssl-pinning.md +++ b/zh-cn/react-native-ssl-pinning.md @@ -16,7 +16,15 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-ssl-pinning Releases](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 1.5.7@deprecated | [@react-native-oh-tpl/react-native-ssl-pinning Releases(deprecated)](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) | 0.72 | +| 1.5.8 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.72 | +| 1.6.0 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +33,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-ssl-pinning +npm install @react-native-ohos/react-native-ssl-pinning ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-ssl-pinning +yarn add @react-native-ohos/react-native-ssl-pinning ``` @@ -40,7 +48,7 @@ yarn add @react-native-oh-tpl/react-native-ssl-pinning > [!WARNING] 使用时 import 的库名不变。 -> [!TIP] 本示例依赖 react-native-file-selector 库,参照 [@react-native-oh-tpl/react-native-file-selector](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-file-selector.md) 文档进行引入。 +> [!TIP] 本示例依赖 react-native-file-selector 库,参照 [@react-native-ohos/react-native-file-selector](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-file-selector.md) 文档进行引入。 ```js @@ -57,7 +65,7 @@ import { } from 'react-native'; import {Colors} from 'react-native/Libraries/NewAppScreen'; import {getCookies, fetch, removeCookieByName} from 'react-native-ssl-pinning'; -import FileSelector from '@react-native-oh-tpl/react-native-file-selector'; +import FileSelector from '@react-native-ohos/react-native-file-selector'; function SslPingDemo() : React.JSX.Element{ return ( <> @@ -234,11 +242,16 @@ export default SslPingDemo; ## 使用 Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/codegen.md)。 +Version >= @react-native-ohos/react-native-ssl-pinning@1.5.8,已适配codegen-lib生成桥接代码。 + +本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen 文档](/zh-cn/codegen.md)。 ## Link -目前HarmonyOS暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-ssl-pinning@1.5.8,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的HarmonyOS工程 `harmony` @@ -253,9 +266,6 @@ export default SslPingDemo; } } ``` -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 - -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` ### 2.引入原生端代码 @@ -273,7 +283,7 @@ export default SslPingDemo; ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-ssl-pinning": "file:../../node_modules/@react-native-oh-tpl/react-native-ssl-pinning/harmony/ssl_pinning.har" + "@react-native-ohos/react-native-ssl-pinning": "file:../../node_modules/@react-native-ohos/react-native-ssl-pinning/harmony/ssl_pinning.har" } ``` @@ -303,7 +313,7 @@ ohpm install --no-link ```diff ... -+ import { SslPinningPackage } from "@react-native-oh-tpl/react-native-ssl-pinning/ts" ++ import { SslPinningPackage } from "@react-native-ohos/react-native-ssl-pinning/ts" export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -331,7 +341,13 @@ ohpm install ### 兼容性 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-ssl-pinning Releases](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 1.5.7@deprecated | [@react-native-oh-tpl/react-native-ssl-pinning Releases(deprecated)](https://github.com/react-native-oh-library/react-native-ssl-pinning/releases) | 0.72 | +| 1.5.8 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.72 | +| 1.6.0 | [@react-native-ohos/react-native-ssl-pinning Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-ssl-pinning/releases) | 0.77 | ### 权限要求 -- Gitee