facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

SERVER_ERROR: [code] 1349195 [message]: The key hash does not match any stored key hashes. in Real Device (Android) #827

Closed nammiharika closed 3 years ago

nammiharika commented 3 years ago

🐛 Bug Report

I am using this module. It's working fine in iOS but in android device i am getting this error SERVER_ERROR: [code] 1349195 [message]: The key hash does not match any stored key hashes. Go to https://developers.facebook.com/docs/facebook-login/android for more information. [extra]: I tested in android emulator it's working fine and getting success response.

To Reproduce

Error is getting only in real device android. Android emulator is getting success response. Testing Devices:- Samsung S9 & Samsung M31s I followed this doc https://developers.facebook.com/docs/android/getting-started/ for generating hash key.

Expected Behaviour

Success Response for real devices android

Code Example

<LoginButton
                permissions={["email"]}
                onLoginFinished={
                    (error, result) => {
                        if (error) {
                            console.log("login has error: ", error);
                        } else if (result.isCancelled) {
                            console.log("login is cancelled.");
                        } else {
                            AccessToken.getCurrentAccessToken().then(
                                (data) => {
                                    console.log( data)
                                }
                            )
                        }
                    }
                }
                onLogoutFinished={() => console.log("logout.")} />

Environment

Screenshot 2021-01-06 at 2 47 11 PM

tomarlokesh commented 3 years ago

Get The Debug And Release Key Hash from YourProjectName/android/app Directory and put into the Facebook Developer Account

nammiharika commented 3 years ago

hi @tomarlokesh, thanks for your reply. I placed the hash key in facebook developer account but it is not working for me.

In my case facing problem with existing user. When login with fb account in chrome it's working fine. But already there is existing user getting this issue.

nammiharika commented 3 years ago

I fixed this issue by follow this https://stackoverflow.com/a/12577997/8626023

I did a mistake by giving wrong password for generating hash key

I will give android as a password to generate hash key and it's working fine for me. Thank you.

amalmadawa90 commented 3 years ago

I fixed this issue by follow this https://stackoverflow.com/a/12577997/8626023

I did a mistake by giving wrong password for generating hash key

I will give android as a password to generate hash key and it's working fine for me. Thank you.

this worked for me too. Why it's need to give password as Android ?

muhammadashfaq commented 3 years ago

I fixed this issue by follow this https://stackoverflow.com/a/12577997/8626023

I did a mistake by giving wrong password for generating hash key

I will give android as a password to generate hash key and it's working fine for me. Thank you.

not workign for me