O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing the Facebook SDK on iOS and Android

Initialize a new React Native project using the following command line:

react-native init Friends 

Afterwards, navigate to the new project you just created using a command line.

The Facebook SDK for React Native is available through npm in a package called react-native-fbsdk. We'll install it as such:

npm install --save react-native-fbsdk 

Now link the SDK, as follows:

react-native link react-native-fbsdk 

Now, follow the detailed instructions on the react-native-fbsdk repo on GitHub found at https://github.com/facebook/react-native-fbsdk. Since the installation instructions are prone to being changed at any given time, I highly recommend that you use the instructions found in that repo.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required