2014-10-12 49 views
0

是否有可能在沒有共享對話框的情況下這樣做?因爲到目前爲止,我沒有發現任何允許的。FacebookSDK:在我的時間軸上用文字/鏈接分享圖像

這只是沒有任何文字的份額照片:

[FBRequestConnection startForUploadPhoto:self.imageToShare completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { }]; 

這不只是照片文本份額:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           self.titleToShare, @"name", 
           self.textToShare, @"description", 
           self.linkToShare, @"link", 
           @"http://www.somesite.com/logo_i.png", @"picture", nil]; 

[FBRequestConnection startWithGraphPath:@"/me/feed" parameters:params HTTPMethod:@"POST" 
         completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { }]; 

我該怎麼辦?

在此先感謝。

回答

0

所以我發現搜索一段時間後的正確答案,張貼與你想要一個文本最好的方法是這樣的:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           UIImageJPEGRepresentation(self.imageToShare, 1), @"source", 
           self.textToShare, @"message", 
           (self.linkToShare)?self.linkToShare:@"", @"link", nil]; 

[FBRequestConnection startWithGraphPath:@"/me/photos" parameters:params HTTPMethod:@"POST" 
         completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { }]; 

享受!

相關問題