Search Issue Tracker

By Design

Votes

31

Found in

2021.3.11f1

2022.3.0f1

2023.2.0a1

2023.3.0a3

Issue ID

UUM-18935

Regression

No

[Quest] Application.quitting does not get triggered on Oculus devices

--

-

Reproduction steps:
1. Open the user’s attached project
2. Build and Run using Android build platform
3. Observe the results via Quest 2

Expected result: Application.quitting event gets called as the Project launches and quits shortly after
Actual result: Application.quitting does not get triggered at all and the Project doesn’t quit by itself

Reproducible with: 2020.3.40f1, 2021.3.11f1, 2022.1.16f1, 2022.2.0b12, 2023.1.0a17

Reproducible on: Oculus (Quest 2), Android 10, CPU: Snapdragon XR2, GPU: Adreno (TM) 650
Not reproducible on: Google Pixel 3 (Pixel 3), CPU: Snapdragon 845, GPU: Adreno 630, OS: 12.0.0

  1. Resolution Note:

    We are marking this as "As Designed" due to some limitations of Android. Based on their lifecycle documentation, when the application is paused, the activity is no longer visible, meaning that the quitting event can't be listened for.

    To work around this, there are a couple options:
    The first option is to use OnApplicationFocus(bool), which is called when focus is lost, or gained.
    The second option is to use OnApplicationPause(bool), which is called when pausing/unpausing.
    Listening for these events and their bool arguments should give you similar functionality.

    Since this limitation isn't clear, we will work to update the documentation to reflect this.

    https://developer.android.com/guide/components/activities/activity-lifecycle
    https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationFocus.html
    https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationPause.html

Comments (1)

  1. BigRedzz

    Aug 31, 2023 18:13

    3 years and this is still a thing?

    We have kludged together a workaround using Meta's SDK but I don't understand why Unity is making us have to resort to such extremes...

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.