Sandeep S
Sandeep S

Reputation: 7

iOS :Unable to get Facebook profile public data as media (Images & video)

I integrated FB account in my iOS mobile Application and it's approved by FB, But when any user logged in with FB login then only basic details coming successfully but unable to get the logged in User's media (Images/Video which uploaded by him as public)

I already mentioned the permission "let facebookReadPermissions = ["public_profile","email","user_birthday","user_photos","user_videos"]"

Also i logged out from mobile safari and did fresh login but no luck.

After long search i am not able to fix this issue, Please help me.

Upvotes: 0

Views: 146

Answers (2)

Nikunj Damani
Nikunj Damani

Reputation: 753

If you are taking the permission in FB login than for getting the data you should use this code after successful login to FB.

    FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
        initWithGraphPath:@"/me"
               parameters:@{ @"fields": @"id,name,photos,videos,email,picture,birthday",}
               HTTPMethod:@"GET"];
    [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
        // Insert your code here
    }];

Upvotes: 0

emraz
emraz

Reputation: 1613

You can try the Facebook Graph API. Check the code given below....

// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/me/feed"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Upvotes: 0

Related Questions