vendredi 1 juillet 2016

Facebook iOS API: how to get public profile URL

I'm using FBSDK to get basic information about the user like so: [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields" : @"id, about, birthday, email, first_name,last_name, link, middle_name, name, name_format, picture"} HTTPMethod:@"GET"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { if ([error.userInfo[FBSDKGraphRequestErrorGraphErrorCode] isEqual:@200]) { NSLog(@"error getting profile info"); } else { NSLog(@"success getting facebook profile %@", result); } }]; however, the link field returns a value like this: https://www.facebook.com/app_scoped_user_id/283581333995846/ when I open this link in a browser it asks me to login to Facebook before viewing this profile, but when I open another browser (on my desktop computer) and log in to this profile, the link would be https://www.facebook.com/profile.php?id=100012619704737 and if I give this link to anyone they can open it without having to login to Facebook to view the profile. my questions are: what does this number represent: 100012619704737 ? how to get the Facebook profile url (which is: https://www.facebook.com/profile.php?id=100012619704737) that can be opened on a browser without having to login to Facebook ? p.s. both numbers above have been changed for privacy reasons

Aucun commentaire:

Enregistrer un commentaire