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 8257793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:19:01+00:00 2026-06-08T02:19:01+00:00

I need to post a photo (taken form the camera) in the users facebook

  • 0

I need to post a photo (taken form the camera) in the users facebook wall with the location of the user.
Now, the facebook photo object has a field named place:

object containing id and name of Page associated with this location, and a location field containing geographic information such as latitude, longitude, country, and other fields (fields will vary based on geography and availability of information)

Now how do I get the place, attach it with the photo and upload it in the users wall.
This is my code for photo upload:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       resultImage, @"picture",
                                       location, @"place",
                                       nil];

        [appDelegate.facebook requestWithGraphPath:@"me/photos"
                                         andParams:params
                                     andHttpMethod:@"POST"
                                       andDelegate:self];

But, how do I get the location parameter here? Can anyone help? Thanks in advance.

  • 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-08T02:19:04+00:00Added an answer on June 8, 2026 at 2:19 am

    The place object can only be a Facebook Page Id of the desired location according to this documentation. So, here is how I managed to get user’s location while uploading photo.

    -(void)fbCheckForPlace:(CLLocation *)location
    {
        NSString *centerLocation = [[NSString alloc] initWithFormat:@"%f,%f",
                                    location.coordinate.latitude,
                                    location.coordinate.longitude];
        NSLog(@"center location is : %@",centerLocation);
        NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                        @"place",  @"type",
                                        centerLocation, @"center",
                                        @"1000",  @"distance",
                                        nil];
        [centerLocation release];
        [appDelegate.facebook requestWithGraphPath:@"search" andParams:params andDelegate:self];
    }
    

    the current location is obtained by calling CLLocation Manager delegate and passed in the above method.

    Next, if this request is successful, the place objects are inserted in a mutable array.

    NSArray *resultData = [result objectForKey:@"data"];
            for (NSUInteger i=0; i<[resultData count] && i < 5; i++) 
            {
                [self.listOfPlaces addObject:[resultData objectAtIndex:i]];
            }
    

    And then the photo uploading method is fired:

    - (void)uploadPhotoWithLocation
    {
        NSString *placeId = [[self.listOfPlaces objectAtIndex:0] objectForKey:@"id"];
    
        params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       self.resultImage, @"picture",
                                       placeId, @"place",
                                       nil];
    
        [appDelegate.facebook requestWithGraphPath:@"me/photos"
                                         andParams:params
                                     andHttpMethod:@"POST"
                                       andDelegate:self];
    }
    

    I have taken the first nearby place of the available check-ins ([self.listOfPlaces objectAtIndex:0]) and now the app can successfully post photos with the users current nearby location.

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

Sidebar

Related Questions

Hi I'm using FBConnect to post to facebook, now I need to post photos
I need to post a form on a new website which is UTF-8 encoded.
I've got a form and I need to post data to the server every
In my app, I have this scenario where I need to post an object
I need to post a photo already present in a page's Photo Album to
After I upload a photo on a desktop facebook application i need to store
I need to make my form field not required when uploading information. Here is
I was trying to retrieve wall posts for a particular user, similar question has
I try to post a photo like on behalf of the current user. But
I have three models User , Post , Vote I need to doesn't allow

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.