2012-02-15 131 views
0

在我的应用我需要实现+添加为好友类型按钮发送Facebook上添加为好友的请求。搜索互联网后,我做了以下的方法:http://developers.facebook.com/docs/reference/dialogs/friends/iphone Facebook添加好友,实施失败... iphone Facebook添加好友

AppDelegate *delegate = (AppDelegate*)[UIApplication sharedApplication].delegate; 
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
    //         kAppId, @"app_id", 
    //         @"popup",@"display", 
           @"100000979054002",@"id", 
           nil]; 
    [delegate.facebook dialog:@"friends" andParams:params andDelegate:self]; 

,但我得到一个错误:“发生错误,请稍后再试”
有没有人可以给我帮助?提前致谢。

回答

0

来源:http://developers.facebook.com/docs/reference/dialogs/#display

Mobile Display Modes

To show a dialog to a user on a mobile device, change the subdomain of the dialog URL from www to m. Facebook will default to an appropriate view based on the user agent. To override that choice, you can explicitly specify one of two mobile display modes:

  • touch: Used on smartphone mobile devices, like iPhone and Android. Use this for tablets with small screens (i.e., under 7 inches) as well.
  • wap: Display plain HTML (without JavaScript) on a small screen, such as a Nokia 7500.

也许 “弹出” 是一个移动设备的显示不正确?

而且,是//评论?如果是这样,你已经注释了app_id的必填字段。

+0

谢谢反正... and..I'm仍然停留在这... – Linc 2012-02-17 03:30:56

0

看看here

以上问题是关于Android,但它是为iOS相同。所有你需要的是改变来自m.facebook.com基本URL(通常在Facebook.h定义为kDialogBaseURL)在www.facebook.com。这解决了我的问题。