iphone - Facebook 中的图片分享功能无法使用

标签 iphone objective-c ios facebook

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                 @"parth kausik", @"name", 
                                 imageview.image, @"picture",   
                                 nil];

  [facebook requestWithGraphPath:@"me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];

大家好,这些代码不起作用。它没有调用请求委托(delegate),也没有上传任何图片。你有什么想法吗..

错误即将到来......

error is:Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x6c592d0 {error=<CFBasicHash 0x6c55f70 [0x12a9b38]>{type = mutable dict, count = 3,
entries =>
    2 : <CFString 0x6c56130 [0x12a9b38]>{contents = "type"} = <CFString 0x6c56820 [0x12a9b38]>{contents = "OAuthException"}
    3 : <CFString 0x6c567c0 [0x12a9b38]>{contents = "message"} = <CFString 0x6c56720 [0x12a9b38]>{contents = "An active access token must be used to query information about the current user."}
    6 : <CFString 0x6c59020 [0x12a9b38]>{contents = "code"} = 2500
}
}
Terminating in response to SpringBoard's termination.

最佳答案

添加社交框架,然后导入类,并添加以下代码

 SLComposeViewController *facebookPostVC =[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook ];
[facebookPostVC setInitialText:@"iPhone Application"];
[facebookPostVC addURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",link]]];
[facebookPostVC addImage:[UIImage imageNamed:@"Default.png"]];
[self presentViewController:facebookPostVC animated:YES completion:nil];

注意:这适用于 Xcode 4.5

关于iphone - Facebook 中的图片分享功能无法使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10499150/

相关文章:

iphone - 检测双击将导航 Controller 弹出回 Root View 的选项卡栏

ios - 添加到收藏夹功能[swift]

objective-c - 无法在代码中更改 .xib UI 对象的框架

ios - React Native - 如何防止 IOS 中的全屏视频模式?

ios - TextView和TextField的单个扩展以添加工具栏

iOS:如何通过按 UIButton 更改 UIImageView

ios - 2.23 : Apps must follow the iOS Data Storage Guidelines or they will be rejected

objective-c - 在 iPhone 中进行单元测试时出现以下错误

ios - 相机快照按钮的辅助功能标签是什么?

ios - 在 iOS 中,当屏幕从纵向旋转到横向时,如何让 textView 展开