This topic assumes that you have already created a React Native project. If you haven't, then visit Getting Started with the Facebook SDK for React Native.
[Yourapp]with the name of you app.
cd ios open [YourApp].xcodeproj
andConfigure your info.plist
ios_setup.jsby executing the following command in a command prompt at your project's root folder.
curl -O https://raw.githubusercontent.com/facebook/react-native-fbsdk/master/bin/ios_setup.js
xcodepackage, and the
adm-zippackage, by executing the following command.
npm install plist xcode adm-zip
ios_setup.jsby executing the following command, and insert your app's App ID and App Name. If the name of your app is more than one word long, then enclose it between quotation marks.
node ios_setup.js [App ID] [App Name]Continue to the next step to verify that your app runs.
At this point, your application should be fully configured and ready to run. To test it, you can run it in Xcode or from a terminal prompt. To run it from a terminal prompt, navigate to your application folder and type:
If everything is working correctly, you will see a terminal window appear. This window hosts the NPM server process that delivers your React code to the emulator. After that, you will also see your application start inside the emulator.
If you get a build error stating that one of the Facebook SDK files was not found, such as "FBSDKLoginKit/FBSDKLoginKit.h file not found," check three things:
~/Documents/FacebookSDKis in the Framework Search Path of your build target's Build Settings.
If you get a build error like "Warning: Native component for 'RCTFBLikeView' does not exist," verify that
libRCTFBSDK.a shows up in the Link Binary with Libraries section of your build target's Build Phases.
If you get an application error on your emulator that says, "Could not connect to the development server," then your local NPM server isn't running. Open up a terminal window and type:
Leave this window open and the server running while you are testing and debugging your application.