简体   繁体   中英

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.

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
}];

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
    }];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM