flutter_fgbg icon indicating copy to clipboard operation
flutter_fgbg copied to clipboard

Is there a way to detect if the "app switcher view of an iOS device" is open?

Open yasinarik opened this issue 3 years ago • 3 comments

Hi 👋 @ajinasokan, thanks for building this package 🚀. Currently, it can detect if the app is in background or foreground state successfully.

However, it doesn't detect if the app is in app switcher state. I also want to detect if the app is in that state.

If you wonder what app switcher is where you can see the recently opened apps (or currently open apps).

  • On iOS devices with home buttons (for ex: iPhone 6,7,8 etc): if you double tap the device's home button on the bottom, it shows the app switcher view of iOS.
  • On iOS devices with full size screen (for ex: iPhone X,11,12,13 etc): if you swipe the bottom screen handle up and wait for a while, it shows the app switcher view of iOS.
  • Similar things apply on Android devices too. It can be opened either with tapping the square shaped virtual button or swiping the handle up.

Please consider this as a feature request if there is not a way of doing it. Thanks a lot.

yasinarik avatar Dec 20 '21 11:12 yasinarik

The PR #3 solves this issue.

yasinarik avatar Dec 20 '21 11:12 yasinarik

Are you sure you don't get these events from WidgetsBindingObserver? This lib is meant to be a fix for the shortcomings of WidgetsBindingObserver and not a replacement. If it doesn't provide the required events then I will take a detailed look at it.

ajinasokan avatar Dec 21 '21 04:12 ajinasokan

My use case: download fresh data as soon as user has internet. As per connectivity_plus, just their stream isn't enough, because it doesn't update when app returns to forground from background.

What is perfect about this app for my use case is that I don't need to add a widget to get that stream of events. So I think there is room to say that this app could offer events for more life cycles, even if WidgetsBindingObserver has them too. There could be a new stream with the more extended changes, because their need is less common.

yringler avatar Jan 10 '22 14:01 yringler