问题
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