react-native-fbsdk version 0.6.1 has an issue where running react-native link react-native-fbsdk does not work on iOS, you have to do a manual setup if you want to use this version. For Android the linking works fine.

Issue link: https://github.com/facebook/react-native-fbsdk/pull/349

This post is a guide on how to do that manual setup to save you time for doing other things instead of getting frustrated.

There are 3 steps
  1. Install react-native-fbsdk
  2. Configure the Facebook SDK on the Facebook App Dashboard.
  3. Add the RCTFBSDK project to your iOS project
Install react-native-fbsdk

Run react-native install react-native-fbsdk

Configure the Facebook SDK on the Facebook developer dashboard

Follow the doc to get the configuration:
https://developers.facebook.com/docs/ios/getting-started/

For second step: Don't put the Facebook SDK randomly anywhere but has to be in ~/Documents/FacebookSDK.

If you are not an iOS developer, you may get confused at step 3. The screenshots below help you get a picture of the configuration

framework-search-path
framework-libs
Add the RCTFBSDK project to iOS your project

Open your iOS project in Xcode

xcode


Drag & drop RCTFBSDK.xcodeproj to Libraries folder

adding-rctfbsdk.xcodeproj
libraries-file

Add libRCTFBSDK.a to Link Binary with Libraries

libRCTFBSDK.a

Add this code to AppDelegate.m to fix the issue with the Facebook SDK not calling back to the app when the user logins successfully.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  
  BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
                                                                openURL:url
                                                      sourceApplication:sourceApplication
                                                             annotation:annotation
                  ];
  // Add any custom logic here.
  return handled;
}

Make sure your AppDelegate.m looks something like this:

AppDelegate.m

Checkout the full example on Github: https://github.com/VoNam/RN-FBSDK-Example