[英]FBConnect - uploading images to Wall
我已經配置了FBConnect並將其上傳到牆上,但是我想做的是截取屏幕截圖,然后將屏幕截圖上傳到FB。
在下面的代碼中,有一個圖像,但作為URL。 我可以將其相交並放入我的截圖圖像嗎?
FBStreamDialog *dialog = [[[FBStreamDialog alloc] init]autorelease];
dialog.userMessagePrompt = @"Tell your friends about Fridgit!!:";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Facebook Connect for iPhone\",\"href\":\"http://developers.facebook.com/connect.phptab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"screenShot\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}", self.screenShot];
[dialog show];
}
我知道所有代碼都是默認的,但如果我不能做我想做的事,我還沒有對其進行編輯。
干杯
是的,使用新的FB API nw是可能的,他們使它變得盡可能簡單
// code snippet to take a snapshot
// REF: http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically
UIGraphicsBeginImageContext(self.window.bounds.size);
[self.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
img, @"picture",
nil];
[_facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.