diff --git a/en/react-native-community-push-notification-ios.md b/en/react-native-community-push-notification-ios.md index 9ccfde4cf0cd802081f3cc81e208e4a843be914a..4a054769fcfb0ea600fec6212fbad017623e94e3 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 96dc5e7462d1b2af3a5a6c0933972f396f1141b0..f38391effa1951a4a21d802c0335ec44e7e5ecc3 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` 按钮