flutter-unity-view-widget
flutter-unity-view-widget copied to clipboard
Open unity from flutter, set the whole app in background, reopen, app freeze.
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:
- Open flutter app
- Click on button to open unity, enter AR
- turn app to background
- 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]
I have this same issue, rolling back to 4.2.1 solves it for now
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:
- Open flutter app
- Click on button to open unity, enter AR
- turn app to background
- 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?
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();
}