1

Sorry for asking the same question, but I read all the threads posted before and tried everything suggested, but I was still unsuccessful.

I am getting the same:

App is misconfigured for Facebook login.

Screen shot

The issue looks same as here, but I could not get the Logcat printed as an error in red even after setting ENABLE_LOG to true in util.java.

I have checked my app_id and copied the hash key in developer.facebook, and everything looks right. But I don't know where I am going wrong and also that I am getting it right when I use the app without native Facebook app.

But I want to login using native Facebook.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
VIGNESH
  • 2,023
  • 8
  • 31
  • 46

1 Answers1

3

Assuming you're using the latest 3.0 SDK, try the following two options:

Option 1: (Windows)

%KEYTOOLPATH%\keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | %OPENSSLPATH%\openssl sha1 -binary | %OPENSSLPATH%\openssl base64

Example:

C:\Program Files (x86)\Java\jdk1.7.0_09\bin\keytool" -exportcert -alias androiddebugkey -keystore "C:\Home\.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64 

Use the password: android

Option 2: (Print key hash sent to FB)

(A variation of Facebook SDK for Android - Example app won't work)

Add this code to your activity:

    try {
        PackageInfo info = getPackageManager().getPackageInfo("your package name, e.g. com.yourcompany.yourapp]", 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) {

    }

Example: In HelloFacebookSampleActivity, make the following temporary modification to the onCreate() method

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    try {
        PackageInfo info = getPackageManager().getPackageInfo("com.facebook.samples.hellofacebook", 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) {

    }

    ...
}

Run your sample and you should get logcat output on the KeyHash tag similar to:

12-20 10:47:37.747: D/KeyHash:(936): 478uEnKQV+fMQT8Dy4AKvHkYibo=

Use that value in Facebook's App Dashboard settings for your app.

Community
  • 1
  • 1
C Abernathy
  • 5,533
  • 1
  • 22
  • 27
  • Thanks for the answer , and sorry that i have missed to give "user_action" permission , now resolved . – VIGNESH Dec 21 '12 at 13:56