我发布到组用户墙,(图像和文本)。它已经工作了很长时间,最近停止工作(现在,图像已发布,但没有文字:()。任何想法是否有新方式或规则?(没有报告错误)
[params setObject:sContent forKey:@"message"];
[params setObject:yourImageData forKey:@"picture"];
[[[FBSDKGraphRequest alloc]
initWithGraphPath:@"xxxxxxxxxxxxxxx/photos"
parameters: params
HTTPMethod:@"POST"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
答案 0 :(得分:2)
以下是我的工作代码(In Swift):
let params = ["message": "Test message", "sourceImage" : UIImagePNGRepresentation(UIImage(named: "test.jpg")!)!]
FBSDKGraphRequest(graphPath: "me/photos", parameters: params, HTTPMethod: "POST").startWithCompletionHandler({ (connection, result, error) -> Void in
guard let response = result else {
print("No response received")
if let errorInfo = error {
print("errorInfo: \(errorInfo)")
}
return }
print(response)
})
检查'发布' link部分了解更多内容。
如果您将其转换为Objective-C有任何困难,请告诉我。