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.