在ios 6中检索Facebook帐户信息

Pie*_*ero 2 iphone account facebook ios6

我想在ios 6集成Facebook上检索facebook帐户的信息,现在我这样做,我只能检索用户名:

ACAccountType *accountTypeF = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
    [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
        if(granted) {
            NSArray *accountsArray = [accountStore accountsWithAccountType:accountTypeF];

            ACAccount *facebookAccount = [accountsArray objectAtIndex:0];
            if (facebookAccount.username) {
}
}
}];
Run Code Online (Sandbox Code Playgroud)

我想知道如何检索帐户的名称和姓氏以及用户的图片......任何人都可以帮助我吗?

Vai*_*ran 8

杰弗里是对的.转到这篇文章:Facebook iOS 6 - 获取用户信息并实现Daniel提供的两种方法.

之后,请确保在您的应用程序设置中进行一些更改facebook developer account.

  • 在主设置页面禁用 sandbox mode
  • 把你的申请 bundle id
  • Enable Facebook登入

然后转到Advance左侧的设置

  • 选择Native/DesktopApp Type
  • 确保App secret in clientNO

保存所有设置,填充服务器上的更改确实需要几分钟.最后Must reset you simulator