我正在使用Iphone應用程序,我正在使用Facebook sdk在用戶的牆上發帖。 我需要創建一個文本和圖片的職位。Facebook:獲取上傳的照片的網址
對於第一次,我用這種上傳圖片到用戶的個人資料:
//image to post is the UIImage I am uploading
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[self imageToPost], @"picture"
[FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
}
這是工作corretly。該result
我得到的是按以下格式:
{
id = 101586254325716;
"post_id" = "100004123442691_101551541234190";
}
現在我要張貼包含文本和上傳圖片的用戶牆上的飼料。
//self.facebookStatus is the text I want to post
//imageURL is the url of the image
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
self.facebookStatus, @"message",
imageURL, @"picture",
nil];
[FBRequestConnection startWithGraphPath:@"me/feed" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
}
問題:
我不知道imageURL
應該是什麼。我試圖使用id
或post_id
作爲結果,但它不起作用。我不喜歡嘗試www.facebook.com/101586254325716
,但也沒有工作。
如何獲取我上傳的圖片的網址以便將其添加到牆貼?
感謝
PS:如果有人張貼圖片來自iPhone這將是一個很大的用戶牆,文字+圖片等方式或提示。
這會將它張貼爲圖片而不是牆貼或狀態。 – Youssef
這不回答這個問題 – melanke