Closed willhaslett closed 3 years ago
Yes, unfortunately a foreground notification is required by Android to enable foreground services used by this plugin. See here for more information on that.
What exactly are you trying to achieve? Maybe there is a way without a notifications requirement to achieve it...
@JulianAssmann ah, I see. I simply need to keep the app alive for periodic sensor data acquisition (users are aware of this and agree, it's a research app). I actually do want to created notifications when the app is backgrounded under certain logical conditions, was just curious if that first notification was necessary. Now I understand. Thank you.
And thanks for this plugin. Keep-alive is so tricky and for Android this makes life much easier.
Yes, it's really confusing on Android, I agree. But at least it's possible at all (looking at you, iOS :))
However, if you only want to execute some code periodically, there is the option of so called WorkManagers and there is even a workmanager plugin for it in Flutter. Maybe this is enough for you.
Closing this issue due to inactivity. Feel free to reopen at any time.
My use case does not involve creating notifications, but It seems that I can't initialize the
FlutterBackground
object without generating a notification. I see how the default constructor forFlutterBackgroundAndroidConfig
includes dummy values for a notification, but does the 'initialize' call to theMethodChannel
necessarily generate a notification?