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

hi, does it work inside a background service? #11

Open
luohao123 opened this issue May 21, 2023 · 1 comment
Open

hi, does it work inside a background service? #11

luohao123 opened this issue May 21, 2023 · 1 comment

Comments

@luohao123
Copy link

this looks like tricky, am not sure if it can detect apps goes back from background and using inside backgounrd service.

What I want to do, is judge inside backgounrd service, if in background then send notificatio when new messages comes in, otherwise not notify since user already on UI.

Could lfutter-fgbg able to do this?

Why i need this is bacause i can not found a good way to control backgroudn services with flutters's widgetBindgObserver

@ajinasokan
Copy link
Owner

I'm unsure. Is this a native background service? Sample code? There could be APIs in notification system to do this, because this is how most apps behave.

A workaround will be your Flutter app storing the last flutter_fgbg event somewhere your background service can access. Service can just check the value to figure out app's current state. But there might be an issue when user swipe closes the app from recent apps or app crashes during the use. That will have to be checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants