Skip to main content
May 27, 2019 6:32 AM UTC

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 8:33 AM UTC
Already get what i was looking for works, but still would like to know how to save some value when the app quit.
Inspiring
Jun 4, 2019 11:13 PM UTC
Hi we're handling OnApplicationPause to save state instead of OnApplicationQuit for this reason.  
Inspiring
Nov 16, 2022 1:53 PM UTC

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
Feb 13, 2024 3:37 PM UTC

Hi, how did you do it?