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 907 forks source link

Can't get accesstoken when facebook app is installed with target app.(android) #604

Open jihyeonjeong11 opened 5 years ago

jihyeonjeong11 commented 5 years ago

🐛 Bug Report

I tried to implement facebook social login into my app. The problem is when I use this library without Facebook app in a same device, it's working fine and got accesstoken. But when I installed Facebook app, and do the same process, the app automatically finds out if facebook app is login or not and it not give me an access token. I tried logout and login again, but still onLoginFinished not fired.

To Reproduce

  1. adopt react-native-fbsdk.
  2. install facebook app from app store
  3. log in Facebook app.
  4. excute target app.
  5. see if I can get accesstoken from it.

Expected Behavior

Code Example

 <LoginButton
          onLoginFinished={
            (error, result) => {
              if (error) {
                console.log("login has error: " + result.error);
              } else if (result.isCancelled) {
                console.log("login is cancelled.");
              } else {
                AccessToken.getCurrentAccessToken().then(
                  (data) => {
                    console.log(data.accessToken.toString())
                    this.FBlogin(data) // this should fire this function, but no chance...
                  }
                )
              }
            }
          }
          onLogoutFinished={() => console.log("logout.")}/>

Environment

System: OS: macOS 10.14.5 CPU: (4) x64 Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz Memory: 336.64 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.13.0 - /usr/local/bin/node Yarn: 1.15.2 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 IDEs: Android Studio: 3.4 AI-183.5429.30.34.5452501 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.8.6 => 16.8.6 react-native: 0.60.3 => 0.60.3 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7 react-native-rename: 2.4.1

unnamed92 commented 5 years ago

Same here. BTW check if your hash keys are correct they may cause that error.

AshishCd commented 4 years ago

hey any success in this, I am also not getting the token back.

nahmedpk commented 4 years ago

I am also facing this issue. is anyone looking into it from facebook team?