【问题标题】:Facebook Account Kit require an appsecret_proof argument ErrorFacebook Account Kit 需要 appsecret_proof 参数错误
【发布时间】:2016-11-10 14:02:55
【问题描述】:

我正在尝试使用 Facebook 帐户工具包检索用户电话号码/电子邮件。

我总是收到错误响应:

200:服务器生成错误:145:来自服务器的 API 调用需要 appsecret_proof 参数

我已经在 Facebook 开发者仪表板上禁用了该选项。

服务器 API 调用需要应用密码

这是我的代码:

public void onLoginPhone(final View view) {
  final Intent intent = new Intent(getActivity(), AccountKitActivity.class);
  AccountKitConfiguration.AccountKitConfigurationBuilder configurationBuilder =
    new AccountKitConfiguration.AccountKitConfigurationBuilder(
      LoginType.PHONE,
      AccountKitActivity.ResponseType.CODE); // or .ResponseType.TOKEN
  // ... perform additional configuration ...
  intent.putExtra(
    AccountKitActivity.ACCOUNT_KIT_ACTIVITY_CONFIGURATION,
    configurationBuilder.build());
  startActivityForResult(intent, APP_REQUEST_CODE);
}

这是 onActivityResult:

AccountKit.getCurrentAccount(new AccountKitCallback<Account>() {
  @Override
  public void onSuccess(final Account account) {
    // Get Account Kit ID
    String accountKitId = account.getId();

    // Get phone number
    PhoneNumber phoneNumber = account.getPhoneNumber();
    String phoneNumberString = phoneNumber.toString();

    // Get email
    String email = account.getEmail();
  }

  @Override
  public void onError(final AccountKitError error) {
    // Handle Error
  }
});

【问题讨论】:

  • 该特定 API 调用需要 appsecret_proof 并且必须从服务器完成。您禁用的只是不需要所有 API 调用。

标签: android facebook


【解决方案1】:

解决上述问题的简单方法,只需按照以下步骤即可。

第 1 步:转到 Facebook 开发者控制台

     https://developers.facebook.com/

第 2 步:

中选择您的应用程序
     https://developers.facebook.com/apps/

第 3 步:选择您的应用程序后,点击位于控制台左侧面板产品标题下方的Account kit

第 4 步:点击 Account kit 后,您会看到 Reuired App Secret 切换按钮,右侧有是/否选项。

第 5 步: 从那里(在允许短信登录下方)关闭(否)所需的应用程序密码

第 6 步:点击保存更改标签。

第 7 步:运行你的应用程序,你会得到任何你想要的。

如果您还有任何疑问,请随时问我。可能是对您或其他人的这些帮助。

【讨论】:

  • 这对我不起作用,因为我面临同样的问题,并且我的应用程序中的要求应用程序密码已关闭,您是否建议其他解决方案?谢谢
  • 我完全按照建议打开了设置,但仍然出现此错误,但仅限于 LTE,而不是 Wifi。 imgur.com/a/DQZLa
【解决方案2】:

我遇到了同样的问题。解决我的问题的三个步骤:

  1. 关闭“App Require Secret”选项

  2. 确保“启用客户端访问令牌流”选项已打开,设置 到“是”

  3. 用户AccountKitActivity.ResponseType.TOKEN instead of AccountKitActivity.ResponseType.CODE

ResponseType.CODE 永远不会返回您的手机号码。

希望对你有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多