2012-02-15 89 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。這解決了我的問題。