ios - 如何使用 cocoapods 安装适用于 iOS 的 facebook sdk?

标签 ios objective-c swift cocoapods facebook-ios-sdk

在 facebook 的文档中: 这里:https://developers.facebook.com/docs/ios/getting-started

上面写着我们可以使用:

pod \'Facebook-iOS-SDK\'

用于在我们的项目中安装 pod。但是我将它添加到第 10 行的 pod 文件中并尝试运行 pod install,它在终端上显示以下错误:

[!] Oh no, an error occurred.

It appears to have originated from your Podfile at line 10.

Search for existing github issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%2FUsers%2Fprajeetshrestha%2FDesktop%2FHotRents%2FPodfile%3A10%3A+syntax+error%2C+unexpected+%24undefined%0A++++pod+%5C%27%2FUsers%2Fprajeetshrestha%2FDeskt...%0A+++++++++%5E%0A%2FUsers%2Fprajeetshrestha%2FDesktop%2FHotRents%2FPodfile%3A13%3A+syntax+error%2C+unexpected+tCONSTANT%2C+expecting+keyword_end%0Atarget+%27HotRentsTests%27+do%0A+++++++++++++++++++++%5E%0A%2FUsers%2Fprajeetshrestha%2FDesktop%2FHotRents%2FPodfile%3A13%3A+unterminated+string+meets+end+of+file%0A%2FUsers%2Fprajeetshrestha%2FDesktop%2FHotRents%2FPodfile%3A13%3A+syntax+error%2C+unexpected+end-of-input%2C+expecting+keyword_end&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

最佳答案

Facebook-iOS-SDK 已弃用(请参阅使用 pod install 时 cocoapods 给您的消息)。

根据 Facebook你应该使用:

pod "FBSDKCoreKit";
pod "FBSDKLoginKit";
pod "FBSDKShareKit";
pod "FBSDKMessengerShareKit";

关于ios - 如何使用 cocoapods 安装适用于 iOS 的 facebook sdk?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29043597/

相关文章:

ios - 访问超出 Swift 范围的变量

ios - 延迟加载 UI 元素/IBOutlets

ios - firebase 登录功能未运行

ios - 为什么 AVPlayer 不播放任何内容?

ios - SwiftUI iOS 14 日期选择器奇怪的行为

ios - 比较两个错误

ios - 在 UITableView 中实现 imageView 滑动,具有水平滚动和页面指示器

ios - 在 xcode 上使用 sprite kit 创建黑洞

objective-c - 在 Objective-C 中给自己赋值

ios - "There is no registered handler for URL scheme com-google-gidconsent"使用 GIDSignIn 登录时出错