Hardik Patel
Hardik Patel

Reputation: 937

adding photo on facebook wall

- (void)postToWall {
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];

dialog.userMessagePrompt = [NSString stringWithFormat: subjectTitle]; //subjectTitle works here but not as name where i need it.

NSString *src = @"http://www.sample.com/image.png";
NSString *name = storyLink;  //<---------------------------------works with storyLink but not subjectTitle. I need subjectTitle to work here
NSString *href = storyLink;

NSString *attachment = [NSString stringWithFormat:@"{\"name\":\"%@\",\"media\":[{\"type\":\"image\", \"src\":\"%@\", \"href\":\"%@\"}]}", name, src, href];
dialog.attachment = attachment;
[dialog show]; 
}

i want to add image from photo library instred of http://www.sample.com/image.png to the facebook wall.

can anyone provides me help ....

Thanks in advance ......

Upvotes: 2

Views: 1161

Answers (2)

Pritam Barhate
Pritam Barhate

Reputation: 775

Probably this Stack Overflow Question about uploading images to Facebook might help you.

Also Sharekit is a nice framework to add Social features to you iPhone App. I think it has facility to share images. You can check it out at Sharekit official website.

Upvotes: 1

Warren Burton
Warren Burton

Reputation: 17378

You can access the URL's of the iPhoto library items using the UIImagePickerController and its delegate method.

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

When the user picks a photo the URL will be in the dictionary under the key UIImagePickerControllerMediaURL

Upvotes: 1

Related Questions