views:

78

answers:

2
- (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 ......

+1  A: 

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

Warren Burton
Hello in the dictionary info, the value for key UIImagePickerControllerMediaURL is NULL. Am I missing something here?
Hardik Patel
Hi have you pushed up the picker interface and picked an image from it? And you have set the delegate of the picker controller?
Warren Burton
A: 

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.

Pritam Barhate