Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Facebook page in Native Facebook IOS App via simple URL Sheme issue

Tags:

url

ios

facebook

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!

like image 826
vburlak Avatar asked Aug 24 '12 10:08

vburlak


People also ask

Why Facebook link open in browser instead of app?

The Facebook app opens links in its built-in browser by default. That is so because it's convenient and just works without burdening you with extra configuration steps. However, not everyone wishes to use Facebook's mobile browser.


2 Answers

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];
}
like image 182
Muhammad Asad Avatar answered Nov 03 '22 02:11

Muhammad Asad


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!

like image 36
Alessandro Avatar answered Nov 03 '22 02:11

Alessandro