开发者

adding photo on facebook wall

开发者 https://www.devze.com 2023-01-17 18:58 出处:网络
- (void)postToWall { FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease]; dialog.userMessagePrompt = [NSString stringWithFormat: subjectTitle]; //subjectTitle works here but not as n
- (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 ......


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消