I am using prime31, via graphRequest i did not get solution.
public void LikeUsButton()
{
#if UNITY_ANDROID
if(checkPackageAppIsPresent("com.facebook.katana"))
{
Application.OpenURL("fb://page/375158539307294"); //there is Facebook app installed so let's use it
}
else
{
Application.OpenURL("https://www.facebook.com/foxy.the.game"); // no Facebook app - use built-in web browser
}
#endif
}
#if UNITY_ANDROID
private bool checkPackageAppIsPresent(string package)
{
AndroidJavaClass up = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ca = up.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject packageManager = ca.Call<AndroidJavaObject>("getPackageManager");
//take the list of all packages on the device
AndroidJavaObject appList = packageManager.Call<AndroidJavaObject>("getInstalledPackages",0);
int num = appList.Call<int>("size");
for(int i = 0; i < num; i++)
{
AndroidJavaObject appInfo = appList.Call<AndroidJavaObject>("get", i);
string packageNew = appInfo.Get<string>("packageName");
if(packageNew.CompareTo(package) == 0)
{
return true;
}
}
return false;
}
#endif,