Facebook Login is not working

121 views Asked by At

Facebook Login is not working on my side. can Anyone Have Its solution how to login to Facebook from my app.

It is giving me Invalid Key Hash error.

3

There are 3 answers

0
Mayank On

There is a way mentioned on Facebook Tutorial for generating key hash using command line on windows that doesn't always work. Try this

2
Jaswinder On

if keyHash always saying incorrect put any invalid keystore at developing time and use same account of facebook developer key account and testing account and if developer accounts working fine than put signed build in playstore and then download application form playstore and try to login with facebook than application give error of keyhash copy that keyhash form mobile and put it into facebook developer key application its working

second options open and enter genrate keyhash online

2
AudioBubble On

try creating android hash key programmatically. Put following code in OnCreate() method of your demo.

try {
    PackageInfo info = getPackageManager().getPackageInfo(
            "com.example.packagename", 
            PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}

you will get a key in log. Copy and paste it in facebook developer console. I dont how you have generated the hash key but through command prompt i had an issue so try it out.