如何使用Cocapods为iOS安装facebook 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安装时可以提供的信息Cocapods).

根据Facebook你应该使用:

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

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...