androidfacebookandroid-intentandroid-activityscringo

Not able to loging to Facebook but i am able to sign up using Scringo


I have integrated the facebooksdk into my android application which is using scringo,
I am able to signup to FB using the below code,

Intent intent = new Intent(ScringoSignUpActivitySub.this, ScringoProfileBridge.class);
intent.putExtra("network", "facebook");
intent.putExtra("action", "signUp");
//intent.putExtra("action", "login");
startActivityForResult(intent, 102);

but i am not able to login to FB in the similar manner as below,

Intent intent = new Intent(ScringoSignUpActivitySub.this, ScringoProfileBridge.class);
intent.putExtra("network", "facebook");
intent.putExtra("action", "login");
//intent.putExtra("action", "login");
startActivityForResult(intent, 102);

i am getting error as 'This app has no Android key hashes configured....'


Solution

  • Try to generate key hash using below code : public void keyHash() {

        try {
            Log.d("Checking signs", "Signs");
            PackageInfo info = getPackageManager().getPackageInfo(
                    this.getPackageName(), PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                System.out.print(Base64.encodeToString(md.digest(),
                        Base64.DEFAULT));
    
            }
        } catch (NameNotFoundException e) {
            e.printStackTrace();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
    }
    

    And Check for "Status and Review" menu in your project facebook developers site,

    Do you want to make this app and all its live features available to the general public? Set this line to "Yes"