React Native fbsdk in iOS
Asked Answered
F

3

3

When I added fbsdk in my project, I got errors like -

Warning: Native component for "RCTFBLikeView" does not exist 2016-06-21 22:27:38.898 [warn][tid:com.facebook.react.JavaScript]

Warning: Native component for "RCTFBLoginButton" does not exist 2016-06-21 22:27:38.899 [warn][tid:com.facebook.react.JavaScript]

Warning: Native component for "RCTFBSendButton" does not exist 2016-06-21 22:27:38.900 [warn][tid:com.facebook.react.JavaScript]

Warning: Native component for "RCTFBShareButton" does not exist

To solve this I went through this pod method - https://github.com/facebook/react-native-fbsdk/issues/126

Now, when I run pod install command, I am getting this error -

No podspec found for react-native-fbsdkcore in ../node_modules/react-native-fbsdk/iOS/RCTFBSDK/core".

Can anybody tall what is wrong here ?

This is my pod file -

 platform :ios, ‘7.0’
 use_frameworks!

 xcodeproj ‘/Users/ais/Netizen/ios/Netizen.xcodeproj’

 target ’Netizen’ do
  source ‘https://github.com/CocoaPods/Specs.git’
  pod 'React', :subspecs => ['Core', 'RCTImage', 'RCTNetwork', 'RCTText',      'RCTWebSocket'], :path => '/Users/ais/Netizen/node_modules/react-native'

  pod 'react-native-fbsdkcore', :path => ‘../node_modules/react-native-  fbsdk/iOS/RCTFBSDK/core’
  pod 'react-native-fbsdklogin', :path => '../node_modules/react-native-fbsdk/iOS/RCTFBSDK/login’
  pod 'react-native-fbsdkshare', :path => '../node_modules/react-native-fbsdk/iOS/RCTFBSDK/share’
 end

 target ‘NetizenTests' do

 end
Firstnighter answered 22/6, 2016 at 6:43 Comment(0)
K
4

I was struggling with this recently and what I found to work is that, after running react-native install react-native-fbsdk you still need to run react-native link react-native-fbsdk.

The libRCTFBSDK.a will then appear under Link Binary with Libraries in Xcode but (I think) needs to be removed and then re-added by clicking the - and + buttons at the bottom.

Killdeer answered 8/12, 2016 at 16:42 Comment(0)
D
0

Pod spec support has been removed since a recent version. It expects the FacebookSDK to be ~/Documents directory. See issue here https://github.com/facebook/react-native-fbsdk/issues/181

Despoliation answered 22/6, 2016 at 14:7 Comment(2)
Hi, Thanks. One more thing. If I do these steps in New project, It is working. But, If I follow these steps for my already created project which has other functionalities, it is still showing the same error.Firstnighter
Even after removing node_modules and reinstalling? Have you removed podspec ?Despoliation
P
0

I have installed react-native-fbsdk and link using react-native-link react-native-fbsdk.

Follow instruction of following link

https://developers.facebook.com/docs/react-native/configure-ios

This provide to link react-native library using ios_setup.js There are following step which i have followed.

  1. Setup on facebook developer account .
  2. Install the file ios_setup.js by 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
  1. Install the plist package, the xcode package, and the adm-zip package, by executing the following command.
npm install plist xcode adm-zip
  1. Run the script ios_setup.js by 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]

When run node ios_setup.js it wll automatically link all files in ios.

Phototypography answered 3/4, 2019 at 7:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.