Open VaibhavNeosoft opened 1 year ago
This is an Android-only feature, but the documentation was not clear on that.
I have converted this into a documentation request rather than a bug report so that I can remember to correct the documentation.
Is there anything that can be done to listen to the notification click on iOS?
I am not aware of any, but if you are able to research and find a corresponding API on iOS, I could implement it for you.
To determine whether a user has clicked on a notification in an iOS app, it is common to register a notification delegate, UNUserNotificationCenterDelegate, in the AppDelegate.swift file. By doing so, when a user interacts with a notification, the delegate receives an update and can trigger the necessary methods to notify the Flutter code about the notification click. This approach is typically used for regular notifications, but I am uncertain about its compatibility with Audio notification.
Upon reviewing your implementation in AudioServicePlugin.m, which contains native iOS code, I did not find a straightforward way to implement the above solution. I would like to know if there is a possibility of implementing the above solution within your existing implementation.
@ryanheise
I am facing the similar issue, any update on this @ryanheise.
Upon reviewing your implementation in AudioServicePlugin.m, which contains native iOS code, I did not find a straightforward way to implement the above solution. I would like to know if there is a possibility of implementing the above solution within your existing implementation.
Yes, I think so.
The AppDelegate.switch
file or the AppDelegate.m
file is not part of the plugin, it is part of your app. So it would just require adding iOS setup instructions to the README guiding app developers on how to configure this file.
Here is another iOS plugin that takes a similar approach:
Hi, When playing in the background, I click the playback control in the notification bar to enter the foreground. Which event can be monitored? Thank you.
(edit: Documentation request)
Documented behaviour
notificationClicked property A stream that broadcasts the status of the notificationClick event.
Actual behaviour
when the app is open from notification, the listener notificationClick is not receiving any update in iOS.
Minimal reproduction project
Official example: main.dart
Reproduction steps
Output of flutter doctor