当用户点击被杀死状态时,FLUTTER FCM推送通知显示空白屏幕

发布于 2025-01-29 01:17:41 字数 101 浏览 4 评论 0原文

当用户点击应用程序的终止状态时,它将打开空白屏幕并粘在此屏幕上,当应用在后台时,它将在Desire屏幕中浏览用户,因此我在“杀死状态”中遇到问题,应用程序会粘在用户点击推送通知时空白屏幕。

When user tap on push notification in termination state of app then it will open blank screen and app stuck on this screen and when app is in background then it will navigate the user in desire screen so I face issue in killed state that app will stuck on blank screen when user tap on push notification.

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

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

发布评论

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

评论(1

飞烟轻若梦 2025-02-05 01:17:41

对于App Active态和背景状态,将存在小部件树并导航到校正屏幕。当处于杀死状态时,该路线将不存在并试图导航到该屏幕。我遇到了同样的问题,发现这是主要原因。

我尝试使用捕获块来捕获异常,并避免零指针异常。因此,初始路由屏幕现在正在加载而没有白色屏幕。

try
 {
   // actual code here.
 }
 catch(exp)
 {
   // catch exception here
   print("exception in app kill state is $exp");
 } 

  

For app active state and background state, widget tree will be exist and navigating to correct screen. When in killed state, that route will not exists and trying to navigate to that screen..So it got null exception, results in blank screen. I got same issue and found this as main cause.

I used try and catch block to catch exception and avoid null pointer exception. So initial route screen is loading without white screen now.

try
 {
   // actual code here.
 }
 catch(exp)
 {
   // catch exception here
   print("exception in app kill state is $exp");
 } 

  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文