3

I am aware of native ios solution. I am wondering if it is possible to use FB JS sdk in react-native to login the users. A sample code to load FB SDK below - it will throw error in react-native because document doesn't seem to be a valid object in that implementation.

(function(d, s, id){
         var js, fjs = d.getElementsByTagName(s)[0];
         if (d.getElementById(id)) return;
         js = d.createElement(s); js.id = id;
         js.src = "//connect.facebook.net/es_LA/sdk.js";
         fjs.parentNode.insertBefore(js, fjs);
       }(document, 'script', 'facebook-jssdk'));

I can also use oauth2 manual login flow but using FB JS SDK seems better because it handles other scenarios like two-factor authentication.

Sal
  • 4,312
  • 1
  • 17
  • 26

1 Answers1

0

I would recommend using the Facebook React Native SDK Login (you can find it here) to do user authentication, I tried it and it works for signing users in...the ReadMe says delete sub projects, I was confused and deleted too many, and it didn't work, so I had to start over again, I would recommend keep the sub projects for now until we find out exactly which sub projects to delete...

vaultah
  • 44,105
  • 12
  • 114
  • 143
Kevin Zhao
  • 2,113
  • 2
  • 14
  • 18