flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

Open unity from flutter, set the whole app in background, reopen, app freeze.

Open git-radiusmedia opened this issue 3 years ago • 3 comments

Describe the bug After open unity from flutter, place object in AR, set the whole app in background, and then try to resume the app, app freeze.

To Reproduce Steps to reproduce the behavior:

  1. Open flutter app
  2. Click on button to open unity, enter AR
  3. turn app to background
  4. resume the app, whole application freezes.

Expected behavior The app should be be freezing when goes into background. Unity app alone in AR resumes after goes to background, flutter app alone resume as well after goes to background.

Unity (please complete the following information):

  • OS: [android]
  • Version [2019.4.28f.1]

Smartphone (please complete the following information):

  • Device: [huawei p30 pro]
  • OS: [iOS10]

git-radiusmedia avatar Oct 13 '21 14:10 git-radiusmedia

I have this same issue, rolling back to 4.2.1 solves it for now

TinyGiantDigital avatar Oct 13 '21 15:10 TinyGiantDigital

Describe the bug After open unity from flutter, place object in AR, set the whole app in background, and then try to resume the app, app freeze.

To Reproduce Steps to reproduce the behavior:

  1. Open flutter app
  2. Click on button to open unity, enter AR
  3. turn app to background
  4. resume the app, whole application freezes.

Expected behavior The app should be be freezing when goes into background. Unity app alone in AR resumes after goes to background, flutter app alone resume as well after goes to background.

Unity (please complete the following information):

  • OS: [android]
  • Version [2019.4.28f.1]

Smartphone (please complete the following information):

  • Device: [huawei p30 pro]
  • OS: [iOS10]

That's interesting...I also want to use AR...

Did you enable Background Processing? Bildschirmfoto 2021-10-18 um 18 28 46

Ahmadre avatar Oct 18 '21 16:10 Ahmadre

I have the same problem, I solved it with didChangeAppLifecycleState:

@override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    print("didChangeAppLifecycleState: $state");
    if (state == AppLifecycleState.resumed) {
      unityWidgetController.resume();
    } else if (state == AppLifecycleState.inactive) {
      unityWidgetController.pause();
    } else if (state == AppLifecycleState.paused) {
      unityWidgetController.pause();
    } else if (state == AppLifecycleState.detached) {
      unityWidgetController.pause();
    }

miklce avatar Oct 23 '21 04:10 miklce