Facebook Account Kit SDK提供无效的OAuth 2.0错误

时间:2016-05-30 22:07:38

标签: swift sdk oauth-2.0

我已将帐户套件sdk 整合到我的项目中。

我在facebook开发仪表板上创建了应用程序,在其上启用了Account Kit。获得 app-id 客户端访问令牌

我将其添加到 info.plist 文件中。我收到了这个错误:

[AccountKit][Error]: Invalid OAuth 2.0 Access Token
2016-05-31 02:41:32.191 Chat[2919:563260] [AccountKit][Error]: 

Persisting App Events due to error: 

Error Domain=com.facebook.accountkit:Error Code=200 "(null)" 

UserInfo={com.facebook.accountkit:ErrorDeveloperMessageKey=Invalid OAuth access token., NSUnderlyingError=0x147596a30 

{Error Domain=com.facebook.accountkit:ServerError Code=190 "(null)" UserInfo={com.facebook.accountkit:ErrorDeveloperMessageKey=Invalid OAuth access token.}}}

请帮忙。感谢

5 个答案:

答案 0 :(得分:4)

确保在info.plist中有正确的设置。 我有一个类似的问题,在我的情况下,它缺少一个关键的FacebookAppID

<key>FacebookAppID</key>
<string>{your-app-id}</string> 
<key>AccountKitClientToken</key>
<string>{your-account-kit-client-token}</string>
<key>CFBundleURLTypes</key>
<array>
     <dict>
         <key>CFBundleURLSchemes</key>
         <array>
             <string>ak{your-app-id}</string>
         </array>
     </dict>
</array>

答案 1 :(得分:1)

确保AKFAccountKit的初始化响应类型与您的应用程序仪表板配置匹配。 它可以是:

accountKit = [[AKFAccountKit alloc] initWithResponseType:AKFResponseTypeAccessToken];

accountKit = [[AKFAccountKit alloc]initWithResponseType:AKFResponseTypeAuthorizationCode];

答案 2 :(得分:0)

这可能是您的配置问题。您可以在此处向Facebook提交错误报告,包括您的令牌信息:https://developers.facebook.com/bugs/

答案 3 :(得分:0)

当我将错误的AccountKitClientToken复制到Info.plist中时出现此错误。在那里找到合适的,现在一切正常!

答案 4 :(得分:0)

您可以使用AKFSettings.setClientToken("MY TOKEN")添加客户令牌,并确保将其命名为import AccountKit在文件顶部。