当应用程序在App背景或终止时,在扑来中收​​到的Firebase Notification打开屏幕

发布于 2025-02-10 14:46:21 字数 64 浏览 1 评论 0原文

想要创建一个屏幕,该屏幕是在应用程序在后台收到火箱通知或以扑朔迷离终止的屏幕(如包装呼叫)。请任何人帮助我创建它。

want to create a screen that launch when a firebase notification is received while the app is in the background or terminated in flutter (like package callKeep ).please anyone help me create that.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我闹别瞎闹 2025-02-17 14:46:21

您只需要处理其背景处理程序方法它将起作用。您需要在main()方法中初始化此方法。

Future<void> backgroundHandler(RemoteMessage message) async {
  debugPrint(message.toString());
  debugPrint(message.data.toString());
  debugPrint(message.notification!.title);
}
 FirebaseMessaging.onBackgroundMessage(backgroundHandler);

You just need to handle its background handler method it will works.You need to initialize this method in main() method.

Future<void> backgroundHandler(RemoteMessage message) async {
  debugPrint(message.toString());
  debugPrint(message.data.toString());
  debugPrint(message.notification!.title);
}
 FirebaseMessaging.onBackgroundMessage(backgroundHandler);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文