Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ahh SWEET. I figured this one out with some good old-fashioned, straight-up tinkering.</p> <p>Given that there is no real instruction on how to apply the 'album' value to an FBRequest, I hesitate to call it a bug, but either way I needed a different method - in this case, simply creating a generic Open Graph HTTP request and filling in all the image info.</p> <p>There is no real downside to this approach; except that you can't use the requestForUploadPhoto: convenience method.</p> <p>Here is my implementation of the correct method (removed code is commented out):</p> <pre><code>- (void)postPhotosToFacebook:(NSArray *)photos withAlbumID:(NSString *)albumID { UIImage *image = [photos lastObject]; // FBRequest *imageUploadRequest = [FBRequest requestForUploadPhoto:image]; // // [[imageUploadRequest parameters] setValue:albumID // forKey:@"album"]; // // DebugLog(@"imageUploadRequest parameters: %@",[imageUploadRequest parameters]); NSString *graphPath = [NSString stringWithFormat:@"%@/photos",albumID]; DebugLog(@"graphPath = %@",graphPath); NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys: image,@"picture", nil]; FBRequest *request = [FBRequest requestWithGraphPath:graphPath parameters:parameters HTTPMethod:@"POST"]; FBRequestConnection *connection = [[FBRequestConnection alloc] init]; [connection addRequest:request completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { if (!error) { DebugLog(@"Photo uploaded successfuly! %@",result); } else { DebugLog(@"Photo uploaded failed :( %@",error.userInfo); } }]; [connection start]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload