How to post local image with dialog text in facebook

这一生的挚爱 提交于 2020-01-05 12:40:56

问题


I have upload images with url image successful on this way

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"https://developers.facebook.com/docs/reference/dialogs/", @"link",
                               @"http://fbrell.com/f8.jpg", @"picture",
                               @"Facebook Dialogs", @"name",
                               @"Reference Documentation", @"caption",
                               @"Using Dialogs to interact with users.", @"description",
                               nil];

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] dialog:@"feed"
           andParams:params
         andDelegate:self];

Now i want to upload image from a local image in same way

like

    profImg = [UIImage imageNamed:LoginWithFacebookNormal@2x.png"];
    NSData *data = [NSData dataWithData:UIImagePNGRepresentation(profImg)];

i have used data, @"picture", in dictionary but it's give me error

is it any other way to upload local/Gallery/resource image with dialog box + comment area ?

I have searched but every time found that only url image can feed the dialog box

I have used Hackgraph tutorial for this posting.

Note: I am not using Sharekit or any other API i have used only Graph API


回答1:


Finally after lots of research I get the example of Facebook. Download the example from here. You have to make modification because currently example hold static image.



来源:https://stackoverflow.com/questions/10995184/how-to-post-local-image-with-dialog-text-in-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!