Iphone 错误:HTTP状态代码:400我在朋友脸书墙上发布数据时收到此消息?
我正在我的应用程序中选择我的Facebook好友我想在我按下“完成”按钮时在我的好友墙上发布一些文本数据当我按下“完成”按钮时,我收到此Iphone 错误:HTTP状态代码:400我在朋友脸书墙上发布数据时收到此消息?,iphone,objective-c,facebook,xcode4,Iphone,Objective C,Facebook,Xcode4,我正在我的应用程序中选择我的Facebook好友我想在我按下“完成”按钮时在我的好友墙上发布一些文本数据当我按下“完成”按钮时,我收到此错误。错误:HTTP状态代码:400 呵呵,这是我的密码 - (void)facebookViewControllerDoneWasPressed:(id)sender { NSMutableString *text = [[NSMutableString alloc] init]; // we pick up the users from t
错误。错误:HTTP状态代码:400
呵呵,这是我的密码
- (void)facebookViewControllerDoneWasPressed:(id)sender {
NSMutableString *text = [[NSMutableString alloc] init];
// we pick up the users from the selection, and create a string that we use to update the text view
// at the bottom of the display; note that self.selection is a property inherited from our base class
for (id<FBGraphUser> user in self.friendPickerController.selection) {
NSString *userID = user.id;
NSLog(@"trying to post image of %@ wall",userID);
NSMutableDictionary *postVariablesDictionary = [[NSMutableDictionary alloc] init];
//[postVariablesDictionary setObject:UIImagePNGRepresentation(image) forKey:@"picture"];
[postVariablesDictionary setObject:@"my image" forKey:@"message"];
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/photos",userID] parameters:postVariablesDictionary HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{
if (error)
{
//showing an alert for failure
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Facebook" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
else
{
//showing an alert for success
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Facebook" message:@"Shared the photo successfully" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
}];
}
NSLog(@"%@",text);
[self fillTextBoxAndDismiss];
}
-(void)按下FaceBookViewControllerDone:(id)发件人{
NSMutableString*text=[[NSMutableString alloc]init];
//我们从选择中选择用户,并创建一个字符串,用于更新文本视图
//请注意self.selection是从基类继承的属性
for(self.friendPickerController.selection中的用户id){
NSString*userID=user.id;
NSLog(@“试图发布%@wall的图像”,userID);
NSMutableDictionary*postVariablesDictionary=[[NSMutableDictionary alloc]init];
//[postVariablesDictionary setObject:UIImagePNGRepresentation(image)forKey:@“picture”];
[postVariablesDictionary setObject:@“我的图像”forKey:@“消息”];
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@“%@/photos”,userID]参数:postVariablesDictionary HTTPMethod:@“POST”completionHandler:^(FBRequestConnection*连接,id结果,NSError*错误)
{
如果(错误)
{
//显示故障警报
UIAlertView*alertView=[[UIAlertView alloc]initWithTitle:@“Facebook”消息:错误。本地化描述委托:无取消按钮:@“确定”其他按钮:无];
[警报视图显示];
}
其他的
{
//显示成功的警觉
UIAlertView*alertView=[[UIAlertView alloc]initWithTitle:@“Facebook”消息:@“成功共享照片”代理:nil取消按钮:@“确定”其他按钮:nil];
[警报视图显示];
}
}];
}
NSLog(@“%@”,文本);
[自行填写文本框并解散];
}
安装fb sdk并告诉我错误还应包含错误描述。请将其添加到您的问题中。操作无法完成com.facebook.sdk警报中的错误5view@EliGanem对此你怎么说?你是先验证用户的吗?用户必须拥有有效的访问令牌才能执行请求。