【问题标题】:number of flutter local notification schedule and a list of notification IDsFlutter 本地通知计划的数量和通知 ID 列表
【发布时间】:2021-10-04 21:17:00
【问题描述】:

有没有办法获取已注册的预订通知的列表?

我想知道flutter本地通知时间表的数量和通知ID列表。

【问题讨论】:

  • 你应该在你的解决方案尝试中发布代码 sn-p,这样人们可以更好地帮助你

标签: flutter localnotification


【解决方案1】:

将此函数添加到本地通知类中,您可以从外部使用对象调用它

returnPendingNotifications() async {
    final List<PendingNotificationRequest> pendingNotificationRequests =
        await flutterLocalNotificationsPlugin.pendingNotificationRequests();
    return pendingNotificationRequests;
  }

它将返回带有 id、标题、正文和有效负载的待处理通知列表

【讨论】:

  • 有什么办法可以知道排班时间吗?
  • 很遗憾没有。我发现的解决方法是将时间存储在有效负载中
猜你喜欢
  • 2020-11-26
  • 1970-01-01
  • 2022-12-07
  • 1970-01-01
  • 2019-09-29
  • 1970-01-01
  • 2022-11-29
  • 1970-01-01
  • 2014-08-27
相关资源
最近更新 更多