React-native-fbsdk: LoginButton not showing facebook login page

Created on 28 Jan 2019  路  4Comments  路  Source: facebook/react-native-fbsdk

Environment

  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (4) x64 Intel(R) Core(TM) i7-7500 CPU @ 2.80GHz
      Memory: 16 GB 
    Binaries:
    IDEs:
      Android Studio: Version  3.3
package.json:
"react": "^16.7.0",
"react-native": "0.58",
"react-native-fbsdk": "0.9.0"

Description

I am trying to use react-native-fbsdk to login. I followed the steps from React Native FBSDK. I get no error from android when I run it. The compilation is fine and the app is also running perfectly on mobile.

When I run react-native run-android I have no error and I can even see facebook loginButton. But when I click on the button, it doesn't bring me to the facebook login page most of the times. Specially in Samsung mobile series its not opening login page or sometimes i need to click multiple to the loginButton then it appears login page. In other mobiles its working fine.

I found this issue specifically in Android 8 and 9 versions of Samsung devices.

Most helpful comment

I am having the same error. Its telling me that I am not logged in instead of showing a login page. I am using,

"react-native": "0.58.3",
"react-native-fbsdk": "^0.8.0",

image

I am testing on my physical Nokia mobile device. Android version 9

EDIT: For anyone having the same problem, here's how I fixed it (Took me hours)

  1. Go to developers.facebook.com/app/your_app_id/
  2. Go to Settings -> Basic -> Scroll down and click on add platform
  3. Select your platform (I used android)
  4. In Google Play Package Name field enter your package name (You can find this in your Android Manifest
  5. Enter class name in Class Name field (You can also find this in your Android Manifest )
  6. Generate a keyhash and enter in the keyhashes field. (I used a development keyhash)
  7. Click on Save changes and try logging in.

Command to generate keyhash
_For mac and linux:_
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

_For windows:_
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.android\debug.keystore | openssl sha1 -binary | openssl base64

You can find all the information if you go to Settings -> Basic -> Add platform -> Select a platform and click on Quick Start on the right corner after you select your platform.

All 4 comments

In my case it's different. In my android emulator environment, the pop up shows up but it's telling me that i'm not logged in instead of bringing me to login page

Edit: adding environment
"react-native": "0.58",
"react-native-fbsdk": "^0.8.0",
On Android Studio's Android Emulator running Android 9

are you testing on Samsung Galaxy or Note mobile device ? if yes, then my mean to say is fbsdk is having different issues for the Samsung series , because i have tested for almost all mobiles and its working fine except for Samsung. Hence its not the code issue but fbsdk.

I am having the same error. Its telling me that I am not logged in instead of showing a login page. I am using,

"react-native": "0.58.3",
"react-native-fbsdk": "^0.8.0",

image

I am testing on my physical Nokia mobile device. Android version 9

EDIT: For anyone having the same problem, here's how I fixed it (Took me hours)

  1. Go to developers.facebook.com/app/your_app_id/
  2. Go to Settings -> Basic -> Scroll down and click on add platform
  3. Select your platform (I used android)
  4. In Google Play Package Name field enter your package name (You can find this in your Android Manifest
  5. Enter class name in Class Name field (You can also find this in your Android Manifest )
  6. Generate a keyhash and enter in the keyhashes field. (I used a development keyhash)
  7. Click on Save changes and try logging in.

Command to generate keyhash
_For mac and linux:_
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

_For windows:_
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.android\debug.keystore | openssl sha1 -binary | openssl base64

You can find all the information if you go to Settings -> Basic -> Add platform -> Select a platform and click on Quick Start on the right corner after you select your platform.

@SL-A-SH hi, to create my key i used the following command:

keytool -genkey -v -keystore debug.keystore -storepass androiddebugkey -alias androiddebugkey -keypass ppdebugkey -keyalg RSA -keysize 2048 -validity 10000

What's the difference between the one you shared and this one above?

Was this page helpful?
0 / 5 - 0 ratings