From 4d3e1025cbb4da882556800aaedd4a7158635fd8 Mon Sep 17 00:00:00 2001 From: rjh <15191819693@163.com> Date: Fri, 23 Aug 2024 09:31:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20[Issue:=20#IALWXG]=E6=96=B0?= =?UTF-8?q?=E5=A2=9Epush-notification-ios=E7=9A=84=E6=8C=87=E5=AF=BC?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-native-community-push-notification-ios.md | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/zh-cn/react-native-community-push-notification-ios.md b/zh-cn/react-native-community-push-notification-ios.md index e0cc9e96..3203bb95 100644 --- a/zh-cn/react-native-community-push-notification-ios.md +++ b/zh-cn/react-native-community-push-notification-ios.md @@ -1,12 +1,12 @@ - -> 模板版本:v0.1.3 +> 模板版本:v0.2.2
@react-native-community/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"
+ }
+}
+```
+
### 引入原生端代码
目前有两种方法:
@@ -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
@@ -301,10 +309,16 @@ 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 |
+| getDeliveredNotifications | Provides you with a list of the app’s notifications that are still displayed in Notification Center | function | no | IOS/HarmonyOS | yes |
+| removeAllDeliveredNotifications | Remove all delivered notifications from Notification Center | function | no | IOS/HarmonyOS | yes |
+| removeDeliveredNotifications | Removes the specified delivered notifications from Notification Center | function | no | IOS/HarmonyOS | yes |
+| setApplicationIconBadgeNumber | Sets the badge number for the app icon on the home screen | function | no | IOS/HarmonyOS | 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 |
## 属性
@@ -312,7 +326,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,15 +335,21 @@ _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 |
----
## 遗留问题
@@ -341,6 +360,4 @@ _NotificationRequest:_
## 开源协议
-本项目基于 [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
--
Gitee
From 3c44614afae921dacf116e73b44178b7c2299aaa Mon Sep 17 00:00:00 2001
From: rjh <15191819693@163.com>
Date: Fri, 23 Aug 2024 11:33:40 +0800
Subject: [PATCH 2/2] =?UTF-8?q?docs:=20[Issue:=20#IALWXG]=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9push-notification-ios=E7=9A=84=E6=8C=87=E5=AF=BC?=
=?UTF-8?q?=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...-native-community-push-notification-ios.md | 38 +++++++++----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/zh-cn/react-native-community-push-notification-ios.md b/zh-cn/react-native-community-push-notification-ios.md
index 3203bb95..cd1ba5b4 100644
--- a/zh-cn/react-native-community-push-notification-ios.md
+++ b/zh-cn/react-native-community-push-notification-ios.md
@@ -13,7 +13,7 @@