1.Set up Your Development Environment

Select the appropriate SDK for the language you will use in this app. If your app uses Swift, select SDK: Cocoapods. If your app uses Objective-C, select SDK: FB SDK.

Install Cocoapods.

If you already installed Cocoapods and created a pod file, go to the next step to install the Facebook SDK. To install Cocoapods, open a terminal window and run the following command in a terminal window:

sudo gem install cocoapods

Install the Facebook SDK.

1.Create a new Swift project and go to the project directory. If you are using an existing project, go to project directory of the existing project.

2.In a terminal window, run the following command to create a pod file for the project:

pod init

3.Add the following line to the pod file of your project:

pod 'FacebookCore'

4.Add the following line to the pod file of your project:

pod install

Modify the AppDelegate.swift file:

1.Add following import statement:

import FacebookCore

2.Add the following statement to the applicationDidBecomeActive function:

AppEventsLogger.activate(application)

Configure Your Information Property List.

1.Enter you Bundle Identifier (Bundle ID) in the Box.

The bundle identifier (Bundle ID) should appear in the box below. If the box is empty, find your bundle identifier in your Xcode Project's iOS Application Target and paste it into the box below.

2.In Xcode, right-click info.plist and choose Open As Source Code.

3.Copy the XML snippet into the body of your file just before the final</dict>element.

<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fb136921836492269</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>136921836492269</string>
<key>FacebookDisplayName</key>
<string>Teste</string>

results matching ""

    No results matching ""