Hi Guys,
I have succesfully installed on our pico 4 enteprise devices and everything works well.
But we bought 8 new Pico 4 Ultra Enterprise devices and wanted to port it to it.
I'am encoutering something weird with your API. When it start installing I get a code "102" that is not in your documentation.
Could you help?
Here is the script I use for the pico 4 Enterprise and the Ultra's:
private async System.Threading.Tasks.Task DownloadAndInstallAPK(string apkUrl, string apkName)
{
try
{
string savePath = Path.Combine(apkFolder, apkName);
string fullUrl = apkUrl.StartsWith("http") ? apkUrl : $"https://{serverIP}{apkUrl}";
// Download APK bytes from server
byte[] apkBytes = await httpClient.GetByteArrayAsync(fullUrl);
File.WriteAllBytes(savePath, apkBytes);
UnityEngine.Debug.Log($"📦 APK downloaded to {savePath}");
InstallStatusText.text = $"📦 APK downloaded to {savePath}";
// Silent install on PICO device
InstallStatusText.text = $"📦 installing...";
Debug.LogWarning("📦 installing...");
PXR_Enterprise.ControlAPPManager(
Unity.XR.PICO.TOBSupport.PackageControlEnum.PACKAGE_SILENCE_INSTALL,
savePath,
(result) =>
{
Debug.Log("📦 Install callback result: " + result);
switch (result)
{
case 0:
UnityEngine.Debug.Log("✅ APK installed successfully!");
InstallStatusText.text += "\n✅ APK installed successfully!";
// 🔄 Refresh app panel
if (appListManager != null)
{
appListManager.RefreshAppList();
InstallStatusText.text += "\n🔄 App list refreshed.";
}
else Debug.LogWarning("⚠️ appListManager not assigned in Inspector.");
break;
case 1:
UnityEngine.Debug.LogError("❌ APK installation failed.");
InstallStatusText.text += "\n❌ APK installation failed.";
Debug.LogWarning("❌ APK installation failed.");
break;
case 2:
UnityEngine.Debug.LogError("❌ No permission for silent install.");
InstallStatusText.text += "\n❌ No permission for silent install.";
//InstallAPKWithIntent(savePath);
break;
}
}
);
}
catch (Exception e)
{
UnityEngine.Debug.LogError("❌ Failed to download or install APK: " + e.Message);
InstallStatusText.text = "❌ Failed to download or install APK: " + e.Message;
}
All the permissions are correct because it works on the pico 4 Enterprise.
Kind regards
Hi Guys,
I have succesfully installed on our pico 4 enteprise devices and everything works well.
But we bought 8 new Pico 4 Ultra Enterprise devices and wanted to port it to it.
I'am encoutering something weird with your API. When it start installing I get a code "102" that is not in your documentation.
Could you help?
Here is the script I use for the pico 4 Enterprise and the Ultra's:
private async System.Threading.Tasks.Task DownloadAndInstallAPK(string apkUrl, string apkName)
{
try
{
string savePath = Path.Combine(apkFolder, apkName);
string fullUrl = apkUrl.StartsWith("http") ? apkUrl : $"https://{serverIP}{apkUrl}";
// Download APK bytes from server
byte[] apkBytes = await httpClient.GetByteArrayAsync(fullUrl);
File.WriteAllBytes(savePath, apkBytes);
UnityEngine.Debug.Log($"📦 APK downloaded to {savePath}");
InstallStatusText.text = $"📦 APK downloaded to {savePath}";
All the permissions are correct because it works on the pico 4 Enterprise.
Kind regards