Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

prello23

macrumors newbie
Original poster
Dec 20, 2011
10
0
i did this but is is not working what am i doing wrong it dose open Facebook app but just
in news feed?

Code:
- (IBAction)ribsafarifacebook;
    {
      NSURL *url = [NSURL URLWithString:@"fb://profile/ribsafari.is"];
      [[UIApplication sharedApplication] openURL:url];

    }
 
Last edited by a moderator:
I'm pretty sure you need the Facebook ID for the profile. Here is how I do it in one of my apps.

Code:
NSURL *facebookURL = [NSURL URLWithString:@"fb://profile/114276365276090"];

NSURL *safariURL = [NSURL URLWithString:@"http://facebook.com/kyfarmbureau"];

if ([[UIApplication sharedApplication] canOpenURL:facebookURL])
         {
             [[UIApplication sharedApplication] openURL:facebookURL];
         }
         else
         {
             [[UIApplication sharedApplication] openURL:safariURL];
         }
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.