Skip to main content
May 27, 2019

How to detect app made with unity quit on Oculus Go

Hello everyone, are there anyone know how to detect app quit on Oculus Go? I have tried using OnApplicationQuit(), but it doesn't work. Unfortunately, after googling, there is no luck on what I am looking for. What I would like to do is to save the int with PlayerPref() when app is quit. 
This topic has been closed for replies.

4 replies

May 27, 2019
Already get what i was looking for works, but still would like to know how to save some value when the app quit.
Inspiring
June 4, 2019
Hi we're handling OnApplicationPause to save state instead of OnApplicationQuit for this reason.  
Inspiring
November 16, 2022

OnApplicationPause doesn't get called on forced shutdown due to low battery, so we added this hook to our Android plugin which may be of use to others

 

public class MyReceiver extends BroadcastReceiver {
    @override
    public void onReceive(Context context, Intent intent) {
        if (action.equals("android.intent.action.ACTION_REQUEST_SHUTDOWN")) {
           UnityPlayer.UnitySendMessage("GlobalGameObject", "AndroidShutdown", "");
        }
    }
};
 
New Participant
February 13, 2024

Hi, how did you do it?