diff --git a/zh-cn/react-native-community-push-notification-ios.md b/zh-cn/react-native-community-push-notification-ios.md
index e0cc9e9603cc28859eae188464689295a7a51016..cd1ba5b406db1d25a0c0f3aba1ee950b758316d0 100644
--- a/zh-cn/react-native-community-push-notification-ios.md
+++ b/zh-cn/react-native-community-push-notification-ios.md
@@ -1,19 +1,19 @@
-
-> 模板版本:v0.1.3
+> 模板版本:v0.2.2
@react-native-community/push-notification-ios
+
-
+
-> [!TIP] [Github 地址](https://github.com/react-native-push-notification/ios)
+> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-push-notification-ios)
## 安装与使用
@@ -169,6 +169,17 @@ export const App = () => {
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`
+### 在工程根目录的 `oh-package.json5` 添加 overrides 字段
+
+```json
+{
+ ...
+ "overrides": {
+ "@rnoh/react-native-openharmony" : "./react_native_openharmony"
+ }
+}
+```
+
### 引入原生端代码
目前有两种方法:
@@ -176,7 +187,7 @@ export const App = () => {
1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
2. 直接链接源码。
-方法一:通过 har 包引入
+方法一:通过 har 包引入(推荐)
> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
@@ -186,7 +197,7 @@ export const App = () => {
"dependencies": {
"@rnoh/react-native-openharmony": "file:../react_native_openharmony",
- "rnoh-push-notification": "file:../../node_modules/@react-native-oh-tpl/push-notification-ios/harmony/push_notification.har"
+ "@react-native-oh-tpl/push-notification-ios": "file:../../node_modules/@react-native-oh-tpl/push-notification-ios/harmony/push_notification.har"
}
```
@@ -218,7 +229,7 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: add_package_subdirectories
add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
-+ add_subdirectory("${OH_MODULE_DIR}/rnoh-push-notification/src/main/cpp" ./push_notification)
++ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/push-notification-ios/src/main/cpp" ./push_notification)
# RNOH_END: add_package_subdirectories
add_library(rnoh_app SHARED
@@ -257,7 +268,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
```diff
...
-+ import { PushNotificationPackage } from 'rnoh-push-notification/ts';
++ import { PushNotificationPackage } from '@react-native-oh-tpl/push-notification-ios/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
@@ -288,9 +299,6 @@ ohpm install
请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[<@react-native-oh-tpl/push-notification-ios> Releases](https://github.com/react-native-oh-library/react-native-push-notification-ios/releases))
-本文档内容基于以下版本验证通过:
-
-RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.58;
## API
@@ -300,11 +308,18 @@ RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------- | ----------------- |
-| addNotificationRequest | Sends notificationRequest to notification center at specified firedate. Fires immediately if firedate is not set. | function | no | IOS/HarmonyOS | yes |
-| setApplicationIconBadgeNumber | Sets the badge number for the app icon on the home screen | function | no | All | yes |
-| getDeliveredNotifications | Provides you with a list of the app’s notifications that are still displayed in Notification Center | function | no | All | yes |
-| removeAllDeliveredNotifications | Remove all delivered notifications from Notification Center | function | no | All | yes |
-| removeDeliveredNotifications | Removes the specified delivered notifications from Notification Center | function | no | All | yes |
+| addNotificationRequest | Sends notificationRequest to notification center at specified firedate. Fires immediately if firedate is not set. | function | no | iOS | yes |
+| getDeliveredNotifications | Provides you with a list of the app’s notifications that are still displayed in Notification Center | function | no | iOS | yes |
+| removeAllDeliveredNotifications | Remove all delivered notifications from Notification Center | function | no | iOS | yes |
+| removeDeliveredNotifications | Removes the specified delivered notifications from Notification Center | function | no | iOS | yes |
+| setApplicationIconBadgeNumber | Sets the badge number for the app icon on the home screen | function | no | iOS | yes |
+| getApplicationIconBadgeNumber | Gets the current badge number for the app icon on the home screen | function | no | iOS | no |
+| cancelLocalNotifications | Cancel local notifications | function | no | iOS | no |
+| requestPermissions | Requests notification permissions from iOS, prompting the user's dialog box. By default, it will request all notification permissions, but a subset of these can be requested by passing a map of requested permissions. The following permissions are supported | function | no | iOS | no |
+| abandonPermissions | Unregister for all remote notifications received via Apple Push Notification service | function | no | iOS | no |
+| checkPermissions | See what push permissions are currently enabled | function | no | iOS | no |
+| getInitialNotification | This method returns a promise. If the app was launched by a push notification, this promise resolves to an object of type PushNotificationIOS. Otherwise, it resolves to null. | function | no | iOS | no |
+| getScheduledLocalNotifications | Gets the local notifications that are currently scheduled | function | no | iOS | no |
## 属性
@@ -312,7 +327,6 @@ RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1
> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-以下属性已验证,更多属性详情请查看 [react-native-push-notification-ios 的文档介绍](https://github.com/react-native-oh-library/react-native-push-notification)
**Parameters:**
@@ -322,25 +336,28 @@ _NotificationRequest:_
| ---------- | ----------------------------------------------------------------- | ------- | -------- | -------- | ----------------- |
| `id` | Identifier of the notification | string | yes | All | yes |
| `title` | A short description of the reason for the notification | string | yes | All | yes |
-| `subtitle` | A secondary description of the reason for the notification | string | no | All | yes |
+| `subtitle` | A secondary description of the reason for the notification | string | no | All | no |
| `body` | The message displayed in the notificatio | string | yes | All | yes |
| `badge` | The number to display as the app's icon badge | number | no | All | yes |
| `fireDate` | The date and time when the system should deliver the notification | object | no | All | yes |
-| `repeats` | Sets notification to repeat | boolean | no | All | yes |
+| `repeats` | Sets notification to repeat | boolean | no | All | no |
+| `repeatsComponent` | An object indicating which parts of fireDate should be repeated | object | no | All | no |
+| `sound` | The sound played when the notification is fired | string | no | All | yes |
+| `category` | The category of this notification, required for actionable notifications | string | no | All | no |
| `isSilent` | If true, the notification will appear without sound | boolean | no | All | yes |
+| `isCritical` | If true, the notification sound be played even when the device is locked, muted, or has Do Not Disturb enabled | boolean | no | All | no |
+| `criticalSoundVolume` | A number between 0 and 1 for volume of critical notification. Default volume will be used if not specified | number | no | All | no |
| `userInfo` | An object containing additional notification data | object | no | All | yes |
-
----
+| `isTimeZoneAgnostic` | If true, fireDate adjusted automatically upon time zone changes (e.g. for an alarm clock) | boolean | no | All | no |
+| `interruptionLevel` | A string specifying the interruption level. Valid values are `'active'`, `'passive'`, `'timeSensitive'`, or `'critical'` | string | no | All | no |
## 遗留问题
-- [ ] HarmonyOS 的 NotificationManager 的规格和 IOS 不一致,其 NotificationRequest 所含参数,在 HarmonyOS 上部分没有适配对应参数,问题: [issue#1](https://github.com/react-native-oh-library/react-native-push-notification/issues/1)
-- [ ] 原库部分接口在 HarmonyOS 中没有对应接口处理相关逻辑,问题: [issue#2](https://github.com/react-native-oh-library/react-native-push-notification/issues/2)
+- [ ] HarmonyOS 的 NotificationManager 的规格和 IOS 不一致,其 NotificationRequest 所含参数,在 HarmonyOS 上部分没有适配对应参数,问题: [issue#1](https://github.com/react-native-oh-library/react-native-push-notification-ios/issues/4)
+- [ ] 原库部分接口在 HarmonyOS 中没有对应接口处理相关逻辑,问题: [issue#2](https://github.com/react-native-oh-library/react-native-push-notification-ios/issues/3)
## 其他
## 开源协议
-本项目基于 [The MIT License (MIT)](https://github.com/react-native-push-notification/ios/blob/master/LICENSE) ,请自由地享受和参与开源。
-
-
\ No newline at end of file
+本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-push-notification-ios/blob/sig/LICENSE) ,请自由地享受和参与开源。
\ No newline at end of file