Facebook SSO doesn't work on Android device

半城伤御伤魂 提交于 2019-12-25 13:07:17

问题


I want to use Single Sign On feature to integrate Facebook to my app. It works on an emulator (shows the user authorization dialog), but not on a device with a Log message "Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider".

The Key hash is probably correct since i'm not getting invalid key errors like this and also when I don't use SSO, but force the traditional way, it works fine.

It's not this problem either, because I have included the required code.

I have read this, but didn't help either.

My code looks like this:

public class LoginActivity extends Activity {

Facebook facebook = new Facebook("123425315215"); // my actual code is not that

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

    facebook.authorize(this, new DialogListener() {
        public void onComplete(Bundle values) {Log.d("TAG","SUCCESS");}

        public void onFacebookError(FacebookError error) {Log.d("TAG","onFacebookError "+error.getMessage());}

        public void onError(DialogError e) {Log.d("TAG","onError "+e.getMessage());}

        public void onCancel() {Log.d("TAG","onCancel ");}
    });
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    facebook.authorizeCallback(requestCode, resultCode, data);
}
}

来源:https://stackoverflow.com/questions/12620601/facebook-sso-doesnt-work-on-android-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!