rammus icon indicating copy to clipboard operation
rammus copied to clipboard

Android app在退出状态时,点击通知,rammus.onNotificationOpened.listen不能监听到,是正常的吗?

Open hbshun opened this issue 4 years ago • 9 comments

Android app在退出状态时,点击通知,rammus.onNotificationOpened.listen不能监听到,是正常的吗? 请大佬指点该如何解决这个问题。感谢

hbshun avatar Jan 12 '21 06:01 hbshun

是不是flutter还没有加载完成(绑定onNotificationOpened),就触发了钩子函数?

hbshun avatar Jan 12 '21 06:01 hbshun

同问,我也是这个情况, app在后台可以监听到通知, 如果杀死app后点击推送接受不到监听通知。

wengxianxun avatar Jan 20 '21 01:01 wengxianxun

这个时候Flutter Engine没有创建,显然是监听不到的

JarvanMo avatar Jan 22 '21 06:01 JarvanMo

我的情况是有时候可以监听到,有时不能。 看到代码中是延迟1500毫秒,才通知flutter。也就是说1.5秒通知flutter时,可能还没创建好。 要是1.5秒 还没创建好,突然有点担忧flutter的性能😭

hbshun avatar Jan 25 '21 09:01 hbshun

不是flutter性能引起的,一个是推送送达率,二你仔细分析一下逻辑------------------ 原始邮件 ------------------ 发件人: "Bangshun&nbsp;Huang"<[email protected]> 发送时间: 2021年1月25日(星期一) 下午5:06 收件人: "OpenFlutter/rammus"<[email protected]>; 抄送: "JarvanMo"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [OpenFlutter/rammus] Android app在退出状态时,点击通知,rammus.onNotificationOpened.listen不能监听到,是正常的吗? (#29)

JarvanMo avatar Jan 25 '21 09:01 JarvanMo

噢 好像是因为-通知点击回调为onNotificationClickedWithNoAction而不是onNotificationOpened 谢谢

hbshun avatar Jan 25 '21 09:01 hbshun

噢 好像是因为-通知点击回调为onNotificationClickedWithNoAction而不是onNotificationOpened 谢谢

把 onNotificationOpened 逻辑复用到 onNotificationClickedWithNoAction 里,能 fix 这个 issue 嘛

hellobq avatar Mar 08 '21 03:03 hellobq

app退出状态下,点击通知唤醒app,onNotificationClickedWithNoAction 还是监听不到通知,注册rummus的代码已经提前到runApp(MyApp()) 之前了,是不是我的操作不对?

CatEatFishs avatar Jan 28 '22 14:01 CatEatFishs

噢 好像是因为-通知点击回调为onNotificationClickedWithNoAction而不是onNotificationOpened 谢谢

把 onNotificationOpened 逻辑复用到 onNotificationClickedWithNoAction 里,能 fix 这个 issue 嘛

请问 你解决了么?

CatEatFishs avatar Jan 28 '22 16:01 CatEatFishs