1

I am trying to post a photo to a page that the user does not own. Note that all solutions that I found from other discussion threads require the user to be administrative and get the access_token of a page with *manage_pages* permissions.

However, what I want to do is different: Using iOS SDK to upload an image to a page, which has a setting that people can upload images to it.

I try several ways, but none of them works.

Here is how I get permissions

NSArray *permissions = [[NSArray alloc] initWithObjects:
                            @"photo_upload",
                            @"share_item",
                            @"status_update",
                            @"manage_pages",
                            @"user_likes",
                            @"publish_stream", 
                            nil];
    [fb authorize: permissions];

Here are the codes for uploading the image

NSString *uri = [NSString stringWithFormat: @"%@/photos", FBPageId];
[fb requestWithGraphPath: uri
               andParams: params
           andHttpMethod: @"POST"
             andDelegate: self];

It kept posting the image to the user's album, which is not what I want.

I will really appreciate if anyone knows how to do it. Thank you!

dimme
  • 4,393
  • 4
  • 31
  • 51
Shao-Chuan Wang
  • 980
  • 8
  • 16

1 Answers1

1

I have two potential workarounds for you to try out:

  1. Post the picture to the pages feed rather than to the {pageid}/photos.

  2. Collect the albums for that page {pageid}/albums. Now with the correct album id, post the picture to {albumId}/photos.

DMCS
  • 31,720
  • 14
  • 71
  • 104
  • I tried the second one, and it did not work. (also posted to my own album); I tried the pages feed, and it worked, but I cannot post with "picture" using facebook's photo link. It will return an error like this: "(#100) FBCDN image is not allowed in stream: http://a8.sphotos.ak.fbcdn.net/hphotos-ak-ash4/XXXXXX_10151125540085473_657965472_22364375_1088524757_n.jpg" – Shao-Chuan Wang Jan 01 '12 at 20:01
  • But the feed post suggestion did enable me to post something to the fan page anyway. Thanks for your suggestion. – Shao-Chuan Wang Jan 01 '12 at 20:01
  • I'm surprised the second one did not work. You may not have used the correct access_token for the page. Did you get the access token from the me/accounts array? – DMCS Jan 02 '12 at 00:23
  • Yes. When query using 'me/accounts', there is nothing about that page returned, because the user is neither the administrator of that page nor like the page yet. As long as the page's setting is "Everyone can upload the photo", then it should be able to upload the photo even if the user has not liked the page yet, right? As far as I know... – Shao-Chuan Wang Jan 02 '12 at 15:06