-
Notifications
You must be signed in to change notification settings - Fork 35
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
Plugin reporting that the app is in background, while opening take image and pick Image. #5
Comments
Yes there seems to be a problem. Will investigate this. |
It seems image picker is now opening a different app/package for both camera(opens camera app) and file picking(open file manager) and not an activity on top of Flutter app. So app IS going to background that's why the plugin reported that way as well. I guess now it will be useful only in case of the biometric auth flow or any other lib that has activity based pickers. |
Thank you ajin for replying. So now I'm using AppLifeCycleState only. And the function which is opening image picker, I am using an if/else conditional, to not the call the required function, which I need to call for app inactivity, at that time. So, It's working fine. |
Alright. I will keep this issue open until we there is a proper fix/decision. |
flutter_fgbg is reporting that the app enters fg/bg when authenticating with passcode on my Android (ONEPLUS A5000 (mobile) • db8f9f95 • android-arm64 • Android 10 (API 29)) with local_auth |
@thorgexyz Does that open another app/activity that is not part of your app? Then it would report as foreground/background switch, because it is in fact a foreground/background switch. What is not such a switch is, an overlay that shows up above your app or an activity/fragment that is part of the app showing above/instead of your Flutter view. As I see more reports like this I'm assuming the manufacturers customize these things and this library is not very effective in every scenarios. |
any progress? |
any progress yet? did you find a solution for that? or anyone has a workaround? |
I have written a workaround (read as a nasty hack I'm not proud of) You can use the new FGBGEvents.ignoreWhile(() async {
await picker.pickImage(source: ImageSource.gallery);
// or do something else that can put app to background but don't want to be handled by flutter_fgbg
}); Any background foreground switches while the closure is executing will be suppressed. This is available in the master. Test it with this in pubspec and let me know if it works, I will make a new release. flutter_fgbg:
git:
url: https://github.com/ajinasokan/flutter_fgbg
commit: 19957b21bcf26bbc85cd73e02008afa053ef5c2c |
Thank you for the quick respond, will try that. |
How can we wait for |
@orkun1675 |
I tried running the example project in android emulator and it is giving same result as AppLifeCycleState. i.e, showing that the app is in background for image picker and then foreground when image picker is closed.

The text was updated successfully, but these errors were encountered: