please help me to upload image on facebook using iphone app.here i dont have the url.i just only have the image.but i cant upload it on face book.if i can use an url then i
The DemoApp that comes with the facebook ios api contains the code to upload a photo in the sample:
https://github.com/facebook/facebook-ios-sdk/tree/master/sample/DemoApp
/**
* Upload a photo.
*/
- (IBAction)uploadPhoto:(id)sender {
NSString *path = @"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
img, @"picture",
nil];
[_facebook requestWithMethodName:@"photos.upload"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
[img release];
}