在 iOS 中反应原生 fbsdk [英] React Native fbsdk in iOS
问题描述
当我在我的项目中添加 fbsdk 时,出现了类似 -
When I added fbsdk in my project, I got errors like -
警告:RCTFBLikeView"的原生组件不存在2016-06-21 22:27:38.898 [警告][tid:com.facebook.react.JavaScript]
Warning: Native component for "RCTFBLikeView" does not exist 2016-06-21 22:27:38.898 [warn][tid:com.facebook.react.JavaScript]
警告:RCTFBLoginButton"的原生组件不存在2016-06-21 22:27:38.899 [警告][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]
警告:RCTFBSendButton"的原生组件不存在2016-06-21 22:27:38.900 [警告][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]
警告:RCTFBShareButton"的原生组件不存在
Warning: Native component for "RCTFBShareButton" does not exist
为了解决这个问题,我经历了这个 pod 方法 -https://github.com/facebook/react-native-fbsdk/issues/126
To solve this I went through this pod method - https://github.com/facebook/react-native-fbsdk/issues/126
现在,当我运行 pod install
命令时,出现此错误 -
Now, when I run pod install
command, I am getting this error -
没有找到 react-native-fbsdkcore 的 podspec../node_modules/react-native-fbsdk/iOS/RCTFBSDK/core".
No podspec found for react-native-fbsdkcore in ../node_modules/react-native-fbsdk/iOS/RCTFBSDK/core".
任何人都可以在这里有什么问题吗?
Can anybody tall what is wrong here ?
这是我的 pod 文件 -
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
推荐答案
我最近在为此苦苦挣扎,我发现在运行 react-native install react-native-fbsdk
你仍然需要运行 react-native link react-native-fbsdk
.
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
.
libRCTFBSDK.a 将出现在 Link Binary with Libraries in Xcode 下,但(我认为)需要删除,然后通过单击 -
和 +
底部的按钮.
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.
这篇关于在 iOS 中反应原生 fbsdk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!