在朋友墙上发布消息时出现集成错误?

编程入门 行业动态 更新时间:2024-10-26 20:33:39
本文介绍了在朋友墙上发布消息时出现集成错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

即时通讯使用facebook_skd_3.1(Xcode ios 4.5)我通过调用 FBFriendPickerViewController得到好友列表,点击完成按钮我试图在选定的朋友墙上发布消息 但是我收到此错误: - 警告:在演示或解雇过程中尝试解除视图控制器! 2012-12-06 19:37:09.187 .. ......项目[5474:19a03]错误:HTTP状态代码:403

i m using facebook_skd_3.1 (Xcode ios 4.5) i got the friends list by calling FBFriendPickerViewController, on clicking done button i have tried to post the message on the selected friends wall but i got this error :- Warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress! 2012-12-06 19:37:09.187 ........project[5474:19a03] Error: HTTP status code: 403

警报视图中的错误

error =Error Domain=com.facebook.sdk code=5" .......... message = "(#200)the user hasn't authorized the application to perform this action"; type = OAuthException }; }; code=403; com.acebook.sdk:HTTPStatuscode=403}

代码: -

-(void)facebookViewControllerDoneWasPressed:(id)sender { NSString* userid; for (id<FBGraphUser> user in self.friendPickerController.selection) { NSLog(@"\nuser=%@\n", user); userid = user.id; } NSMutableDictionary* dictaram = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"like this!", @"message", nil]; [FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/feed", userid] parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Shared" message:[NSString stringWithFormat:@ %@! error=%@", fbUserName, error] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } ]; [self dismissModalViewControllerAnimated:YES];

我是否需要一些权限或者有一些编码错误请帮忙。

Do i need some permissions or there is some coding error please help.

提前感谢。

推荐答案

我通过在委托中重新授权权限,如下所示,我已经读取了会话权限,因此无法发布。请将以下代码写入ButtonAction,您将获得正确的输出。

I have figured it by re authorizing the permissions as follows in delegate i have read permissions for session so that didn't worked for posting. write the following code to in the ButtonAction and you will get the proper output.

NSArray *permissions =[NSArray arrayWithObjects:@"publish_actions",@"publish_stream",@"manage_friendlists", nil]; [[FBSession activeSession] reauthorizeWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceFriends completionHandler:^(FBSession *session, NSError *error) { /* handle success + failure in block */ }];

更多推荐

在朋友墙上发布消息时出现集成错误?

本文发布于:2023-11-26 22:04:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635384.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:墙上   错误   消息   朋友

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!