【问题标题】:Facebook account kit in AndroidAndroid 中的 Facebook 帐户工具包
【发布时间】:2016-07-19 08:22:07
【问题描述】:

如何在Android中实现用于验证电话号码的facebook帐户工具包?他们的官方文档似乎很奇怪。请帮助。还有哪些属性需要在styles.xml中给出?

我的登录活动

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

}

【问题讨论】:

    标签: android account-kit


    【解决方案1】:

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

    你打算做任何主题吗?除非您想进一步自定义 UI,而不是基本流程,否则您不需要更新样式。

    【讨论】:

      猜你喜欢
      • 2019-01-02
      • 1970-01-01
      • 2017-04-07
      • 2017-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多