I'm getting login failed invalid key error
while using an updated version of Facebook. If I delete it - it's working fine..
What is the correct way of creating a hash key?
I know that there are a lot of questions and answers for single sign on in Android, but none helped me to implement single sign-on in Android.
My code:
public class Main extends Activity {
Facebook facebook = new Facebook("XXXXXXXXXX");
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
facebook.authorize(this, new DialogListener() {
@Override
public void onComplete(Bundle values) {}
@Override
public void onFacebookError(FacebookError error) {}
@Override
public void onError(DialogError e) {}
@Override
public void onCancel() {}
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebook.authorizeCallback(requestCode, resultCode, data);
}
}
Then I generated a hash key using the command
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
Also, I am having OpenSSL and given the location of OpenSSL upto openssl.exe
..
After I hit Enter it is asking for a password and I gave android as the password. Then I got a key and filled in "My Application".
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…