0

My issue is related to this one: FBSDK: Cannot read property loginwithreadpermissions of undefined

Cleaning my app warnings and unused librairies, I noticed I have a warning that says Warning: Native component for "RCTFBLoginButton" does not exist.

So, hcecking the docs: 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.

Actually, I didn't have this file in my Link Binary with Libraries section. So I add it, and then, the app crashes on start (RN splashscreen, then black screen, then iOs home).

Any ideas?

enguerranws
  • 8,087
  • 8
  • 49
  • 97
  • Any error message on console about the crash? – bennygenel Sep 25 '17 at 10:36
  • Have you linked the FBSDK correctly ? – Paras Watts Sep 25 '17 at 10:37
  • @bennygenel No, the debugger isn't ready when the app crashes. – enguerranws Sep 25 '17 at 10:43
  • @ParasWatts My ios setup / libraries link is given there: https://stackoverflow.com/questions/46274778/fbsdk-cannot-read-property-loginwithreadpermissions-of-undefined?noredirect=1#comment79518891_46274778 – enguerranws Sep 25 '17 at 10:44
  • You can start logs in new console, Sometimes when app crashed there are some logs in logcat. Try to check if crash reason is getting printed in logs or not – Paras Watts Sep 25 '17 at 10:48
  • @ParasWatts What do you mean by "new console"? – enguerranws Sep 25 '17 at 10:49
  • I mean in a new screen in your project folder run command react-native log-ios – Paras Watts Sep 25 '17 at 10:52
  • and then run the project , sometimes crash logs are printed on console or the terminal whatever you are using. – Paras Watts Sep 25 '17 at 10:54
  • @ParasWatts Dear Sir, you made my day. I didn't know about `react-native log-ios`. And this just gave me all informations I needed. I had to add to Info.plist fbauth2, fb-messenger-api, and some more values to `LSApplicationQueriesSchemes`. Thanks. I still have issues with this module, but it will be easier now. – enguerranws Sep 25 '17 at 11:07
  • Glad it helped you :) – Paras Watts Sep 25 '17 at 11:14
  • And well, 3 minutes later, I'm able to login via Facebook. Thanks. FTR I actually missed 2 things: adding libRCTFBSDK.a (this isn't said in https://developers.facebook.com/docs/ios/getting-started#settings). Then, I completely missed step 4 of this doc. I just don't know how I missed that. – enguerranws Sep 25 '17 at 11:14
  • Great. Sometimes we miss little things :) – Paras Watts Sep 25 '17 at 11:16
  • Last issue with this: login via Facebook (on iOs simulator, it opens Safari to performs the auth) doesn't close safari window. Console says: Can't close the window since it was not opened by JavaScript – enguerranws Sep 25 '17 at 12:50
  • Well, in all this xCode linking hell, I think react-native link or something else remove my adds to AppDelegate.m... – enguerranws Sep 25 '17 at 12:57

1 Answers1

0

I also had the same problem with libRCTFBSDK.a but in my case, it was with login functionality.

In my case adding <string>fb-messenger-share-api</string> to <key>LSApplicationQueriesSchemes</key> in Info.plist solved crashing the app problem.

Roman
  • 1
  • 1