How to post images with text in facebook integration in Iphone sdk

前端 未结 3 2181
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 14:11

Here Iam having a problem.Actually I implemented the facebook integration in my application and I need to post the images with text but I dont have any idea how to work on t

3条回答
  •  佛祖请我去吃肉
    2020-12-09 14:52

    If you want to upload the images to your server, and post a small story to Facebook's wall. Use the stream API.

    FBStreamDialog *dialog = [[[FBStreamDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.userMessagePrompt = @"Prompt";
    
    NSString *name = @"Your caption";
    NSString *src = @"http://example.com/path/of/your/image";
    NSString *href = @"http://what/happens/if/the/user/click/on/the/image";
    
    NSString *attachment = [NSString stringWithFormat:@"{\"name\":\"%@\",\"media\":[{\"type\":\"image\", \"src\":\"%@\", \"href\":\"%@\"}]}", name, src, href];
    dialog.attachment = attachment;
    [dialog show];  
    

提交回复
热议问题