[android] Facebook Android Generate Key Hash

At last :)

Here my story :

  1. Add this code to your main activity, after you set layout.

    try { 
      PackageInfo info = getPackageManager().getPackageInfo("PROJECTNAME", PackageManager.GET_SIGNATURES);
      for (Signature signature : info.signatures) {
          MessageDigest md = MessageDigest.getInstance("SHA");
          md.update(signature.toByteArray());
          String sign=Base64.encodeToString(md.digest(), Base64.DEFAULT);
          Log.e("MY KEY HASH:", sign);
          //textInstructionsOrLink = (TextView)findViewById(R.id.textstring);
          //textInstructionsOrLink.setText(sign);
          Toast.makeText(getApplicationContext(),sign, Toast.LENGTH_LONG).show();
      }
    } catch (NameNotFoundException e) {
        Log.d("nope","nope");
    } catch (NoSuchAlgorithmException e) {
    }
    
  2. Change PROJECTNAME to your package name!

  3. Sign your app (Android Tools->Export Signed Application)
  4. In your main activity where you paste code from 2 option, in your layout create TextView with id textstring
  5. uncomment two lines, that your sign code would be set to TextView 6 Wuolia, you have your HASH , install app on your phone!!! and check your hash Key!
  6. Now when it is visible , go to facebook app you created and add it to [Key Hashes]
  7. Note that your package name should be same as on facebook [Package Name] under [Key Hashes]
  8. Have a nice day :)

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to facebook

I am receiving warning in Facebook Application using PHP SDK React-Native: Application has not been registered error Can't Load URL: The domain of this URL isn't included in the app's domains Facebook OAuth "The domain of this URL isn't included in the app's domain" Facebook login message: "URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings." Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView` Open Facebook Page in Facebook App (if installed) on Android App not setup: This app is still in development mode IOS - How to segue programmatically using swift Get ALL User Friends Using Facebook Graph API - Android

Examples related to android-keystore

I have never set any passwords to my keystore and alias, so how are they created? SHA-1 fingerprint of keystore certificate How do I find out which keystore was used to sign an app? How do I verify that an Android apk is signed with a release certificate? Facebook Android Generate Key Hash I can’t find the Android keytool