Flutter IOS终止状态从Firebase推送通知获取数据

发布于 2025-01-28 13:34:00 字数 457 浏览 5 评论 0原文

在终止状态时,我们如何获取推送通知的数据以将其保存在本地数据库中?

我们使用Firebase Admin-SDK使用发送到设备功能的发送通知

我们使用此有效负载,

const payload = {
  notification: {
    title: title,
    body: notification.message,
    sound: "default",
  },
  data: {
    click_action: "FLUTTER_NOTIFICATION_CLICK",
    title: title,
    message: notification.message,
  }
};

并使用消息选项发送通知

{
    contentAvailable: true,
    priority: 'high'
  }

How we can get the data of push notification to save it in our local database using flutter iOS while in terminated state?

We are using firebase admin-sdk to send push notification using the send to device function

we are using this payload

const payload = {
  notification: {
    title: title,
    body: notification.message,
    sound: "default",
  },
  data: {
    click_action: "FLUTTER_NOTIFICATION_CLICK",
    title: title,
    message: notification.message,
  }
};

with message options

{
    contentAvailable: true,
    priority: 'high'
  }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文