Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open someone's profile page with their app scope ID in native iOS Facebook app

From Open Graph v2.0 apps no longer can access Facebook user's actual ID, but have to deal with app scope ID. This means in iOS the url scheme link @"fb://profile/123456" no longer works, since we need user's actual ID there.

Is there a way to open user's page with only app scope ID in the native iOS facebook app?

Here is my current code, which produces a "page not found" error in native iOS Facebook app.

NSString *link = [NSString stringWithFormat:@"fb://profile/%@", fbID];
NSURL *facebookURL = [NSURL URLWithString:link];
if ([[UIApplication sharedApplication] canOpenURL:facebookURL]) {
    [[UIApplication sharedApplication] openURL:facebookURL];
} else {
    NSString *link = [NSString stringWithFormat:@"http://facebook.com/%@", fbID];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:link]];
}
like image 717
Flying_Banana Avatar asked Oct 18 '14 08:10

Flying_Banana


1 Answers

Hi based on this documentation. So the Facebook ID it is the App-scoped User ID. So you can use same based URL schemes as well. Try to use this request to open user profile:

fb://profile?app_scoped_user_id=%@

Also consider this article about this request as well. After all it seems to me you should use Safari to show user profile.

like image 79
Oleg Gordiichuk Avatar answered Sep 22 '22 20:09

Oleg Gordiichuk