简体   繁体   中英

Android Facebook login callback

i'm programming a simple facebook login for my android app, i've just configured sdk and added fb login button, i'm trying to display in logcat facebook response but it seems as if callback function is not triggered.

This is my onCreate

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FacebookSdk.sdkInitialize(getApplicationContext());
    setContentView(R.layout.activity_main);
    callbackManager = CallbackManager.Factory.create();

    LoginManager.getInstance().registerCallback(callbackManager,
            new FacebookCallback<LoginResult>() {
                @Override
                public void onSuccess(LoginResult loginResult) {
                    // App code
                    Log.e("", String.valueOf(loginResult));
                }

                @Override
                public void onCancel() {
                    // App code
                }

                @Override
                public void onError(FacebookException exception) {
                    // App code
                }
    });
}

Anyone can help me? Thank's

Read this guide . There's a complete example that you can just copy and paste.

我的问题是与Facebook应用程序设置有关的。1.包名称2.开发密钥哈希

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM