Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Authentication working on Emulator, But not on physical device
    primarykey
    data
    text
    <p>Hey everyone just recently developed my first android app that logs into facebook and tries to status update Without the dialog box, using the graph API. The code below is the authorization code (which was on the fbook dev site itself) and it worked fine for me all along, until recently. Now my app logins in fine on my emulator but when I export the APK file and put it on my phone it gives me 'authentication error". Can someone explain this? It just doesn't show me the login page anymore, After I created a new keystore and hashkey AND updated that hashkey on my dev app page on facebook as usual.</p> <p>I think it's due to the keyhash etc, but I dont understand that well enough to figure out what's wrong. What I do is, I click export, application, then I create a new keystore (the first time, otherwise I use existing keystore), then I find my hashkey using "keytool exportcert" etc as show on the fbook dev site. Then I enter that hashkey into the app on my facebook account. But sometimes even though the keystore password is correct it says "keystore format" is different, even though I used it before the same app! Then I have to create a new keystore, and exportcert again and all of that is a pain! There must be an easier way?</p> <p>Can someone possibly explain how the hashkey for Facebook apps work as well?</p> <p>Thanks in advance!</p> <p>My Authentication Code : </p> <pre><code>public void login() { facebook.authorize(this,new String[] { "email", "read_stream", "publish_stream"}, new DialogListener(){ int fbcheck=0; @Override public void onComplete(Bundle values) { fbcheck=1; facebookauthcheck(fbcheck); } @Override public void onFacebookError(FacebookError error) { fbcheck=0; facebookauthcheck(fbcheck); } @Override public void onError(DialogError e) { fbcheck=0; facebookauthcheck(fbcheck); } @Override public void onCancel() { fbcheck=2; facebookauthcheck(fbcheck); } }); } public void facebookauthcheck(int fbcheck) { if (fbcheck == 0) { Toast.makeText(this, "Authentication Error", Toast.LENGTH_LONG).show(); } else if (fbcheck==1) { Toast.makeText(this, "Authenticated", Toast.LENGTH_LONG).show(); } else Toast.makeText(this, "Authentication Cancelled", Toast.LENGTH_LONG).show(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload