Android 中的 Facebook 帐户工具包

Facebook account kit in Android

如何在Android中实现用于验证电话号码的facebook帐户工具包?他们的官方文档似乎是weird.Please help.Also[=20=中需要提供哪些属性] ?

我的登录活动

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FacebookSdk.sdkInitialize(getApplicationContext());

    AppEventsLogger.activateApp(this);
    setContentView(R.layout.activity_login);


}

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





@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_login, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }

    return super.onOptionsItemSelected(item);
}

}

如果文档难以阅读,您可以使用此 AccountKitSimpleSample 作为指南来添加必要的部分:https://github.com/fbsamples/account-kit-samples-for-android/tree/master/samples/AccountKitSimpleSample

您打算制作任何主题吗?您不需要更新您的样式,除非您想自定义 UI 比基本流程更进一步。