Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

OpenURL Facebook not working

Discussion in 'Scripting' started by squigglyo, Aug 25, 2014.

  1. squigglyo

    squigglyo

    Joined:
    May 21, 2012
    Posts:
    107
    Hey Guys

    Recently i tested my Android and Windows apps and my links to facebook arent working properly.

    Android
    Application.OpenURL("facebook://profile/132332713584653");

    Windows
    Application.OpenURL("fb://profile/132332713584653");

    Havent tested my IOS version, but im guessing its broken too
    Application.OpenURL("fb://profile/132332713584653");

    Both of these open up the Facebook app, but they dont open up to the profile page, only to the main facebook page.
     
  2. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    I may stand to correction here it's been a while since I've done this, but I'm pretty sure you had to have the domain in there, eg:

    Code (CSharp):
    1. Application.OpenURL("facebook://facebook.com/profile/132332713584653");
    Have you tried that?
     
  3. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I guess you need to add "https://" for Open URL to work properly :
    Code (JavaScript):
    1. Application.OpenURL("https://facebook.com/profile/132332713584653");
     
  4. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    He's wanting to open the facebook application rather than the browser from what I understand, in which case you need to use "facebook://" or "fb://" or sometimes just a single forward eg: "facebook:/" or "fb:/" (sorry can't remember it's been a long time for me since I last used that).
     
  5. squigglyo

    squigglyo

    Joined:
    May 21, 2012
    Posts:
    107
    no you dont. If you want to open a secure link then sure, https is 'neccesary' but OpenURL doesnt need http/https if your trying to open an app, such as facebook.

    Tried Intense_Gamers suggestion and yours, swapping 'facebook' and 'fb' as well to see if any change. Either it didnt work because it was wrong or it opened up facebook ignoring the profile still.
     
  6. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    I just tried the following URI on my Android phone and it worked perfectly, opened the FB app and went to his profile:

    Code (JavaScript):
    1. "fb://profile/4"
    Opens Mark Zuckerberg's Facebook profile.
     
  7. squigglyo

    squigglyo

    Joined:
    May 21, 2012
    Posts:
    107
    Application.OpenURL("fb://profile/4") didnt work for me. It just opened up the Facebook app. No profile.
    Same as "facebook://profile/4"