Skip to content

shaktisinh/key_hash_for_android_facebook_integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Generate key hash for android for Facebook integration

Put this code into your onCreate() method

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

            }
            catch (NoSuchAlgorithmException e) {

            }

Note: Please run signed application otherwise you might get wrong Key

About

Generate key hash for android for Facebook integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published