Forum Discussion
B4neto
2 years agoHonored Guest
I want to launch the Message app installed on MetaQuest from an app developed with unity
I want to launch a messaging app installed on MetaQuest3 from an app developed with Unity.
I couldn't open the app with the following code, so I would like to ask if you have any ideas.
string packageName = "com.facebook.orca";
try
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject packageManager = currentActivity.Call<AndroidJavaObject>("getPackageManager");
AndroidJavaObject launchIntent = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage", packageName);
if (launchIntent != null)
{
currentActivity.Call("startActivity", launchIntent);
Debug.Log("Startup successful: " + packageName);
}
else
{
Debug.LogWarning("App not found : " + packageName);
}
}
catch (System.Exception e)
{
Debug.LogError("Startup Errors : " + e.Message);
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 15 days ago