首页 > 解决方案 > 打开推送通知时的路由

问题描述

我正在为我们的项目使用 React Native Azure Notification Hub 库,单击远程推送通知后,我们一直难以导航到特定的应用程序屏幕。我如何通过本机反应来实现这一点。你能帮我们解决这个问题,或者展示解决这个问题的方法吗?

const NotificationHub = require('react-native-azurenotificationhub');
const PushNotificationEmitter = new NativeEventEmitter(NotificationHub);
const EVENT_REMOTE_NOTIFICATION_RECEIVED = 'remoteNotificationReceived';

useEffect(() => {
   PushNotificationEmitter.addListener(EVENT_REMOTE_NOTIFICATION_RECEIVED, _onRemoteNotification);
}, []);

function _onRemoteNotification(notification) {
    ...actions
}

标签: c#react-native.net-coreazure-notificationhub

解决方案


推荐阅读