Forum Discussion
andrew9067mille
7 years agoExplorer
install third party oculus go app in oculus go using code but i cannot interact with install pop up.
when i install apk through code in unity the install pop up appear in oculus go but i can't interact because it's open in full screen activity. i want to install apk through user permission. but oculus install permission popup is not vr friendly. is there a proper way to install 3rd party apk using oculus vr app?
this is my code to install everything works fine but the problem is when installation pop up open in vr i can't interact because it's open in monoscope.
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
this is my code to install everything works fine but the problem is when installation pop up open in vr i can't interact because it's open in monoscope.
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject unityContext = currentActivity.Call<AndroidJavaObject>("getBaseContext");
AndroidJavaObject activityContext=Jc.Call<AndroidJavaObject>("getApplicationContext");
//Get the package Name
string packageName = unityContext.Call<string>("getPackageName");
string authority = packageName + ".fileprovider";
AndroidJavaClass intentObj = new AndroidJavaClass("android.content.Intent");
string ACTION_VIEW = intentObj.GetStatic<string>("ACTION_VIEW");
AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent", ACTION_VIEW);
int FLAG_ACTIVITY_NEW_TASK = intentObj.GetStatic<int>("FLAG_ACTIVITY_NEW_TASK");
int FLAG_GRANT_READ_URI_PERMISSION = intentObj.GetStatic<int>("FLAG_GRANT_READ_URI_PERMISSION");
//File fileObj = new File(String pathname);
AndroidJavaObject fileObj = new AndroidJavaObject("java.io.File", apkPath);
//FileProvider object that will be used to call it static function
AndroidJavaClass fileProvider = new AndroidJavaClass("android.support.v4.content.FileProvider");
//getUriForFile(Context context, String authority, File file)
// AndroidJavaObject uri = fileProvider.CallStatic<AndroidJavaObject>("getUriForFile", unityContext, authority, fileObj);
AndroidJavaObject uri = fileProvider.CallStatic<AndroidJavaObject>("getUriForFile", unityContext, authority, fileObj);
intent.Call<AndroidJavaObject>("setDataAndType", uri, "application/vnd.android.package-archive");
intent.Call<AndroidJavaObject>("addFlags", FLAG_ACTIVITY_NEW_TASK);
intent.Call<AndroidJavaObject>("addFlags", FLAG_GRANT_READ_URI_PERMISSION);
currentActivity.Call("startActivity", intent);
5 Replies
Replies have been turned off for this discussion
- scott_green_564ExplorerI'm having the EXACT same issue. Can't interact with the popup at all
- andrew9067milleExploreri think they don't want to help their customers. bump
- scott_green_564ExplorerOh wow I didn't see you posted this on the 9th of Jan.... I've reported it in bugs also but no response
- andrew9067milleExplorerya i didn't get any response yet. they are not giving any tips. it's long time.
- scott_green_564ExplorerHi.
Has anyone figured out a work around for this? I'm still stuck
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
- 9 days ago
- 5 months ago
- 5 months ago