Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abangcc opened this issue Jan 12, 2021 · 9 comments

Comments

@abangcc
Copy link

abangcc commented Jan 12, 2021

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

@abangcc
Copy link
Author

abangcc commented Jan 12, 2021

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

@wengxianxun
Copy link
Contributor

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

@JarvanMo
Copy link
Member

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

@abangcc
Copy link
Author

abangcc commented Jan 25, 2021

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

@JarvanMo
Copy link
Member

JarvanMo commented Jan 25, 2021 via email

@abangcc
Copy link
Author

abangcc commented Jan 25, 2021

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

@hellobq
Copy link

hellobq commented Mar 8, 2021

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

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

@CatEatFishs
Copy link
Contributor

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

@CatEatFishs
Copy link
Contributor

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

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

请问 你解决了么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants