首页 > 解决方案 > 如果应用程序未在后台运行,则 Expo-notifications 通知事件不起作用

问题描述

世博SDK:40

responseListener.current =
    Notifications.addNotificationResponseReceivedListener((response) => {
      axios.post("https://<logUrl.onOurServer.com>", {
        test: "background",
      });
    });

addNotificationResponseReceivedListener // dont work when app's not running

此方法在应用程序运行时向我发送通知邮件,但如果应用程序未运行,我无法从冷启动捕获此事件。是否有许可或其他东西可以使用?我刚刚从https://docs.expo.io/versions/latest/sdk/notifications/复制粘贴了代码, 并将日志记录添加到 https 端点,它在冷启动时不起作用

标签: expo

解决方案


推荐阅读