sending app request to facebook friends or posting through facebook sdk 3.7 is not working after installing fb in mobile

StackOverflow https://stackoverflow.com//questions/22011575

  •  21-12-2019
  •  | 
  •  

Question

i have installed fb android sdk 3.6 to send app request and share posts. it was working as long as i had no fb installed in my mobile, or the fb app provided inside the sdk folder.

problem started arising when i updated the fb app to latest version. when i select i vite in my app, it requests for accessing fb informations, after that, friend selection dialog is not appearing. it is same in case of send app request. after updating fb app, the sample projects, which are given in the sdk, they are not running too. i tried updating the sdk to 3.7, but no luck. it isn't showing any errors.

i'm using sendRequestDialog() to send requests. please help me

Was it helpful?

Solution

I faced this problem also and lots of google i got that facebook is "single sign on" means its need credential only one time.When fb installed in your app it already get credential from fb app and not open dialog for credential.so please check hash key is same which is posted on facebook app. if it is same then it will work. Otherwise you can generate hashkey by below code:

private void keyHashGenerate() {
    try {
        PackageInfo info = getPackageManager().getPackageInfo(
                getPackageName(), PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            UsefullData.Log("KeyHash: "
                    + Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
    } catch (NameNotFoundException e) {

    } catch (NoSuchAlgorithmException e) {

    }
}

After getting hashkey post on facebook application browser.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top