简体   繁体   中英

Open Facebook App via Unity Script on Android?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM