9

there!

I want to open my Facebook Page (not profile) in native IOS Facebook App, using URL Scheme.

I'm testing this feature - on this example fb://profile

It works fine.

But, when i trying to open my Facebook Page - by fb://page/141720395863506

it just redirect me to Facebook app and nothing happens, simply opens the application, and loads news feed.

Please, help me. I can't find any documentation of official facebook developers guide. And have some quistions: Does, Facebook IOS App Url Sheme still support this feature. And that I might be doing wrong in this situation?

Best regards!

vburlak
  • 113
  • 1
  • 1
  • 5
  • you mean to say , you want to look into your FB wall without login? – iMeMyself Aug 24 '12 at 10:34
  • 1
    @iShru - no, new version of fb app changed the url scemes and these links that worked previously no longer work. I don't have a solution but sure would like to find one. – jab11 Aug 27 '12 at 22:05

4 Answers4

19

I believe I've found a solution... It works currently under facebook ios 5.0.1 for iPhone.. haven't tried it in iPad yet.

The url is fb://profile/132753734806

NOW the important part is that number. That links to one of my clients, Charles Scott. HOWEVER, that's not their FBID or Page ID.. their Page ID is 10150348920319807

so you would think it should be fb://profile/10150348920319807 but that gives me an error.

Here's how you get the correct code.. click on any of your page's photos.. here's an example for my client https://www.facebook.com/photo.php?fbid=10150348920319807&set=a.10150348920314807.356942.132753734806&type=1&theater

if you notice the FBID that does not work follows fbid= in that URL.. the number you WANT is just before the &type=1theater but following that last period. 132753734806 is the correct code to punch in after fb://profile/

I hope that makes some sense... I know zero about code or coding but this was bothering me so much and I knew there was a way.

Now, the two questions I would love to have answered/working.. 1. if this could work on android phones 2. create a working qr code for this url so people can scan with ios devices and have it open automatically

Good luck and I hope this helps everyone!

Alessandro
  • 266
  • 2
  • 2
  • Very nice find! Worked perfect. – RyanG Nov 01 '12 at 02:34
  • Spot on. Also you can see the ID you need in practically every page that deals with pages, such as editing. –  Nov 11 '12 at 10:22
  • @Alessandro if user logged out from facebook app. then it open the app for login, but after login it will not redirect to your page. how we can handle this ?? – alok srivastava Sep 05 '14 at 06:37
  • This didn't work for me but using `fb://page/$pageID` did work where the pageID is found from going to the page > about us and scrolling down to find the "page id" ... actually scratch that, typing in "fb://page/9101337646" in my mobile browser (FF) takes me to the page in the app. Having that same URL as a meta refresh just takes me to the app without the page being shown. Gah! – pbhj Sep 25 '17 at 15:38
6

The above answer by Alessandro is correct, but that didn't really worked for me.. So this is the proper method. I had a URL https://www.facebook.com/pageName Now, go to: http://findmyfacebookid.com Paste your URL, get Facebook id, and then make url as @"fb://profile/pageID"

IT WORKED FOR ME!

NOTE : Put a check if native application is intalled in a device, else open it through default browser.

 if (![[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"fb://profile/pageId"]]) 
{            
   NSURL *url = [NSURL URLWithString:@"https://www.facebook.com/pageName"];
   [[UIApplication sharedApplication] openURL:url];
}
Muhammad Asad
  • 1,013
  • 13
  • 11
1

Swift 3.0 / iOS10:

let fbUrl: NSURL = NSURL(string: "fb://profile/55555555555555")!
let fbWebUrl: NSURL = NSURL(string: "https://facebook.com/yourFacebookPageName")!

if (UIApplication.shared.canOpenURL(fbUrl as URL)) {
    if #available(iOS 10.0, *) {
        UIApplication.shared.open(fbUrl as URL, options: [:], completionHandler: nil)
    } else {
        // Fallback on earlier versions
        UIApplication.shared.openURL(fbUrl as URL)
    }
} else {
    if #available(iOS 10.0, *) {
        UIApplication.shared.open(fbWebUrl as URL, options: [:], completionHandler: nil)
    } else {
        // Fallback on earlier versions
        UIApplication.shared.openURL(fbWebUrl as URL)
    }
}

"55555555555555" should be replaced with the numerical Facebook ID you can get from http://findmyfbid.com and "yourFacebookPageName" with the page's username.

Don't forget to enable the fb url scheme in your app's Info.plist (under LSApplicationQueriesSchemes).

brown
  • 173
  • 1
  • 6
0

I think this describes a programatic/formal wat of discovering such links for applications: https://developers.facebook.com/docs/applinks

cancerbero
  • 6,799
  • 1
  • 32
  • 24