[巨大的更新]
有人给我发了这个,它更容易阅读以便使用 React Native 安装 fbsdk:https://developers.facebook.com/docs/react-native/getting-started-ios
但是,问题仍然是一样的:
Use of undeclared identifier 'UIUserInterfaceIdiomTV'
我猜这是来自 CocoaPods 拉取的内容的错误,因为 我能够制作 sample example只需删除相同的 UIUserInterfaceIdiomTV 即可工作案例(它曾经在开关中)。
但是,按照指南中的每一步并最终删除 UIUserInterfaceIdiomTV,我在自己的项目中遇到了新的编译问题:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FBSDKAppEvents", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTRootView", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如果有人可以帮助...
谢谢你的帮助!
最佳答案
我终于让 fbsdk 工作了(24/04/2016)。总结不同的步骤,以防您遇到相同的问题:
The 'YourApp [Debug]' target overrides the 'OTHER_LDFLAGS' build setting...
命令后的警告pod install
, $(inherited)
将添加到 主项目build设置而不是在 Pod 中
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{your-app-id}</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>FacebookAppID</key>
<string>{your-app-id}</string>
<key>FacebookDisplayName</key>
<string>{your-app-name}</string>
不要忘记将 {your-app-id} 替换为...您的应用程序 ID,并将 {your-app-name} 替换为您的应用程序名称。
祝大家好运!
关于ios - 为 iOS React-Native 项目设置 Fbsdk 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36878592/