-
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
onDidReceiveBackgroundNotificationResponse callback doesn't in background #2315
Comments
Same to me, it seems to not work properly! |
Same problem |
You can use the getNotificationAppLaunchDetails method instead. It returns a NotificationAppLaunchDetails which contains didNotificationLaunchApp to check if the notification launched the app and the NotificationResponse.
|
Same problem, onDidReceiveBackgroundNotificationResponse did not get called when tapping on text action. |
Same problem |
It turns out that it was my fault for not configuring the AndroidManifest file properly. The callback is getting called now |
Add |
The plugin is working as expected. I suspect the OP hasn't read the docs around the callback as the callback isn't about firing when the app is in the background. It's more on when the background isolate is used, especially for notification actions. Similarly the FCM callback has a callback that is invoked on a background isolate |
Turns out, I can't make onDidReceiveBackgroundNotificationResponse called or any of workaround offered here work when notification has been handled by OS (in background). I check if didNotificationLaunchApp is true during app lifecycle resumed state change and it's false! However this #2315 (comment) solved the issue decribed here (for foreground notifications): #2390. Anyone solved this somehow? |
Tried updating plugin from 16.1.0 to 17.2.2 as suggested in #2404, to no avail unfortunately. Did a flutter clean flutter pub get, made no difference!? |
@ced1check did you check my response that I made back in June that was above yours at #2315 (comment)? From what you've said, I suspect you may have a similar misunderstanding |
My bad, I actually didn't understand your comment at all and didn't read documentation. Reading the doc now, I understand it's purpose is to receive (pre-registered on iOS) actions from notifications, nothing more, nothing else. It won't get tap notification, farless its payload if any, and certainly not from a GCM notification. So why is this bug still open, if it's not a bug? Anyhow, I was originally looking for a solution for #2390, and found it here as a workaround only. By the name of OP's title I assumed (wrongly) that this method was used for tap on notifications received while in background (from GCM in my scenario). |
Fair question and it's a combination of not having gotten around to do so and in case others in the community were going to provide more complete details e.g. a link to a repo hosting a minimal app that can reproduce the issue. I will do so now to avoid further confusion. Note for others here that see this GitHub issue that the callback is only for notification actions that the app needs to respond to when it's not running. The "background" portion of the callback's name ( |
Describe the bug
I ran the project from the example folder and I don't have notificationTapBackground called in the example onDidReceiveBackgroundNotificationResponse: notificationTapBackground
notificationTapBackground
The text was updated successfully, but these errors were encountered: