I am using facebook.photos.upload to upload photos direct from my application into facebook albums. This is my current code:-
NSMutableDictionary *args = [[[NSMutableDictionary alloc] init] autorelease];
[args setObject:self.facebookString forKey:@"caption"];
UIImage *image = ((iPhotoFitViewController*)self.cameraPickerController).photoImageView.image;
[[FBRequest requestWithDelegate:self] call:@"facebook.photos.upload" params:args dataParam:(NSData*)image];
This code works for the upload perfectly but i am having issues returning the true pid. This is my code for returning the pid as per facebook sample app example:-
- (void)request:(FBRequest*)request didLoad:(id)result {
if ([request.method isEqualToString:@"facebook.photos.upload"]) {
NSDictionary* photoInfo = result;
NSString* pid = [photoInfo objectForKey:@"pid"];
_label.text = [NSString stringWithFormat:@"Uploaded with pid %@", pid];
NSLog(@"pid=%@",pid);
}
}
Now, after the upload has finished i get a response to my _label with a long string which is supposed to be the pid for the image. if i cross check this given pid with the actual pid on the photograph on the facebook website it is completely different and if i attempt to visit the photo using the returned pid the facebook site errors out with the no photo found error.
This is also the same within the sample application found on github where the fbconnect for iPhone files are located.
Any help on this would be greatly appreciated. Thanks in advance