-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
onSelectNotification
has been called forever on Android
#751
Comments
This not a bug with the plugin but an issue in the example app. Back button doesn't exit the app, it only sends it to the background so you're actually resuming the app when you pick the recent app. State management and dealing with the app lifecycle will in these scenarios is up for developers to implement. For example, you might track the id of the last processed notification and this isn't done for the example as every notification has the same id to make it easier to demonstrate cancelling/removing a notification Edit: I'll leave some notes on this in an upcoming update |
My bad, I'm reopening this as this turned out not to do with the Flutter lifecycle. Would you be able to assist by testing the |
After tested the |
Hi @MaikuB , I have the same problem, I use sony ultra XA2, when I press the button restart onSelectNotification app is called automatically |
@matamune94 there's already a fix for it in the branch I mentioned in this issue. Please try it out and confirm it solves the issue for you so I can see about merging it in and releasing the fix |
So bad, i have error when add this plugin
I try fix it, i will report when test finished . thanks @MaikuB |
The plugin is not at the root of the repository so you need to fix your pubspec file to make sure you specify the path of the plugin. Please read the docs at https://dart.dev/tools/pub/dependencies#git-packages for more info |
@MaikuB something wrong ?
|
Yes, you didn't specify the path |
@MaikuB I tesed it not working .
|
@matamune94 Please describe in more detail |
@matamune94 You need to specify the location of the plugin since it didn't locate at the root of https://github.com/MaikuB/flutter_local_notifications.git To specify a different location in the repo, use the
|
Yeb plugin installed. |
I first launch app go to homeScreen and after 2 seconds it will send a notification, when i click on notification it will push to other screen, yeb it's good. But when re-launch app the screen automatically switches to otherScreen instead of the homeScreen |
Hi @gabf3st are you tested ? |
@matamune94 could you please record a video of the steps you've described so I can be sure that your issue is the same as what's been reported earlier here. Also I'd suggest running |
@matamune94 the scenario you described is different than what was reported by @gabf3st The scenario being reported here is if the app is sent to the background and the Android task/app switcher is used to resume the app. From the video, it looks like you hot restarted the app, and there's likely nothing I can do about that scenario because it's to do with the way the Flutter tooling works. Furthermore it's not a scenario that would happen to users as a hot restart is not the same process as a when a user restarts the app |
@MaikuB oh, I seem to have misunderstood, but this error is really an inconvenience in debugging the app, I hope you can fix it. thanks you supported |
That would require changes in how Flutter works so not something I can address . I doubt the team can do anything about it either as it related to how Android works in tracking what intent triggered an activity. That info is only cleared when the app has been completed killed/terminated |
Describe the bug
onSelectNotification
has been called forever once press Back button on device to exit and re-launch app with Recent app on AndroidTested on
Android 9
flutter_local_notifications :
1.4.4+2
and1.5.0-beta.6
To Reproduce
Show plain notification with payload
Expected behavior
When re-launch the app, it should not call
onSelectNotification
if user hasn't tap on the notificationAttachments
Here is the VDO to demonstrate the reproduce steps this issue
Link to VDO
The text was updated successfully, but these errors were encountered: