1

I am new to oculus development in unity. I want to launch application from oculus browser. I tried this way was working fine in android phone but not launching app in quest 2.

https://docs.unity.cn/2021.2/Documentation/Manual/deep-linking.html

And I tried another way of using java script: by passing appID. Here I am not sure what is appID. I just passed by package name like "com.company.nameofmyapp" but it was not helpful. Please help me to achive this. Thanks in advance.

void OpenOculusStorePDPAndroid(string targetAppID)
    {
        AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
        AndroidJavaObject packageManager = currentActivity.Call<AndroidJavaObject>("getPackageManager");
        AndroidJavaObject i = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage", "com.oculus.home");
        i.Call<AndroidJavaObject>("setClassName", "com.oculus.home", "com.oculus.home.HomeActivity");
        i.Call<AndroidJavaObject>("setAction", "pdp");
        i.Call<AndroidJavaObject>("putExtra", "intent_cmd", targetAppID);

        currentActivity.Call("startActivity", i);
    }
frankhermes
  • 4,720
  • 1
  • 22
  • 39
Ramji
  • 11
  • 1

0 Answers0