Skip to content
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

Initialize without a notification? #24

Closed
willhaslett opened this issue Apr 2, 2021 · 4 comments
Closed

Initialize without a notification? #24

willhaslett opened this issue Apr 2, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@willhaslett
Copy link

willhaslett commented Apr 2, 2021

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 for FlutterBackgroundAndroidConfig includes dummy values for a notification, but does the 'initialize' call to the MethodChannel necessarily generate a notification?

@willhaslett willhaslett added the enhancement New feature or request label Apr 2, 2021
@JulianAssmann JulianAssmann added the question Further information is requested label Apr 2, 2021
@JulianAssmann
Copy link
Owner

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...

@willhaslett
Copy link
Author

@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.

@JulianAssmann
Copy link
Owner

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.

@JulianAssmann
Copy link
Owner

Closing this issue due to inactivity. Feel free to reopen at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants