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

Login success but can't get accessToken #763

Open aniruddhbhamare opened 4 years ago

aniruddhbhamare commented 4 years ago

🐛 Bug Report

after integration able to login but can not get accessToken. react: 16.8.3 => 16.8.3 react-native: 0.59.10 => 0.59.10 "react-native-fbsdk": "^0.10.3",

To Reproduce

Expected Behavior

Code Example

<LoginButton // readPermissions={["email"]} publishPermissions={["publish_actions",]} onLoginFinished={ (error, result) => { if (error) { alert("login has error: " + result.error); } else if (result.isCancelled) { alert("login is cancelled."); } else { alert(result) // This prints out the access token object (includes expiration time and etc...) AccessToken.getCurrentAccessToken().then((accessToken) => { alert(accessToken.accessToken) ToastAndroid.show(accessToken,ToastAndroid.LONG); }) } } } onLogoutFinished={() => alert("logout.")} />

Environment

React Native Environment Info: System: OS: macOS 10.14.5 CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz Memory: 181.25 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.5.0 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 23, 25, 26, 27, 28, 29 Build Tools: 23.0.1, 27.0.3, 28.0.2, 28.0.3 System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.4 AI-183.6156.11.34.5522156 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: 0.59.10 => 0.59.10 npmGlobalPackages: react-native-cli: 2.0.1

varunshukla commented 4 years ago

@aniruddhbhamare Were you able to resolve this issue? I have the same configurations and am getting the same bug for a long duration.

aniruddhbhamare commented 4 years ago

still not got any solution

On Fri, 12 Jun 2020, 8:07 pm Varun Shukla, notifications@github.com wrote:

@aniruddhbhamare https://github.com/aniruddhbhamare Were you able to resolve this issue? I have the same configurations and am getting the same bug for a long duration.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native-fbsdk/issues/763#issuecomment-643305601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG77JVP2P3HW2GBX7SRAIR3RWI4RRANCNFSM4NV6YAZA .

keshav263 commented 3 years ago

Hey, it turns out that it's buggy only with LogInButton, try using LogInManager. It worked for me