Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:09:38+00:00 2026-06-12T10:09:38+00:00

Im uploading and posting an image to a users Facebook from my (ios) code

  • 0

Im uploading and posting an image to a users Facebook from my (ios) code using the FacebookSDK3 and presenting a friendPickerController view, selecting an array of friends and trying to attach a tag to the pic.

This is my code for the actual tagging, it runs ok but then i get an error in the debugger, Error: HTTP status code: 200, and it was Error: HTTP status code: 400 when i applied a stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding to the graph path. It appears to be a permissions type error.. (this method is called after the pic is uploaded successfully, self.upLoadedPicID is NSString with the fbID for the post, and self.tagList is a NSMutableArray of objects (facebuddies to tag) passed back from the friendPickerController..

 -(void)tagFriends{

    if ([self.tagList count] > 0 && imageUploaded && [self.upLoadedPicID length]) {
    self.activityLabel.text = @"Tagging Photo";
    [self setSpindicatorOn:YES];

    NSMutableString *graphPath = [NSMutableString string];
    [graphPath appendString:self.upLoadedPicID];
    [graphPath appendString:[NSString stringWithFormat:@"/tags?tags=["]];


    // loopthru tag array..

    NSMutableString *iDs = [NSMutableString string];

    for (id<FBGraphUser> user in self.tagList) {

               if ([iDs length]) {
                [iDs appendString:@", "];
               }  //deliniate after first entry..

      NSString *entry = [NSString stringWithFormat:@"{\"tag_uid\":\"%@\"}", user.id];
      [iDs appendString:entry];
      }


    [graphPath appendString:iDs];[graphPath appendString:[NSString stringWithFormat:@"]&access_token=%@",[FBSession activeSession].accessToken]];
 //  NSLog(@"building graph path for tAgging %@", graphPath);
   //works fine
    FBRequestConnection *connection = [[FBRequestConnection alloc]init];
    FBRequest *request = [FBRequest requestForGraphPath:graphPath];


  // do i need URL encoding???

 //   NSString* escapedUrlString = [graphPath stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
  //  FBRequest *request = [FBRequest requestForGraphPath:escapedUrlString];

   // dont think so..

   [connection addRequest:request completionHandler:^(FBRequestConnection *connection, id result, NSError *error){

//     if (error) {
//       NSLog(@"error tagging");
       [self setSpindicatorOn:NO];
//     }else{
//       NSLog(@"done tagging");
//       [self setSpindicatorOn:NO];}
//   
     [self showAlert:@"done Tagging" result:result error:error];


   } batchEntryName:nil];
    [connection start];
   // [request ]
  }

}

The fbSession is alloc’d in the appDelegate and passed into the fbViewcontrollers before theyre presented with this, so perhaps my issue is the permissions that i’ve used here? I cant find any documentation on alternate permission strings to use here..

self.fbLoginView = [[FBLoginView alloc]initWithPermissions:[NSArray arrayWithObject:@"publish_actions"]];

the other possibility is that I didnt set up my facebook end app with the right permissions, I can go in and edit that, but its only a text entry, not a drop down menu or anything intuitive like that, and every list I can find of GraphApi permissions makes no mention of tagging friends to photos, its unclear whether the ‘publish stream’ permission is enough in GraphApi although there is documentation that it was not enough in the deprecated REST API, there you needed a publish_stream_extended permission, but I cant see any corresponding permission in GraphAPI.

If any of you can tell me where Ive gone wrong I’ll be eternally grateful, and I apologize if there is a duplicate question, I’ve looked and looked, because of the deprecated REST API and the different SDKs that facebook has issued over time its very difficult to see what has changed and what has not.

I guess the key questions if anyone knows are

  1. what are the permission settings to make in a facebook serverside app in order to have privilege to tag friends to a photo?
  2. what are the corresponding permissions to init into your facebook session object?
  3. Does Facebook not want you doing this anymore and is this why there is so little documentation?
  4. am I completely barking up the wrong tree here?

thank you very much for your time reading this 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:09:40+00:00Added an answer on June 12, 2026 at 10:09 am
    1. Ask for user_photos permissions so you can tag friends in a photo
    2. With the latest Facebook SDK v3.1 you need to split up your read/write permissions to take advantage of iOS6. Ask for user_photos permissions to begin with and ask for publish_actions permissions in context, when you’re about to publish a photo.
    3. Docs can be found here explaining the permissions: https://developers.facebook.com/docs/reference/api/photo/

    Hint: Whenever you’re stuck, go to the Graph API Explorer and play with different permissions, input, etc. to get things write before you move on to code or just use it if you get stuck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am uploading an image. When I run application from eclipse on my device
Imgur is a image uploading website who offers an API to upload My code
I'm deliberately uploading a non-image file by POSTing to an iframe (fake Ajax) but
I'm uploading images using Spring and Hibernate. I'm saving images on the server as
I'm having problems uploading files with CodeIgniter 2.1.0, as I recieve the $_FILES array
am I uploading this file right? Here is my code: Deleted Code it is
I am uploading video on twitvid using its official php library. http://www.martin-gardner.co.uk/twitvid/twitvid.class.example.php#embedvideo But when
I'm uploading a multipart chunk of data using HttpPost and feeding it into an
I'm trying to upload an image to Picasa from a Google Chrome Extension and
I am uploading large files to an ASP.NET server using a standard HTML <input>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.