Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

JS SDK? #2

Closed
tnguyen42 opened this issue Aug 7, 2015 · 2 comments
Closed

JS SDK? #2

tnguyen42 opened this issue Aug 7, 2015 · 2 comments

Comments

@tnguyen42
Copy link

Hi,

Just a few questions by curiosity:

  • Are we supposed to use the JS SDK to access the user's data? Or is there something planned using only react-native-fbsdk?
  • Are there some states provided to detect if someone is already logged in? Or some tricks to create those?

Thanks!

@leggomyfroggo
Copy link
Contributor

You shouldn't need to use the JS SDK for anything. If you look at the react-native-fbsdkcore package, there's support for graph requests -- which you can use to request user data, among other things -- and access tokens. The getCurrentAccessToken method in FBSDKAccessToken can be used to determine if the user is logged in by checking if an access token was returned. Example:

var FBSDKCore = require('react-native-fbsdkcore');
var {
  FBSDKAccessToken,
} = FBSDKCore;

...

FBSDKAccessToken.getCurrentAccessToken((token) => {
  if (token) {
    // A non-null token indicates that the user is currently logged in.
  }
});

...

@tnguyen42
Copy link
Author

Ok thanks!
I assumed it was in the login library ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants