How to install facebook sdk for iOS using cocoapods?
Asked Answered
P

2

20

In the facebook's documentation: Here: https://developers.facebook.com/docs/ios/getting-started

It's written that we could use:

pod \'Facebook-iOS-SDK\'

For installing pods in our project. But I added it in the pod file at line 10 and try to run pod install, it shows following error on terminal:

[!] 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
Pennington answered 13/3, 2015 at 23:30 Comment(2)
Changing the pod link to pod "Facebook-iOS-SDK". Solved it why do they put \' in documentation? What's it for ?Pennington
You should delete this comment and instead post it as the answer to your own question and mark it as correct.Marlite
D
52

Facebook-iOS-SDK has been deprecated (see the message cocoapods give you when you use pod install).

According to Facebook You should use:

pod "FBSDKCoreKit";
pod "FBSDKLoginKit";
pod "FBSDKShareKit";
pod "FBSDKMessengerShareKit";
Dioptometer answered 15/6, 2015 at 14:14 Comment(7)
Yes it has changed from when i have asked. This is the correct answer now.Pennington
nice - couldn't find the messenger pod anywhere..thanksDibucaine
and how to import the pod library written in objective c headers in swift?Thermopile
Got it. import FBSDKMessengerShareKit import FBSDKCoreKit import FBSDKLoginKit import FBSDKShareKitThermopile
here is the link from facebook: developers.facebook.com/docs/ios/getting-started#delegateSprag
why fb not mention this pod in FB developer documentation ?Frawley
is this still the correct way? this answer has been here a long while..Collaborate
P
2

Changing the pod link to

pod "Facebook-iOS-SDK"

solved it why do they put \' in documentation is the question now?

EDIT: This answer is now outdated. The correct way to install facebook Pod is as @aramusss described above.

Pennington answered 14/3, 2015 at 2:40 Comment(3)
Guessing it’s a mistake. Might want to see if you can report a bug.Chrystalchryste
This has been superceded by FBSDKCoreKitLump
[!] Facebook-iOS-SDK has been deprecated in favor of FBSDKCoreKitSprag

© 2022 - 2024 — McMap. All rights reserved.