title: Posting photos to Facebook fan page with iOS SDK
body: <p>I'm trying to upload a photo to a Facebook page I own using the iOS SDK and graph API. I've been able to upload photos to my own wall. I've also been able to post a message to my fan page wall as an admin and create an album on my fan page, so I think I'm making the right calls, but not succeeding. </p>
  
  <p>This is what I'm currently doing.</p>
  
  <p>I'm logging in using</p>
  
  <pre><code>Facebook *fb = [[Facebook alloc] init];
  self.facebook = fb;
  [fb release];
  NSArray *permissions =  [[NSArray arrayWithObjects:@"read_stream", @"offline_access", @"publish_stream", @"manage_pages", @"user_photos", @"friends_photos",nil] retain];
  [facebook authorize:FB_APP_ID permissions:permissions delegate:self];
  [permissions release];
  </code></pre>
  
  <p>After I log in, I request the accounts</p>
  
  <pre><code>[facebook requestWithGraphPath:@"/me/accounts" andDelegate:self];
  </code></pre>
  
  <p>The accounts are returned to me with access tokens for each page and app I own. I use a simple loop to parse through the accounts to extra the access_token supplied for the page I wish to upload a photo to.</p>
  
  <p>I then set my access token of my facebook object to the new access_token.</p>
  
  <pre><code>facebook.accessToken = new_accessToken;
  </code></pre>
  
  <p>and try and upload a photo my fan page using</p>
  
  <pre><code>UIImage *uploadImage = [UIImage imageNamed:@"t200.jpg"];
  NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                 uploadImage, @"source", 
               @"test caption", @"message",             
               nil];
  
  
  [facebook requestWithGraphPath:@"/me/photos" andParams:params
          andHttpMethod:@"POST" andDelegate:self];
  </code></pre>
  
  <p>The response I receive is</p>
  
  <pre>
  {"error":{"type":"OAuthException","message":"(#1) An unknown error occurred"}}
  </pre>
  
  <p>Is this a bug in the facebook graph API? I also tried making this call using standard HTTPS requests, and get the same result.</p>