我发布到组用户墙,(图像和文本).它已经工作了很长时间,最近停止工作(现在,图像已发布,但没有文字:().任何想法是否有新的方法或规则?(没有报告错误)
[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) {
最佳答案 以下是我的工作代码(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有任何困难,请告诉我.