0

I have to integrate facebook in my application, and I have a problem when creating the Facebook Application, namely: My application's packageName as found in the AndroidManifest.xml is overriden by the gradle file config.

Basically, in AndroidManifest.xml I have com.myapp.smth, and in gradle file I have com.smth.myapp.

So now, I don't know what to fill in the Facebook console for:

  • package name -> which one? as defined in Manifest or as overriden by gradle?
  • mainActivity name -> do I have to replace the package to the one overriden by gradle?
  • keyHashes -> if I use the method described here https://stackoverflow.com/a/13488560 I get a different keyhash, than I would get if I were to use the method using command-line keytool. Why is that?

Any help would be much appreciated. Thanks.

Community
  • 1
  • 1
nightfixed
  • 871
  • 1
  • 12
  • 24

1 Answers1

0

package name in gradle com.smth.myapp

mainActivity does not matter

keyHashes search in log by "TAG"->

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

    } catch (NoSuchAlgorithmException e) {

    }
PeDuCKA
  • 553
  • 3
  • 13