Question

I am in the process of registering my android app in Facebook. This is to make my app to post a wall message to their Facebook page.

During this process it asks about the release key hash. In the eclipse when I try to export the signed application package I get finger print (MD5 and SHA1). Is this the one we have to use in Facebook android app registration process.

I do not want to use keytool. Instead I need to use eclipse to get the release key needed for this process. Kindly assist.

Was it helpful?

Solution

Try to generate key hash through code-

     void getHasKey()
     {
      //Get Has Key 
        try 
        {
            PackageInfo info = getPackageManager().getPackageInfo("your package name", PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) 
            {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Log.e("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
            }
        } 
        catch (NameNotFoundException e) 
        {
            e.printStackTrace();
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top