-
Notifications
You must be signed in to change notification settings - Fork 95
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
changing notification button texts for running service #183
Comments
@dorjeduck It can be done—at least on Android, I don't know iOS. If you have a platform side plugin yourself, just add the following function:
Of course, you might want to modify parts. Here I only needed to send a replacement title, message or a single button but
I contemplated creating a PR but as the current plugin works, I couldn't find an easy way to connect to the running instance and I didn't want to start a major refactoring. Our plugin author might decide whether and how it should be implemented best. |
Oh yes, forgot to add, it only works from API 26 while Flutter is capable of running on earlier phones. Well, that's Oreo, probably not that many around any more. |
I did the PR, after all. :-) |
thanks a lot - I can't try it right now as my laptop broke but hopefully can give you feedback once I get it fixed |
Hi. Back to flutter and the project for which i asked the question here. Thanks again for your reply deakjahn . Sorry a bit lost right now, can you help me to understand to which file/class i should add the function "serverNotification". Thanks |
@dorjeduck I added several changes to the plugin (see #195) and I've been using the modified version for quite some time now. I don't know if the plugin is still actively maintained or not and whether the PR will be accepted or I will need to keep my own local copy but if you want to use it, you can refer to my github repo directly: https://github.com/deakjahn/flutter_foreground_task Basically, now that I looked back, it has three additions:
|
thx again - i wont have the time right now to digg into your PR unfortunately which is a bit challenging for me without an example (no complain just saying) So no feedback from me for now it seems, but hopefully this functionality will be included into this project in the future. All the best |
It's up to you :-) but there's really not much need for an example. You get a new |
Thx for your patience :-) Gave it another try and finally I got it, works like a charm, and indeed pretty straight forward to use. The one thing which confused me is that |
OK, nice if it works for you, too. |
Thanks for this great package and all the community information here.
Is it possible to change the text of the notification buttons in Android while a foreground service is running? I can't see it in the FlutterForegroundTask.updateService method. What i want is something similar to the timer notification of the standard Android Timer app, for which one button text changes between Pause and Resume when the button is pressed. Thx
The text was updated successfully, but these errors were encountered: