From 384d30ca19ce80830673fc68660af5f817ae7964 Mon Sep 17 00:00:00 2001 From: tyBrave Date: Tue, 25 Mar 2025 18:16:29 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#IBW7IT]=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9react-native-community-push-notification-ios=E7=9A=84?= =?UTF-8?q?=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tyBrave --- ...eact-native-community-push-notification-ios.md | 15 ++++++++++++++- ...eact-native-community-push-notification-ios.md | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/en/react-native-community-push-notification-ios.md b/en/react-native-community-push-notification-ios.md index 9ccfde4c..4a054769 100644 --- a/en/react-native-community-push-notification-ios.md +++ b/en/react-native-community-push-notification-ios.md @@ -265,7 +265,20 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 2.5. Running +### 2.5. Introducing PushNotificationModule to ArkTS + +Open the `entry/src/main/ets/entryability/EntryAbility.ets`,file and add the following code: + +```diff + ... ++ import { PushNotificationModule } from '@react-native-ohos/push-notification-ios/ts'; + ... +onNewWant(want: Want, _launchParam: AbilityConstant.LaunchParam): void { ++ PushNotificationModule.getInstance().didReceiveRemoteNotification(want); +} +``` + +### 2.6. Running Click the `sync` button in the upper right corner. diff --git a/zh-cn/react-native-community-push-notification-ios.md b/zh-cn/react-native-community-push-notification-ios.md index 96dc5e74..f38391ef 100644 --- a/zh-cn/react-native-community-push-notification-ios.md +++ b/zh-cn/react-native-community-push-notification-ios.md @@ -264,7 +264,20 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 2.5. 运行 +### 2.5. 在 ArkTs 侧Ability中添加 + +打开 `entry/src/main/ets/entryability/EntryAbility.ets`,在onNewWant回调中添加: + +```diff + ... ++ import { PushNotificationModule } from '@react-native-ohos/push-notification-ios/ts'; + ... +onNewWant(want: Want, _launchParam: AbilityConstant.LaunchParam): void { ++ PushNotificationModule.getInstance().didReceiveRemoteNotification(want); +} +``` + +### 2.6. 运行 点击右上角的 `sync` 按钮 -- Gitee