Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Account Kit require an appsecret_proof argument Error

I'm trying to retrieve the user PhoneNumber/email using Facebook Account kit.

I'm always getting an error as response:

200: Server generated an error: 145: API calls from the server require an appsecret_proof argument

I already Disabled the option on Facebook Developer Dash Board.

Require app secret for server API calls

Here is my code:

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);
}

and this is 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
  }
});
like image 572
Igor Fridman Avatar asked Dec 06 '22 16:12

Igor Fridman


1 Answers

Simple solution to solve above problem, just follow following step.

Step 1 : Go to Facebook developer console

     https://developers.facebook.com/

Step 2 : Select your application from the

     https://developers.facebook.com/apps/

Step 3: After selecting your application Click on Account kit located at left side panel of console below the product Title.

Step 4 : After click on Account kit you see the Reuired App Secret switch button with yes/no option right side of it.

Step 5 : Turn Off (No) the Reuired App Secret from the there ( below the allow sms login )

Step 6 : Click on Save changes tab.

Step 7 : Run your application, you will got whatever you want.

If you have still any query ask me to any time. may be these help to you or other person.

like image 91
Nirav Mehta Avatar answered May 23 '23 22:05

Nirav Mehta