-1

I have integrated facebook with my app and it is running fine locally. When i deploy my app after that facebook feature not working showing toast "Unable to authorize facebook. Please try again". Please let me know if anything special need to be done while deploying on play store or any configuration change.

Hassan Munir
  • 419
  • 7
  • 24

5 Answers5

1

You need to generate key with your release keystore and add that key to your facebook app.

Rajesh Panchal
  • 1,140
  • 3
  • 20
  • 39
1

You have require to set signed SHA key in your facebook developer console, you can directly generate signed and unsigned SHA using following code,

try {
            Logger.print("=" + getPackageName());
            PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Logger.print("KeyHash:" + Base64.encodeToString(md.digest(), Base64.DEFAULT));
            }
        } catch (PackageManager.NameNotFoundException | NoSuchAlgorithmException e) {
            e.printStackTrace();
        }

For the signed SHA install signed apk in your device and check log and unsigned install debug apk and check Log.

Dhaval Solanki
  • 4,589
  • 1
  • 23
  • 39
1

you need to generate the release key(facebook api key) for release version..!!

Androidss
  • 47
  • 11
  • I generated new release key and paste it on my facebook developer account. But still got the same issue. Do i need to deploy new apk on play store to take effect ? – Hassan Munir Feb 07 '17 at 05:49
0

After deploying to play store its not working at my side.i am getting my new key hash from logcat and then this add to facebook developer account then it working fine at my side.we are getting debug key and after generating signed apk we have to add this to facebook developer.you can get the key logcat with simple steps.Hope this helps.:)

Pratik Gondil
  • 689
  • 1
  • 6
  • 17
0

You should make your app as public so

STEP 1:

Login to facebook Developer Account -> Your App

In Settings -> Basic -> Contact Email. (Give any email)

STEP 2:

And in 'App Review' Tab : change Make (name of your app) public? make it as yes enter image description here

put this as yes

Credits

Community
  • 1
  • 1
Kiran Benny Joseph
  • 6,755
  • 4
  • 38
  • 57