0

I have the following code in my iOS app, attempting to open up a user's Facebook page in the app:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"fb://profile/%@",fbidStr]];

    [[UIApplication sharedApplication] openURL:url];

    if ([[UIApplication sharedApplication] canOpenURL:url]){
        [[UIApplication sharedApplication] openURL:url];
    }

    else {
      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://www.facebook.com/%@",fbidStr]]];
    }

When the app opens, I get an error 'The page you requested was not found'. I've NSLogged the URL and it looks fine:

fb://profile/10154531xxxxx65245

And everything works fine when the user doesn't have the app installed and views the profile in safari.

What could be wrong here?

AdamTheRaysFan
  • 175
  • 2
  • 9

1 Answers1

0

I've had the some problem, it seems that Facebook only accepts on their profile module people that are already friends with you.

Pedro Góes
  • 722
  • 6
  • 19