App is misconfigured for Facebook Login with Release Key Hash

后端 未结 6 1593
陌清茗
陌清茗 2020-12-01 15:51

I\'ve intergrated Facebook to my App. I tested my App with Debug Key Hash was alright in emulator and my device HTC. When I tried the Release Key Hash for my signed APK , \"

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 16:12

    Why it works on the emulator or even on the device while you are testing it is because, while testing from eclipse, you use the debug.keystore and not your release key.

    Follow one of the two solutions below, and you should be good to go.

    Solution 1:

    Try this link: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1. I found that using the Facebook method of getting a Hash Key did not always work as advertised. This link however, has a different method of getting the Hash Key and has pretty much always worked.

    Solution 2:

    That being said, I always found the simplest thing to do was, let the Facebook SDK tell you what your Hash Key is. This is by far more simpler and shouldn't take more than a couple of minutes.

    Step 1: In your Facebook SDK, locate the Util.java class. In that, change this:

    private static boolean ENABLE_LOG = false;
    

    to:

    private static boolean ENABLE_LOG = true;
    

    Step 2: Create a new Signed APK, transfer to your device and install. If it is already installed, naturally, it will prompt.

    Step 3: With your DDMS (Logcat) running and your device connected to the computer, run the application and keep looking for a key mismatch warning. That warning has the actual Hash Key. Copy that key, go to your Facebook Developer page and add the new key to the list.

提交回复
热议问题