I have found a few solutions to this problem, where the back or X button (in top-left corner) won't exit the application, but they no longer seem to work and my application keeps getting rejected from the Daydream Program.
I have found the following solutions:
- http://answers.unity3d.com/questions/1276950/daydreams-native-x-quit-button-doesnt-quit-the-app.html
- https://forum.unity3d.com/threads/the-app-does-not-exit-when-a-user-selects-the-back-or-close-button.453939/
And I have personally tried the following two variants:
void LateUpdate() { GvrViewer.Instance.UpdateState(); if (GvrViewer.Instance.BackButtonPressed || Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } }
And more simply:
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } }
But with both variants, the application keeps getting rejected from the following reason:
The app does not exit when a user selects the home or back button When the user removes the phone from their viewer, both the close button (upper left corner) and the back button in the system bar should exit the VR app. The app must exit into 2D, not just Daydream Home. The close button must also be visible in your app.
I'm currently using Unity 5.6 and GoogleVR SDK 1.4.
Am I missing something? Is there any other way to detect that the back button/X button is pressed?