diff --git a/en/react-native-apple-authentication.md b/en/react-native-apple-authentication.md index 85ee5581efd0d817265815bbec7602d6912245aa..fcbb63c5378d4c961fc2af9b47a34c13352479f8 100644 --- a/en/react-native-apple-authentication.md +++ b/en/react-native-apple-authentication.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-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/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 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.3.0@deprecated | [@react-native-oh-tpl/react-native-apple-authentication Releases(deprecated)](https://github.com/react-native-oh-library/react-native-apple-authentication/releases) | 0.72 | +| 2.3.1 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.72 | +| 2.4.2 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/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: @@ -27,13 +35,13 @@ Go to the project directory and execute the following instruction: #### npm ```bash -npm install @react-native-oh-tpl/react-native-apple-authentication +npm install @react-native-ohos/react-native-apple-authentication ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-apple-authentication +yarn add @react-native-ohos/react-native-apple-authentication ``` #### **Configuring Sign in with Apple for the Web** @@ -82,11 +90,16 @@ export default AppleAuthenticationDemo; ## Use Codegen +> [!TIP] V2.3.1 no need to execute Codegen. + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-apple-authentication@2.3.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. @@ -114,7 +127,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-apple-authentication": "file:../../node_modules/@react-native-oh-tpl/react-native-apple-authentication/harmony/react-native-apple-authentication.har" + "@react-native-ohos/react-native-apple-authentication": "file:../../node_modules/@react-native-ohos/react-native-apple-authentication/harmony/react-native-apple-authentication.har" } ``` @@ -131,13 +144,78 @@ Method 2: Directly link to the source code. > [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3. Introducing RNAppleAuthPackage to ArkTS +### 3.Configure CMakeLists and import RNOHAppleAuthenticationPackage + +> V2.3.1 need configure CMakeLists and import RNOHAppleAuthenticationPackage + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") +set(OH_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-apple-authentication/src/main/cpp" ./react-native-apple-authentication) +# RNOH_BEGIN: manual_package_linking_1 + +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_apple_authentication) + +``` + +open `entry/src/main/cpp/PackageProvider.cpp`,add: + +```diff + +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" ++ #include "RNOHAppleAuthenticationPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) +{ + return { + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 4. Introducing RNAppleAuthPackage to ArkTS Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... -+ import { RNAppleAuthPackage } from '@react-native-oh-tpl/react-native-apple-authentication'; ++ import { RNAppleAuthPackage } from '@react-native-ohos/react-native-apple-authentication'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -147,7 +225,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 5. Running Click the `sync` button in the upper right corner. @@ -166,7 +244,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-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/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 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.3.0@deprecated | [@react-native-oh-tpl/react-native-apple-authentication Releases(deprecated)](https://github.com/react-native-oh-library/react-native-apple-authentication/releases) | 0.72 | +| 2.3.1 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.72 | +| 2.4.2 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.77 | ## Properties diff --git a/en/react-native-community-checkbox.md b/en/react-native-community-checkbox.md index b16be2b1c1a428636a0fa8bb5a30b2057c847efa..593f7ad23ad6f113c5b15badccbbd1337b845932 100644 --- a/en/react-native-community-checkbox.md +++ b/en/react-native-community-checkbox.md @@ -4,17 +4,19 @@

@react-native-community/checkbox

-This project is based on [@react-native-community/checkbox](https://github.com/react-native-checkbox/react-native-checkbox). +> [!TIP] [GitHub address][@react-native-community/checkbox](https://github.com/react-native-checkbox/react-native-checkbox). +## 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/checkbox`, The version correspondence details are as follows: +Please refer to the Releases page of the third-party library for the corresponding version information -| Version | Package Name | Repository | Release | -| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | -| <= 0.5.16-0.1.0@deprecated | @react-native-oh-tpl/checkbox | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox/releases) | -| >= 0.5.17 | @react-native-ohos/checkbox | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | +| Third-party Library Version | Release Information | Supported RN Version | +|--------| ------------------------------------------------------------ | ---------- | +| 0.6.0@deprecated | [@react-native-oh-tpl/checkbox Releases(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox/releases) | 0.72 | +| 0.6.1 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.72 | +| 0.5.16 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/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: @@ -65,6 +67,8 @@ export default function CheckBoxExample() { ## 2. Manual Link +Version >= @react-native-ohos/checkbox@0.5.17 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. @@ -73,7 +77,13 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. To ensure the project relies on the same version of the RN SDK, you need to add an `overrides` field in the project's root `oh-package.json5` file, specifying the RN SDK version to be used. The replacement version can be a specific version number, a semver range, or a locally available HAR package or source directory. -For more information about the purpose of this field, please refer to the [official documentation](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-oh-package-json5-V5#en-us_topic_0000001792256137_overrides). +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.6.0@deprecated | [@react-native-oh-tpl/checkbox Releases(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox/releases) | 0.72 | +| 0.6.1 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.72 | +| 0.5.16 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.77 | ```json { @@ -236,7 +246,7 @@ Then build and run the code. ### 3.1. Compatibility -Check the release version information in the release address of the third-party library: [@react-native-ohos/checkbox Releases](https://gitee.com/openharmony-sig/rntpc_react-native-checkbox/releases) +Check the release version information in the release address of the third-party library: [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) ## 4. Properties diff --git a/en/react-native-default-preference.md b/en/react-native-default-preference.md index 7e8da6d8d92f66eca22e9167d29115d8f2c91cc9..2dbf95e76c2ee58fed003c10c8bfb79cc6ad74b0 100644 --- a/en/react-native-default-preference.md +++ b/en/react-native-default-preference.md @@ -16,24 +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-default-preference Releases](https://github.com/react-native-oh-library/react-native-default-preference/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.4.4@deprecated | [@react-native-oh-tpl/react-native-default-preference Releases(deprecated)](https://github.com/react-native-oh-library/react-native-default-preference/releases) | 0.72 | +| 1.4.5 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.72 | +| 1.5.0 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/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-default-preference +npm install @react-native-ohos/react-native-default-preference ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-default-preference +yarn add @react-native-ohos/react-native-default-preference ``` @@ -45,33 +51,23 @@ The following code shows the basic use scenario of the repository: ```js import React from "react"; import { Text, View } from "react-native"; -import DefaultPreference from "react-native-default-preference"; +import DefaultPreference from 'react-native-default-preference'; const App = () => { - const handleSetItem = useCallback((key: string, value: string) => { - RNDefaultPreference.set(key, value); - }, []); - - const handleGetItem = useCallback((key: string) => { - RNDefaultPreference?.get(key).then((res) => { - console.log(res); - }); - }, []); + const handleSetItem = useCallback((key: string, value: string) => { + RNDefaultPreference.set(key, value) + }, []); + + const handleGetItem = useCallback((key: string) => { + RNDefaultPreference?.get(key).then(res => { + console.log(res) + }); + }, []); return ( - - - - + + + + ); }; @@ -80,11 +76,15 @@ export default App; ## Use Codegen +Version >= @react-native-ohos/react-native-default-preference@1.4.5, 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-default-preference@1.4.5 now supports Autolink without requiring manual configuration, currently only supports 72 frameworks. Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -112,7 +112,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-default-preference": "file:../../node_modules/@react-native-oh-tpl/react-native-default-preference/harmony/react_native_default_preference.har" + "@react-native-ohos/react-native-default-preference": "file:../../node_modules/@react-native-ohos/react-native-default-preference/harmony/react_native_default_preference.har" } ``` @@ -136,7 +136,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import { RNDefaultPreferencePackage } from '@react-native-oh-tpl/react-native-default-preference/ts'; ++ import { RNDefaultPreferencePackage } from '@react-native-ohos/react-native-default-preference/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -165,8 +165,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-default-preference Releases](https://github.com/react-native-oh-library/react-native-default-preference/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.4.4@deprecated | [@react-native-oh-tpl/react-native-default-preference Releases(deprecated)](https://github.com/react-native-oh-library/react-native-default-preference/releases) | 0.72 | +| 1.4.5 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.72 | +| 1.5.0 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.77 | ## API diff --git a/en/react-native-fingerprint-scanner.md b/en/react-native-fingerprint-scanner.md index 8e7c7a4d4eeb2aa570cea773909f607cb1c01bc6..2546dff6c70540ad731de43c2cd44ae752b01549 100644 --- a/en/react-native-fingerprint-scanner.md +++ b/en/react-native-fingerprint-scanner.md @@ -16,24 +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-fingerprint-scanner Releases](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/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 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 6.0.0@deprecated | [@react-native-oh-tpl/react-native-fingerprint-scanner Releases(deprecated)](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-fingerprint-scanner Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-fingerprint-scanner/releases) | 0.72 | +| 6.1.0 | [@react-native-ohos/react-native-fingerprint-scanner Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-fingerprint-scanner/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-fingerprint-scanner +npm install @react-native-ohos/react-native-fingerprint-scanner ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-fingerprint-scanner +yarn add @react-native-ohos/react-native-fingerprint-scanner ``` @@ -44,31 +50,42 @@ Quick use: ```js import { View, Button } from "react-native"; -import FingerprintScanner from "react-native-fingerprint-scanner"; +import FingerprintScanner from 'react-native-fingerprint-scanner'; export default function App() { - const handleClick = () => { - FingerprintScanner.isSensorAvailable() - .then((Biometrics) => {}) - .catch((err) => {}); - }; + const handleClick = () => { + FingerprintScanner + .isSensorAvailable() + .then((Biometrics) => { + }).catch((err) => { + }); + } const handleScanner = () => { - FingerprintScanner.authenticate({ title: "1111" }) - .then(() => {}) - .catch((err) => {}); - }; + FingerprintScanner.authenticate({title: '1111'}) + .then(() => { + }).catch((err) => { + }); + } const handleAttempt = () => { - let eror = FingerprintScanner.onAttempt(); - }; + let eror = FingerprintScanner.onAttempt() + } const handleRelease = () => { - FingerprintScanner.release(); - }; + FingerprintScanner.release() + } return ( - - ); + ) })} - ); -}; + ) +} + +export default HapticFeedbackExample; ``` ## Use Codegen +> [!TIP] V2.2.2 no need to execute Codegen + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-haptic-feedback@2.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. @@ -126,8 +162,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-haptic-feedback": "file:../../node_modules/@react-native-oh-tpl/react-native-haptic-feedback/harmony/haptic_feedback.har" - + "@react-native-ohos/react-native-haptic-feedback": "file:../../node_modules/@react-native-ohos/react-native-haptic-feedback/harmony/haptic_feedback.har" } ``` @@ -144,14 +179,74 @@ Method 2: Directly link to the source code. > [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3. Introducing RNHapticFeedbackPackage to ArkTS +### 3. Configure CMakeLists and import RNHapticFeedbackPackage + +> [!TIP] If using version 2.2.1, please skip this chapter + +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-haptic-feedback/src/main/cpp" ./haptic-feedback) +# 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_haptic_feedback) +# RNOH_END: manual_package_linking_2 +``` + +open `entry/src/main/cpp/PackageProvider.cpp`,add: + +```diff +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" +#include "SamplePackage.h" ++ #include "RNHapticFeedbackPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 4. Introducing RNImageColorsPackage to ArkTS Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... - -+ import { RNHapticFeedbackPackage } from '@react-native-oh-tpl/react-native-haptic-feedback/ts' ++ import { RNHapticFeedbackPackage } from '@react-native-ohos/react-native-haptic-feedback/ts' export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -161,7 +256,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 5. Running Click the `sync` button in the upper right corner. @@ -180,12 +275,17 @@ 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-haptic-feedback Releases](https://github.com/react-native-oh-library/react-native-haptic-feedback/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 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.2.1@deprecated | [@react-native-oh-tpl/react-native-haptic-feedback Releases(deprecated)](https://github.com/react-native-oh-library/react-native-haptic-feedback/releases) | 0.72 | +| 2.2.2 | [@react-native-ohos/react-native-haptic-feedback Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-haptic-feedback/releases) | 0.72 | +| 2.3.4 | [@react-native-ohos/react-native-haptic-feedback Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-haptic-feedback/releases) | 0.77 | ### Permission Requirements Add the configuration to the **entry/src/main/module.json5** file. - ```js "requestPermissions": [ { "name": "ohos.permission.VIBRATE" }, ] ``` diff --git a/en/react-native-http-bridge.md b/en/react-native-http-bridge.md index 547f43a6930ad49720a9447f55719a3a2a1f1fc6..331bf3856f84594ef6d0c51b2eca743ea0f9a45e 100644 --- a/en/react-native-http-bridge.md +++ b/en/react-native-http-bridge.md @@ -16,24 +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-http-bridge Releases](https://github.com/react-native-oh-library/react-native-http-bridge/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +Please refer to the Releases page of the third-party library for the corresponding version information -Go to the project directory and execute the following instruction: +| Third-party Library Version | Release Information | Supported RN Version | +|-------| ------------------------------------------------------------ | ---------- | +| 0.6.1@deprecated | [@react-native-oh-tpl/react-native-http-bridge Releases(deprecated)](https://github.com/react-native-oh-library/react-native-http-bridge/releases) | 0.72 | +| 0.6.2 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.72 | +| 0.7.0 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/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-http-bridge +npm install @react-native-ohos/react-native-http-bridge ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-http-bridge +yarn add @react-native-ohos/react-native-http-bridge ``` @@ -141,13 +147,16 @@ export default HttpBridgeDemo; ## Use Codegen +Version >= @react-native-ohos/react-native-http-bridge@0.6.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 -The HarmonyOS implementation of this library depends on the native code from @ohos/polka. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. +Version >= @react-native-ohos/react-native-http-bridge@0.6.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 -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -166,7 +175,8 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. Currently, two methods are available: - +1. Introduced through the har package (this method will be abandoned after the IDE improves the relevant functions, and it is currently the preferred method); +2. Link the source code directly. Method 1 (recommended): Use the HAR file. @@ -177,7 +187,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-http-bridge": "file:../../node_modules/@react-native-oh-tpl/react-native-http-bridge/harmony/http_bridge.har" + "@react-native-ohos/react-native-http-bridge": "file:../../node_modules/@react-native-ohos/react-native-http-bridge/harmony/http_bridge.har" } ``` @@ -200,7 +210,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import { RNHttpBridgePackage } from "@react-native-oh-tpl/react-native-http-bridge/ts"; ++ import { RNHttpBridgePackage } from "@react-native-ohos/react-native-http-bridge/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -230,7 +240,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-http-bridge Releases](https://github.com/react-native-oh-library/react-native-http-bridge/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.6.1@deprecated | [@react-native-oh-tpl/react-native-http-bridge Releases(deprecated)](https://github.com/react-native-oh-library/react-native-http-bridge/releases) | 0.72 | +| 0.6.2 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.72 | +| 0.7.0 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.77 | ### Permission Requirements diff --git a/en/react-native-localization.md b/en/react-native-localization.md index 82efbbee41d8fb6411e8a0a4948bef6b0ca724ba..39307eb4bc4d6648b770a3f2c6c27df4af49dfb9 100644 --- a/en/react-native-localization.md +++ b/en/react-native-localization.md @@ -16,10 +16,17 @@ Template version: v0.2.2 > [!TIP] [GitHub address](https://github.com/react-native-oh-library/ReactNativeLocalization) - ## Installation and Usage -Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-localization Releases](https://github.com/react-native-oh-library/ReactNativeLocalization/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 | +|-------| ------------------------------------------------------------ | ---------- | +| 2.3.2@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.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 | + +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: @@ -29,13 +36,13 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-localization +npm install @react-native-ohos/react-native-localization ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-localization +yarn add @react-native-ohos/react-native-localization ``` @@ -168,11 +175,16 @@ const styles = StyleSheet.create({ ``` ## Use Codegen +Version >= @react-native-ohos/react-native-localization@2.3.3, 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-localization@2.3.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. @@ -202,7 +214,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-localization": "file:../../node_modules/@react-native-oh-tpl/react-native-localization/harmony/react_localization.har" + "@react-native-ohos/react-native-localization": "file:../../node_modules/@react-native-ohos/react-native-localization/harmony/react_localization.har" } ``` @@ -225,7 +237,7 @@ Method 2: Directly link to the source code. ```diff ... -+ import { RNReactLocalizationPackage } from '@react-native-oh-tpl/react-native-localization'; ++ import { RNReactLocalizationPackage } from '@react-native-ohos/react-native-localization'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -254,9 +266,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-localization Releases](https://github.com/react-native-oh-library/ReactNativeLocalization/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 | +|-------| ------------------------------------------------------------ | ---------- | +| 2.3.2@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.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 | ## Static Methods diff --git a/en/react-native-performance.md b/en/react-native-performance.md index ac33821700e91b62d469bd1ba1bbc372b6930e8f..be1e1f39e6082ebc990b9f99545cf64eccc7ccb0 100644 --- a/en/react-native-performance.md +++ b/en/react-native-performance.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/react-native-performance Releases](https://github.com/react-native-oh-library/react-native-performance/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.1.2@deprecated | [@react-native-oh-tpl/react-native-performance Releases(deprecated)](https://github.com/react-native-oh-library/react-native-performance/releases) | 0.72 | +| 5.1.3 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.72 | +| 5.2.0 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/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 +36,13 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-performance +npm install @react-native-ohos/react-native-performance ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-performance +yarn add @react-native-ohos/react-native-performance ``` @@ -60,7 +68,7 @@ import { import performance, { PerformanceObserver, setResourceLoggingEnabled, -} from "@react-native-oh-tpl/react-native-performance"; +} from "@react-native-ohos/react-native-performance"; export function TestNativePerformance() { const [result1, setResult1] = React.useState(0); const [result2, setResult2] = React.useState(""); @@ -201,11 +209,16 @@ const styles = StyleSheet.create({ ## Use Codegen +> [!TIP] V5.1.3 no need to execute Codegen + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/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-performance@5.1.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. @@ -233,7 +246,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-performance": "file:../../node_modules/@react-native-oh-tpl/react-native-performance/harmony/react_native_performance.har" + "@react-native-ohos/react-native-performance": "file:../../node_modules/@react-native-ohos/react-native-performance/harmony/react_native_performance.har" } ``` @@ -256,7 +269,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import {RNPerformancePackage} from '@react-native-oh-tpl/react-native-performance/ts'; ++ import {RNPerformancePackage} from '@react-native-ohos/react-native-performance/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -266,7 +279,69 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 4.Configure CMakeLists and import PerformancePackage + +> [!TIP] If using version 5.1.2, please skip this chapter + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +```diff +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-performance/src/main/cpp" ./performance) + +# 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_performance) +# RNOH_END: manual_package_linking_2 +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +```diff +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" +#include "SamplePackage.h" ++ #include "PerformancePackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 5. Running Click the `sync` button in the upper right corner. @@ -285,7 +360,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-performance Releases](https://github.com/react-native-oh-library/react-native-performance/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.1.2@deprecated | [@react-native-oh-tpl/react-native-performance Releases(deprecated)](https://github.com/react-native-oh-library/react-native-performance/releases) | 0.72 | +| 5.1.3 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.72 | +| 5.2.0 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.77 | ## Performance diff --git a/en/react-native-thumbnail.md b/en/react-native-thumbnail.md index def45a3c38e10c3607c518538bd2ab2ab9671e41..92713c36010477a23445e20b466cf7254524c265 100644 --- a/en/react-native-thumbnail.md +++ b/en/react-native-thumbnail.md @@ -11,28 +11,34 @@

-> [!TIP] [Github address](https://github.com/react-native-oh-library/react-native-thumbnail) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-thumbnail) ## Installation and Usage -Find the matching version information in the release address of a third-party library and download an applicable .tgz package: [@react-native-oh-tpl/react-native-thumbnail Releases](https://github.com/react-native-oh-library/react-native-thumbnail/releases). +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.1.3@deprecated | [@react-native-oh-tpl/react-native-thumbnail Releases(deprecated)](https://github.com/react-native-oh-library/react-native-thumbnail/releases) | 0.72 | +| 1.1.4 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.72 | +| 1.2.0 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/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-thumbnail +npm install @react-native-ohos/react-native-thumbnail ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-thumbnail +yarn add @react-native-ohos/react-native-thumbnail ``` @@ -40,7 +46,7 @@ yarn add @react-native-oh-tpl/react-native-thumbnail The following code shows the basic use scenario of the repository: > [!WARNING] The name of the imported repository remains unchanged.
-> [!TIP] The example depends on the react-native-image-picker library, see the [@react-native-oh-tpl/react-native-image-picker document](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-image-picker.md) for introducing. +> [!TIP] The example depends on the react-native-image-picker library, see the [@react-native-ohos/react-native-image-picker document](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-image-picker.md) for introducing. ```js import React from 'react'; import { StyleSheet, Text, View, TouchableOpacity, Image } from 'react-native'; @@ -156,11 +162,16 @@ const styles = StyleSheet.create({ ## Use Codegen +Version >= @react-native-ohos/react-native-thumbnail@1.1.4, 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-thumbnail@1.1.4 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,7 +202,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-thumbnail": "file:../../node_modules/@react-native-oh-tpl/react-native-thumbnail/harmony/thumbnail.har" + "@react-native-ohos/react-native-thumbnail": "file:../../node_modules/@react-native-ohos/react-native-thumbnail/harmony/thumbnail.har" } ``` @@ -214,7 +225,7 @@ Open the entry/src/main/ets/RNPackagesFactory.ts file and add the following code ```diff import { RNPackageContext, RNPackage } from '@rnoh/react-native-openharmony/ts'; -+import { RNThumbnailPackage } from '@react-native-oh-tpl/react-native-thumbnail/ts'; ++import { RNThumbnailPackage } from '@react-native-ohos/react-native-thumbnail/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -242,7 +253,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-thumbnail Releases](https://github.com/react-native-oh-library/react-native-thumbnail/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.1.3@deprecated | [@react-native-oh-tpl/react-native-thumbnail Releases(deprecated)](https://github.com/react-native-oh-library/react-native-thumbnail/releases) | 0.72 | +| 1.1.4 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.72 | +| 1.2.0 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.77 | ## API diff --git a/en/remobile-react-native-toast.md b/en/remobile-react-native-toast.md index b3a6f371d823c59be17ae9a7c2f34a22aba1a7e9..4883e3b832b276f5573b05657212a70527619a8c 100644 --- a/en/remobile-react-native-toast.md +++ b/en/remobile-react-native-toast.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-toast Releases](https://github.com/react-native-oh-library/react-native-toast/releases).For older versions that have not been released 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.0.7@deprecated | [@react-native-oh-tpl/react-native-toast Releases(deprecated)](https://github.com/react-native-oh-library/react-native-toast/releases) | 0.72 | +| 1.0.8 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.72 | +| 1.1.0 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/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-toast +npm install @react-native-ohos/react-native-toast ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-toast +yarn add @react-native-ohos/react-native-toast ``` @@ -104,11 +110,16 @@ export default ToastMasterDemo; ## Use Codegen -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). +> [!TIP] V1.0.8 no need to execute Codegen + +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-toast@1.0.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. @@ -127,7 +138,6 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. Currently, two methods are available: - Method 1 (recommended): Use the HAR file. > [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. @@ -137,7 +147,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-toast": "file:../../node_modules/@react-native-oh-tpl/react-native-toast/harmony/rn_toast.har" +"@react-native-ohos/react-native-toast": "file:../../node_modules/@react-native-ohos/react-native-toast/harmony/rn_toast.har" } ``` @@ -160,8 +170,7 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co ```diff ... -+ import {ToastPackage} from '@react-native-oh-tpl/react-native-toast/ts'; - ++ import {ToastPackage} from '@react-native-ohos/react-native-toast/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -170,7 +179,68 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 4. Configure CMakeLists and import ToastPackage + +> [!TIP] If using version 1.0.7, please skip this chapter + +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/voice/src/main/cpp" ./voice) +# 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_voice) +# RNOH_END: manual_package_linking_2 +``` + +open `entry/src/main/cpp/PackageProvider.cpp`,add: + +```diff +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" +#include "SamplePackage.h" ++ #include "VoicePackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), + std::make_shared(ctx), ++ std::make_shared(ctx) + }; +} +``` + +### 5. Running Click the `sync` button in the upper right corner. @@ -189,7 +259,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-toast Releases](https://github.com/react-native-oh-library/react-native-toast/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.7@deprecated | [@react-native-oh-tpl/react-native-toast Releases(deprecated)](https://github.com/react-native-oh-library/react-native-toast/releases) | 0.72 | +| 1.0.8 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.72 | +| 1.1.0 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.77 | ## API diff --git a/zh-cn/react-native-apple-authentication.md b/zh-cn/react-native-apple-authentication.md index 7f991cd8a1b8590d5b0a9ba8be8ef0966563667f..72549e75f9f50747720424faa92b8142a3381c03 100644 --- a/zh-cn/react-native-apple-authentication.md +++ b/zh-cn/react-native-apple-authentication.md @@ -22,8 +22,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 2.3.0 | [@react-native-oh-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/releases) | 0.72 | -| 2.4.1 | [@react-native-oh-library/react-native-apple-authentication Releases]() | 0.77 | +| 2.3.0@deprecated | [@react-native-oh-tpl/react-native-apple-authentication Releases(deprecated)](https://github.com/react-native-oh-library/react-native-apple-authentication/releases) | 0.72 | +| 2.3.1 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.72 | +| 2.4.2 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -34,20 +35,12 @@ #### npm ```bash -# V2.3.0 -npm install @react-native-oh-tpl/react-native-apple-authentication - -# 2.4.1 npm install @react-native-ohos/react-native-apple-authentication ``` #### yarn ```bash -# V2.3.0 -yarn add @react-native-oh-tpl/react-native-apple-authentication - -# 2.4.1 yarn add @react-native-ohos/react-native-apple-authentication ``` @@ -93,13 +86,16 @@ export default AppleAuthenticationDemo; ## 使用 Codegen -> [!TIP] V2.3.0 不需要执行 Codegen。 +> [!TIP] V2.3.1 不需要执行 Codegen。 本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen 文档](/zh-cn/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-apple-authentication@2.3.1,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -127,17 +123,6 @@ export default AppleAuthenticationDemo; 打开 `entry/oh-package.json5`,添加以下依赖 -- V2.3.0 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-apple-authentication": "file:../../node_modules/@react-native-oh-tpl/react-native-apple-authentication/harmony/react-native-apple-authentication.har" - } -``` - -- V2.4.1 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -160,7 +145,7 @@ ohpm install ### 3.配置 CMakeLists 和引入 RNOHAppleAuthenticationPackage -> V2.4.1 需要配置 CMakeLists 和引入 RNOHAppleAuthenticationPackage。 +> V2.3.1 需要配置 CMakeLists 和引入 RNOHAppleAuthenticationPackage。 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -229,10 +214,6 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... -// V2.3.0 -+ import { RNAppleAuthPackage } from '@react-native-oh-tpl/react-native-apple-authentication'; - -// V2.4.1 + import { RNAppleAuthPackage } from '@react-native-ohos/react-native-apple-authentication'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -262,12 +243,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 2.3.0 | [@react-native-oh-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/releases) | 0.72 | -| 2.4.1 | [@react-native-oh-library/react-native-apple-authentication Releases]() | 0.77 | +| 2.3.0@deprecated | [@react-native-oh-tpl/react-native-apple-authentication Releases(deprecated)](https://github.com/react-native-oh-library/react-native-apple-authentication/releases) | 0.72 | +| 2.3.1 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.72 | +| 2.4.2 | [@react-native-ohos/react-native-apple-authentication Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-apple-authentication/releases) | 0.77 | ## 属性 diff --git a/zh-cn/react-native-community-checkbox.md b/zh-cn/react-native-community-checkbox.md index c0d11b50d4ba0dd829af97b90613d54f2e51560c..a611d01792e8e65f97cfc7866bd930b55bffe267 100644 --- a/zh-cn/react-native-community-checkbox.md +++ b/zh-cn/react-native-community-checkbox.md @@ -4,17 +4,19 @@

@react-native-community/checkbox

-本项目基于 [@react-native-community/checkbox](https://github.com/react-native-checkbox/react-native-checkbox) 开发。 +> [!TIP] [Github 地址](https://github.com/react-native-checkbox/react-native-checkbox) +## 1. 安装与使用 -该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/checkbox`,具体版本所属关系如下: +请到三方库的 Releases 发布地址查看配套的版本信息: -| Version | Package Name | Repository | Release | -| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | -| <= 0.5.16-0.1.0@deprecated | @react-native-oh-tpl/checkbox | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox/releases) | -| >= 0.5.17 | @react-native-ohos/checkbox | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox) | [GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 0.6.0@deprecated | [@react-native-oh-tpl/checkbox Releases(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox/releases) | 0.72 | +| 0.6.1 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.72 | +| 0.5.16 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.77 | -## 1. 安装与使用 +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -65,6 +67,8 @@ export default function CheckBoxExample() { ## 2. Manual Link +Version >= @react-native-ohos/checkbox@0.5.17,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + 此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。 @@ -237,7 +241,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/checkbox Releases](https://gitee.com/openharmony-sig/rntpc_react-native-checkbox/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|--------| ------------------------------------------------------------ | ---------- | +| 0.6.0@deprecated | [@react-native-oh-tpl/checkbox Releases(deprecated)](https://github.com/react-native-oh-library/react-native-checkbox/releases) | 0.72 | +| 0.6.1 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.72 | +| 0.5.16 | [@react-native-ohos/checkbox Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-checkbox/releases) | 0.77 | ## 4. 属性 diff --git a/zh-cn/react-native-default-preference.md b/zh-cn/react-native-default-preference.md index 7c9ddf0eb621852d30165a53ffd7806743f7c983..216e1040e8bdc39257af2d099d86761128cd7b9b 100644 --- a/zh-cn/react-native-default-preference.md +++ b/zh-cn/react-native-default-preference.md @@ -14,12 +14,17 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-default-preference) - - ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-default-preference Releases](https://github.com/react-native-oh-library/react-native-default-preference/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 1.4.4@deprecated | [@react-native-oh-tpl/react-native-default-preference Releases(deprecated)](https://github.com/react-native-oh-library/react-native-default-preference/releases) | 0.72 | +| 1.4.5 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.72 | +| 1.5.0 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.77 | +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -28,13 +33,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-default-preference +npm install @react-native-ohos/react-native-default-preference ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-default-preference +yarn add @react-native-ohos/react-native-default-preference ``` @@ -71,11 +76,15 @@ export default App; ## 使用 Codegen +Version >= @react-native-ohos/react-native-default-preference@1.4.5,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-default-preference@1.4.5,已支持 Autolink,无需手动配置,目前只支持72框架。 Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -106,7 +115,7 @@ export default App; ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-default-preference": "file:../../node_modules/@react-native-oh-tpl/react-native-default-preference/harmony/react_native_default_preference.har" + "@react-native-ohos/react-native-default-preference": "file:../../node_modules/@react-native-ohos/react-native-default-preference/harmony/react_native_default_preference.har" } ``` @@ -131,7 +140,7 @@ ohpm install ```diff ... -+ import { RNDefaultPreferencePackage } from '@react-native-oh-tpl/react-native-default-preference/ts'; ++ import { RNDefaultPreferencePackage } from '@react-native-ohos/react-native-default-preference/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -160,9 +169,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: -[@react-native-oh-tpl/react-native-default-preference Releases](https://github.com/react-native-oh-library/react-native-default-preference/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 1.4.4@deprecated | [@react-native-oh-tpl/react-native-default-preference Releases(deprecated)](https://github.com/react-native-oh-library/react-native-default-preference/releases) | 0.72 | +| 1.4.5 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.72 | +| 1.5.0 | [@react-native-ohos/react-native-default-preference Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-default-preference/releases) | 0.77 | ## API diff --git a/zh-cn/react-native-fingerprint-scanner.md b/zh-cn/react-native-fingerprint-scanner.md index 540364e5419e92a64d841427fcdf4dcf049a8ead..4f672b956a935227d4d2e6e730777459346c2465 100644 --- a/zh-cn/react-native-fingerprint-scanner.md +++ b/zh-cn/react-native-fingerprint-scanner.md @@ -20,8 +20,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 6.0.0 | [@react-native-oh-tpl/react-native-fingerprint-scanner Releases](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/releases) | 0.72 | -| 6.0.1 | [@react-native-ohos/react-native-fingerprint-scanner Releases]() | 0.77 | +| 6.0.0@deprecated | [@react-native-oh-tpl/react-native-fingerprint-scanner Releases(deprecated)](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-fingerprint-scanner Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-fingerprint-scanner/releases) | 0.72 | +| 6.1.0 | [@react-native-ohos/react-native-fingerprint-scanner Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-fingerprint-scanner/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -32,20 +33,12 @@ #### **npm** ```bash -#6.0.0 -npm install @react-native-oh-tpl/react-native-fingerprint-scanner - -#6.0.1 npm install @react-native-ohos/react-native-fingerprint-scanner ``` #### **yarn** ```bash -#6.0.0 -yarn add @react-native-oh-tpl/react-native-fingerprint-scanner - -#6.0.1 yarn add @react-native-ohos/react-native-fingerprint-scanner ``` @@ -106,7 +99,10 @@ export default function App() { ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version > @react-native-ohos/react-native-fingerprint-scanner@6.0.1,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -134,17 +130,6 @@ export default function App() { 打开 `entry/oh-package.json5`,添加以下依赖 -- V6.0.0 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-fingerprint-scanner": "file:../../node_modules/@react-native-oh-tpl/react-native-fingerprint-scanner/harmony/fingerprint_scanner.har" - } -``` - -- V6.0.1 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -152,8 +137,6 @@ export default function App() { } ``` - - 点击右上角的 `sync` 按钮 或者在终端执行: @@ -172,10 +155,6 @@ ohpm install ```diff ... -//6.0.0 -+ import { RNFingerprintScannerPackage } from '@react-native-oh-tpl/react-native-fingerprint-scanner/ts'; - -//6.0.1 + import { RNFingerprintScannerPackage } from '@react-native-ohos/react-native-fingerprint-scanner/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -267,12 +246,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 6.0.0 | [@react-native-oh-tpl/react-native-fingerprint-scanner Releases](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/releases) | 0.72 | -| 6.0.1 | [@react-native-ohos/react-native-fingerprint-scanner Releases]() | 0.77 | +| 6.0.0@deprecated | [@react-native-oh-tpl/react-native-fingerprint-scanner Releases(deprecated)](https://github.com/react-native-oh-library/react-native-fingerprint-scanner/releases) | 0.72 | +| 6.0.1 | [@react-native-ohos/react-native-fingerprint-scanner Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-fingerprint-scanner/releases) | 0.72 | +| 6.1.0 | [@react-native-ohos/react-native-fingerprint-scanner Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-fingerprint-scanner/releases) | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-haptic-feedback.md b/zh-cn/react-native-haptic-feedback.md index 0d17045d0a07d03fe979169765cd7c9e1b0b8e43..fb9698424399ed1671b84237a087060b11609d97 100644 --- a/zh-cn/react-native-haptic-feedback.md +++ b/zh-cn/react-native-haptic-feedback.md @@ -21,8 +21,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 2.2.0 | [@react-native-oh-tpl/react-native-haptic-feedback Releases](https://github.com/react-native-oh-library/react-native-haptic-feedback/releases) | 0.72 | -| 2.3.3 | [@react-native-ohos/react-native-haptic-feedback Releases]() | 0.77 | +| 2.2.1@deprecated | [@react-native-oh-tpl/react-native-haptic-feedback Releases(deprecated)](https://github.com/react-native-oh-library/react-native-haptic-feedback/releases) | 0.72 | +| 2.2.2 | [@react-native-ohos/react-native-haptic-feedback Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-haptic-feedback/releases) | 0.72 | +| 2.3.4 | [@react-native-ohos/react-native-haptic-feedback Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-haptic-feedback/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -31,20 +32,12 @@ #### **npm** ```bash -# V2.2.0 -npm install @react-native-oh-tpl/react-native-haptic-feedback - -# V2.3.3 npm install @react-native-ohos/react-native-haptic-feedback ``` #### **yarn** ```bash -# V2.2.0 -yarn add @react-native-oh-tpl/react-native-haptic-feedback - -# V2.3.3 yarn add @react-native-ohos/react-native-haptic-feedback ``` @@ -132,13 +125,16 @@ export default HapticFeedbackExample; ## 使用 Codegen -> [!TIP] V2.3.3 不需要执行 Codegen。 +> [!TIP] V2.2.2 不需要执行 Codegen。 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-haptic-feedback@2.2.2,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony` @@ -166,17 +162,6 @@ export default HapticFeedbackExample; 打开 `entry/oh-package.json5`,添加以下依赖 -- V2.2.0 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-haptic-feedback": "file:../../node_modules/@react-native-oh-tpl/react-native-haptic-feedback/harmony/haptic_feedback.har" - } -``` - -- V2.3.3 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -199,7 +184,7 @@ ohpm install ### 3.配置 CMakeLists 和引入 RNHapticFeedbackPackage -> [!TIP] 若使用的是 2.2.0 版本,请跳过本章。 +> [!TIP] 若使用的是 2.2.1 版本,请跳过本章。 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: @@ -264,10 +249,6 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... -// V2.2.0 -+ import { RNHapticFeedbackPackage } from '@react-native-oh-tpl/react-native-haptic-feedback/ts' - -// V2.3.3 + import { RNHapticFeedbackPackage } from '@react-native-ohos/react-native-haptic-feedback/ts' export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -297,12 +278,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 2.2.0 | [@react-native-oh-tpl/react-native-haptic-feedback Releases](https://github.com/react-native-oh-library/react-native-haptic-feedback/releases) | 0.72 | -| 2.3.3 | [@react-native-ohos/react-native-haptic-feedback Releases]() | 0.77 | +| 2.2.1@deprecated | [@react-native-oh-tpl/react-native-haptic-feedback Releases(deprecated)](https://github.com/react-native-oh-library/react-native-haptic-feedback/releases) | 0.72 | +| 2.2.2 | [@react-native-ohos/react-native-haptic-feedback Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-haptic-feedback/releases) | 0.72 | +| 2.3.4 | [@react-native-ohos/react-native-haptic-feedback Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-haptic-feedback/releases) | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-http-bridge.md b/zh-cn/react-native-http-bridge.md index fc607b8a5ce0b7ad76ebc8dcc11b6b2dc0a83e8f..0cb5d18b3d03b5a40731d22245efa1b764441ec3 100644 --- a/zh-cn/react-native-http-bridge.md +++ b/zh-cn/react-native-http-bridge.md @@ -16,7 +16,15 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-http-bridge Releases](https://github.com/react-native-oh-library/react-native-http-bridge/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 0.6.1@deprecated | [@react-native-oh-tpl/react-native-http-bridge Releases(deprecated)](https://github.com/react-native-oh-library/react-native-http-bridge/releases) | 0.72 | +| 0.6.2 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.72 | +| 0.7.0 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +33,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-http-bridge +npm install @react-native-ohos/react-native-http-bridge ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-http-bridge +yarn add @react-native-ohos/react-native-http-bridge ``` @@ -139,13 +147,16 @@ export default HttpBridgeDemo; ## 使用 Codegen +Version >= @react-native-ohos/react-native-http-bridge@0.6.2,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -本库 HarmonyOS 侧实现依赖@ohos/polka 的原生端代码,已在 HarmonyOS 工程中引入过该库,无需再次引入,可跳过本章节步骤,直接使用。 +Version >= @react-native-ohos/react-native-http-bridge@0.6.2,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -176,7 +187,7 @@ export default HttpBridgeDemo; ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-http-bridge": "file:../../node_modules/@react-native-oh-tpl/react-native-http-bridge/harmony/http_bridge.har" + "@react-native-ohos/react-native-http-bridge": "file:../../node_modules/@react-native-ohos/react-native-http-bridge/harmony/http_bridge.har" } ``` @@ -199,7 +210,7 @@ ohpm install ```diff ... -+ import { RNHttpBridgePackage } from "@react-native-oh-tpl/react-native-http-bridge/ts"; ++ import { RNHttpBridgePackage } from "@react-native-ohos/react-native-http-bridge/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -229,10 +240,15 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-http-bridge Releases](https://github.com/react-native-oh-library/react-native-http-bridge/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: -### 权限要求 +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 0.6.1@deprecated | [@react-native-oh-tpl/react-native-http-bridge Releases(deprecated)](https://github.com/react-native-oh-library/react-native-http-bridge/releases) | 0.72 | +| 0.6.2 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.72 | +| 0.7.0 | [@react-native-ohos/react-native-http-bridge Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-http-bridge/releases) | 0.77 | +### 权限要求 #### 在 entry 目录下的module.json5中添加权限 diff --git a/zh-cn/react-native-localization.md b/zh-cn/react-native-localization.md index d63e60a9ab0d4108b66ff14968d3e362f2bc441e..fc30f3f3399594acc68741de9f106f46b901f44d 100644 --- a/zh-cn/react-native-localization.md +++ b/zh-cn/react-native-localization.md @@ -18,10 +18,17 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/ReactNativeLocalization) - ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-localization Releases](https://github.com/react-native-oh-library/ReactNativeLocalization/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 2.3.2@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.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 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -30,13 +37,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-localization +npm install @react-native-ohos/react-native-localization ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-localization +yarn add @react-native-ohos/react-native-localization ``` @@ -170,11 +177,16 @@ const styles = StyleSheet.create({ ``` ## 使用 Codegen +Version >= @react-native-ohos/react-native-localization@2.3.3,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link -目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-localization@2.3.3,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony` @@ -205,7 +217,7 @@ const styles = StyleSheet.create({ ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-localization": "file:../../node_modules/@react-native-oh-tpl/react-native-localization/harmony/react_localization.har" + "@react-native-ohos/react-native-localization": "file:../../node_modules/@react-native-ohos/react-native-localization/harmony/react_localization.har" } ``` @@ -228,7 +240,7 @@ ohpm install ```diff ... -+ import { RNReactLocalizationPackage } from '@react-native-oh-tpl/react-native-localization'; ++ import { RNReactLocalizationPackage } from '@react-native-ohos/react-native-localization'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -257,9 +269,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-localization Releases](https://github.com/react-native-oh-library/ReactNativeLocalization/releases) - +请到三方库的 Releases 发布地址查看配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 2.3.2@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.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-performance.md b/zh-cn/react-native-performance.md index 21cfb092df2c66294017293943fd22fda8cfc046..1175d92fae32790a8ce77689e00bdf2d70708b3b 100644 --- a/zh-cn/react-native-performance.md +++ b/zh-cn/react-native-performance.md @@ -22,8 +22,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 5.1.2 | [@react-native-oh-tpl/react-native-performance Releases](https://github.com/react-native-oh-library/react-native-performance/releases) | 0.72 | -| 5.1.3 | [@react-native-ohos/react-native-performance Releases]() | 0.77 | +| 5.1.2@deprecated | [@react-native-oh-tpl/react-native-performance Releases(deprecated)](https://github.com/react-native-oh-library/react-native-performance/releases) | 0.72 | +| 5.1.3 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.72 | +| 5.2.0 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -34,20 +35,12 @@ #### **npm** ```bash -#5.1.2 -npm install @react-native-oh-tpl/react-native-performance - -#5.1.3 npm install @react-native-ohos/react-native-performance ``` #### **yarn** ```bash -#5.1.2 -yarn add @react-native-oh-tpl/react-native-performance - -#5.1.3 yarn add @react-native-ohos/react-native-performance ``` @@ -65,7 +58,7 @@ import { StatusBar, TouchableOpacity } from 'react-native'; -import performance,{PerformanceObserver,setResourceLoggingEnabled} from '@react-native-oh-tpl/react-native-performance' +import performance,{PerformanceObserver,setResourceLoggingEnabled} from '@react-native-ohos/react-native-performance' export function TestNativePerformance() { const [result1, setResult1] = React.useState(0) const [result2, setResult2] = React.useState('') @@ -216,7 +209,10 @@ const styles = StyleSheet.create({ ## Link -目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-performance@5.1.3,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony` @@ -244,17 +240,6 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 -- V5.1.2 - -```json -"dependencies": { - "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-performance": "file:../../node_modules/@react-native-oh-tpl/react-native-performance/harmony/react_native_performance.har" - } -``` - -- V5.1.3 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -281,9 +266,6 @@ ohpm install ```diff ... - //5.1.2 -+ import {RNPerformancePackage} from '@react-native-oh-tpl/react-native-performance/ts'; - //5.1.3 + import {RNPerformancePackage} from '@react-native-ohos/react-native-performance/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -375,12 +357,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 5.1.2 | [@react-native-oh-tpl/react-native-performance Releases](https://github.com/react-native-oh-library/react-native-performance/releases) | 0.72 | -| 5.1.3 | [@react-native-ohos/react-native-performance Releases]() | 0.77 | +| 5.1.2@deprecated | [@react-native-oh-tpl/react-native-performance Releases(deprecated)](https://github.com/react-native-oh-library/react-native-performance/releases) | 0.72 | +| 5.1.3 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.72 | +| 5.2.0 | [@react-native-ohos/react-native-performance Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-performance/releases) | 0.77 | ## Performance diff --git a/zh-cn/react-native-thumbnail.md b/zh-cn/react-native-thumbnail.md index ba8c7a8195149ecf9adbc9e22cbfecaadfbf7842..3025b94bfcde055f56527ca8dcd4b675be7586d2 100644 --- a/zh-cn/react-native-thumbnail.md +++ b/zh-cn/react-native-thumbnail.md @@ -15,7 +15,15 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-thumbnail Releases](https://github.com/react-native-oh-library/react-native-thumbnail/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 1.1.3@deprecated | [@react-native-oh-tpl/react-native-thumbnail Releases(deprecated)](https://github.com/react-native-oh-library/react-native-thumbnail/releases) | 0.72 | +| 1.1.4 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.72 | +| 1.2.0 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -24,13 +32,13 @@ #### **npm** ```bash -npm install @react-native-oh-tpl/react-native-thumbnail +npm install @react-native-ohos/react-native-thumbnail ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-thumbnail +yarn add @react-native-ohos/react-native-thumbnail ``` @@ -38,7 +46,7 @@ yarn add @react-native-oh-tpl/react-native-thumbnail 下面的代码展示了这个库的基本使用场景: > [!WARNING] 使用时 import 的库名不变。
-> [!TIP] 本示例依赖 react-native-image-picker 库,参照[@react-native-oh-tpl/react-native-image-picker 文档](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-image-picker.md)进行引入。 +> [!TIP] 本示例依赖 react-native-image-picker 库,参照[@react-native-ohos/react-native-image-picker 文档](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-image-picker.md)进行引入。 ```js import React from 'react'; import { StyleSheet, Text, View, TouchableOpacity, Image } from 'react-native'; @@ -154,11 +162,16 @@ const styles = StyleSheet.create({ ## 使用 Codegen +Version >= @react-native-ohos/react-native-thumbnail@1.1.4,已适配codegen-lib生成桥接代码。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/codegen.md)。 ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-thumbnail@1.1.4,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -189,7 +202,7 @@ const styles = StyleSheet.create({ ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-thumbnail": "file:../../node_modules/@react-native-oh-tpl/react-native-thumbnail/harmony/thumbnail.har" + "@react-native-ohos/react-native-thumbnail": "file:../../node_modules/@react-native-ohos/react-native-thumbnail/harmony/thumbnail.har" } ``` @@ -212,7 +225,7 @@ ohpm install ```diff import { RNPackageContext, RNPackage } from '@rnoh/react-native-openharmony/ts'; -+import { RNThumbnailPackage } from '@react-native-oh-tpl/react-native-thumbnail/ts'; ++import { RNThumbnailPackage } from '@react-native-ohos/react-native-thumbnail/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -240,7 +253,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[react-native-thumbnail Releases](https://github.com/react-native-oh-library/react-native-thumbnail/releases) +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +|-------| ------------------------------------------------------------ | ---------- | +| 1.1.3@deprecated | [@react-native-oh-tpl/react-native-thumbnail Releases(deprecated)](https://github.com/react-native-oh-library/react-native-thumbnail/releases) | 0.72 | +| 1.1.4 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.72 | +| 1.2.0 | [@react-native-ohos/react-native-thumbnail Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-thumbnail/releases) | 0.77 | ## API diff --git a/zh-cn/remobile-react-native-toast.md b/zh-cn/remobile-react-native-toast.md index f6f405eda5f2ab6aecc25d321ac4ddb78e3cc040..e574cd921252e08882071b240b53dd59e37f2f66 100644 --- a/zh-cn/remobile-react-native-toast.md +++ b/zh-cn/remobile-react-native-toast.md @@ -23,8 +23,9 @@ | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 1.0.7 | [@react-native-oh-tpl/react-native-toast Releases](https://github.com/react-native-oh-library/react-native-toast/releases) | 0.72 | -| 1.0.8 | [@react-native-ohos/react-native-toast Releases]() | 0.77 | +| 1.0.7@deprecated | [@react-native-oh-tpl/react-native-toast Releases(deprecated)](https://github.com/react-native-oh-library/react-native-toast/releases) | 0.72 | +| 1.0.8 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.72 | +| 1.1.0 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.77 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -35,20 +36,12 @@ #### **npm** ```bash -#1.0.7 -npm install @react-native-oh-tpl/react-native-toast - -#1.0.8 npm install @react-native-ohos/react-native-toast ``` #### **yarn** ```bash -#1.0.7 -yarn add @react-native-oh-tpl/react-native-toast - -#1.0.8 yarn add @react-native-ohos/react-native-toast ``` @@ -125,7 +118,10 @@ export default ToastMasterDemo; ## Link -目前HarmonyOS暂不支持 AutoLink,所以Link步骤需要手动配置。 +Version >= @react-native-ohos/react-native-toast@1.0.8,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的HarmonyOS工程 `harmony` @@ -153,17 +149,6 @@ export default ToastMasterDemo; 打开 `entry/oh-package.json5`,添加以下依赖 -- V1.0.7 - -```json -"dependencies": { -"@rnoh/react-native-openharmony": "file:../react_native_openharmony", -"@react-native-oh-tpl/react-native-toast": "file:../../node_modules/@react-native-oh-tpl/react-native-toast/harmony/rn_toast.har" -} -``` - -- V1.0.8 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -190,9 +175,6 @@ ohpm install ```diff ... - //1.0.7 -+ import {ToastPackage} from '@react-native-oh-tpl/react-native-toast/ts'; - //1.0.8 + import {ToastPackage} from '@react-native-ohos/react-native-toast/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -283,13 +265,13 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release -配套的版本信息: +请到三方库的 Releases 发布地址查看配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 1.0.7 | [@react-native-oh-tpl/react-native-toast Releases](https://github.com/react-native-oh-library/react-native-toast/releases) | 0.72 | -| 1.0.8 | [@react-native-ohos/react-native-toast Releases]() | 0.77 | +| 1.0.7@deprecated | [@react-native-oh-tpl/react-native-toast Releases(deprecated)](https://github.com/react-native-oh-library/react-native-toast/releases) | 0.72 | +| 1.0.8 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.72 | +| 1.1.0 | [@react-native-ohos/react-native-toast Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-toast/releases) | 0.77 | ## API