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?