Unnyhog Entertainment Unnyhog Entertainment - 3 months ago 12
iOS Question

Redirecting while opening the FB page from ios app. Why?

I used the next code to open my facebook page from ios app :

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com/pages/UNNYHOG-Entertainment/208173649242257"]];

And everything was fine, and it's still fine if you don't have a FB app on your device. But if you have it - you will be redirected to https://m.facebook.com/pages/UNNYHOG-Entertainment/208173649242257?id=208173649242257&_rdr

Do anyone knows why does it happening? I guess they made some changes in their app. But what should i do to fix it?

Bot Bot

See http://wiki.akosma.com/IPhone_URL_Schemes#Facebook

For a page, you will want to use fb://profile/<page id>


If you want to only use the fb:// url if they have facebook installed then use

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]) {
    // Facebook app is installed
    fb://profile/<page id>

otherwise use the http:// url