【发布时间】: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 调用。