1
votes

I am using the below code to access users facebook information and storing it in parse, however, the id I receive from the below code does not allow me to obtain cover pic, however, I am able to obtain profile picture through it.

        [FBRequestConnection startForMeWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
            if (!error) {
                NSString *fbId = [result objectForKey:@"id"];

When I access the cover photo information through "https://graph.facebook.com/%@?fields=cover" gives me a graph method exception. I was able to obtain the cover photo until recently. Did facebook change the permissions necessary to obtain cover photo recently?

After further review I observed the the fbId I obtain is different from the users actual facebook id. How do I obtains users actual facebook id? The only change I made recently was creating a new application on facebook, is this related?

1

1 Answers

0
votes

Here is an updated solution.

var basicUserData = ["fields": "picture,id,birthday,email,first_name,last_name,gender"]

FBRequestConnection.startWithGraphPath("/me",
    parameters: basicUserData,
    HTTPMethod: "GET") {
        (connection:FBRequestConnection!, result, error) -> Void in
            if error != nil {
                print(error!)
            } else {
                print(result!)
            }
        }

The Parse team recommended getting FB profile picture by accessing the https://graph.facebook.com/(facebookId)/picture?type=large Make sure to replace with the user's Facebook Id. Here is the discussion

Notes: