Hello!
We are making android app that needs to check if theres currently other apps with given bundle id installed.
Been using this bit of code succesfully before but recently it has started to claim every app is installed (and theyre not).
public bool CheckAppInstallation (string bundleId)
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject curActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject packageManager = curActivity.Call<AndroidJavaObject>("getPackageManager");
AndroidJavaObject launchIntent = null;
try
{
launchIntent = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage", bundleId);
return true;
}
catch (System.Exception e)
{
return false;
}
}
Anyone could come up with anything that I could be doing wrong?
Thanks in advance!