0

I tried to integrate the FacebookSDK for iOS in React Native. I followed all steps from the getting started guide and now I am getting a red rectangle instead of a Login Button when running the app.

When I try to run 'react-native link react-native-fbsdk' I am getting this output:

rnpm-install info Android module react-native-fbsdk is already linked 
rnpm-install info Linking react-native-fbsdk ios dependency 
rnpm-install ERR! Something went wrong while linking. Error: Expected "/*", "//", or "{" but "<" found. 
Please file an issue here: https://github.com/facebook/react-native/issues 

Expected "/*", "//", or "{" but "<" found.
  • I have react-native-fbsdk in my node_modules
  • I have the path to the Facebook SDK in my Build Settings -> Framework Search Paths in Xcode
  • I have the frameworks linked in the Build Phases -> Link Binary with Libraries
Marco
  • 517
  • 6
  • 19

2 Answers2

0

First install an older version of fbsdk

npm install react-native-fbsdk@0.6.0 --save

Then run this command

react-native link react-native-fbsdk

after that you can update the fbsdk

Paras Watts
  • 2,565
  • 4
  • 21
  • 46
  • Thank you for your fast reply! I have tried your steps and now it said that it is successfully linked and it also added the 'libRCTFBSDK.a' file to the Xcode project, but I am still getting a red rectangle and in the remote debugging console it says 'Warning: Native component for "RCTFBLoginButton" does not exist'. I also tried adding the libRCTFBSDK.a to the linked binaries again and also re-added the FacebookSDK. Do you have any idea what else I could try? – Marco Aug 11 '17 at 12:04
  • Yeah I did, but it is still the same – Marco Aug 11 '17 at 12:15
  • If the linking is successful and libRCTFBSDK.a file comes up ,then problem should not come .Although You can follow this thread. https://stackoverflow.com/questions/40874400/native-component-for-rctfbloginbutton-does-not-exist – Paras Watts Aug 11 '17 at 12:18
0

Based on my personal experience, I can't use the FBSDK that was installed via NPM in iOS. You should follow all the steps provided here https://developers.facebook.com/docs/ios/getting-started to integrate with FBSDK. It should be work properly after that.

Wanda Ichsanul Isra
  • 2,142
  • 10
  • 19