开发者

Facebook iOS-sdk and posting a local (UI)Image

开发者 https://www.devze.com 2023-03-31 03:22 出处:网络
I have successfully used photos开发者_运维技巧.upload api to upload local images to the users album.

I have successfully used photos开发者_运维技巧.upload api to upload local images to the users album.

How to upload local images with formatted links? The photos.upload does support adding the caption text, but I can't embed html-links to the caption. Is there a way to do this using perhaps the Graph-api?


I'm not sure about the caption itself, but here is a way to post the image along with a message to the user's wall. The message text can have imbedded links in it with no problem.

Facebook* fb = [(AppDelegate *) [[UIApplication sharedApplication] delegate] facebook];
NSData* imageData = UIImageJPEGRepresentation([UIImage imageNamed: @"A.jpg"], 90);
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: [fb accessToken], 
              @"access_token", 
              @"some message here...with a link http://www.google.com",
              @"message", 
              imageData, 
              @"source", 
              nil];

[fb requestWithGraphPath: @"me/photos" 
               andParams: params 
           andHttpMethod: @"POST" 
             andDelegate: self];
0

精彩评论

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