acebook is a great social media and allows user to upload images, videos and links to Facebook platform in form of News Feed and Stories. Nowadays, Facebook is a necessity in most people’s life.

Facebook provides an easy to use SDK to allow app developers to implement the login and logout function inside their apps. After user authentication is verified, app can query the user data on behalf of the user or even share media to Facebook. The data can include user public profile, email and even friend list.

Image for post

Facebook user data is an important key to let you app know more about user’s information and preferences. It can also help engaging user’s friends to install your app. Do you want to grow up your app by implementing the Facebook SDK? Let’s start here!


Setup

Image for post

Step 1) Register a Facebook Developer account

You can register a Facebook Developer account at the Facebook Developer Console and create a Facebook project.

Step 2) Add Facebook Login SDK dependencies at iOS project

Facebook Login SDK can be imported by 3 ways, Swift Package Manager, CocoaPods and Carthage. In my opinion, CocoaPods is the most convenient one.

Add the following line of code to Podfile and and run pod install to download the dependency.

pod 'FBSDKLoginKit'

Step 3) Submit the Bundle ID to Facebook

Image for post

Image for post

Bundle Identifier is the unique identifier of your app.

#facebook-login #ios-app-development #facebook #ios #swift-programming

Swift — Facebook iOS Login SDK
10.70 GEEK