Why might my code have a problem with the Facebook app?
I am developing an app with Facebook integration, and it is working perfectly in devices without the Facebook app installed, but it is not working on devices with this app. I have seen several post like this, but i think the problem is not in the keytool key.
If the phone has the FB app installed it shows the autorization dialog but once you have autorized the app, it does nothing. What i can see debugging is that it is not reaching the onComplete method:
private class LoginDialogListener implements DialogListener
{
public void onComplete (Bundle values)
{
postOnFbWall ();
}
public void onFacebookError (FacebookError e)
{
// TODO Auto-generated method stub
Toas开发者_开发技巧t t;
t = Toast.makeText (getApplicationContext (), "Something went wrong! Try it later.", Toast.LENGTH_SHORT);
t.show ();
}
public void onError (DialogError e)
{
// TODO Auto-generated method stub
Toast t;
t = Toast.makeText (getApplicationContext (), "Something went wrong!! Try again later.", Toast.LENGTH_SHORT);
t.show ();
}
public void onCancel ()
{
// TODO Auto-generated method stub
}
}
Any solution? Thanks a lot.
Have you implemented onActivityResult()
in your calling activity as stated in the official doc?
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebook.authorizeCallback(requestCode, resultCode, data);
}
Without that, the callback will never be used. See Facebook SDK for Android under Single-Sign-On
精彩评论