Open Facebook App via Unity Script on Android?

不想你离开。 提交于 2019-12-11 00:59:16

问题


I want to ask if there is a way to open the Facebook App instead of opening the Site on Browser.

Im using Unity with C#.

I tried the following Code but it won´t work for me:

IEnumerator OpenFacebookPage()
    {
        Application.OpenURL("fb://hatchthepokeggofficial/");
        yield return new WaitForSeconds(1);
        if (leftApp)
        {
            leftApp = false;
        }
        else
        {
            Application.OpenURL("https://www.facebook.com/hatchthepokeggofficial");
        }
    }

It opens the App but I don´t land on the Site.


回答1:


Yes You need to use your Page ID instead of the custom URL. The code you are using is alright. You just need to use the page ID that you can get from the About Section of your page.



来源:https://stackoverflow.com/questions/48042767/open-facebook-app-via-unity-script-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!