Swift SDK Basics

With the Facebook SDK for Swift, you gain a swift-taylored experience for all of the core Facebook SDK for iOS’s APIs. This includes:

  • Facebook Login – Authenticate people with their Facebook credentials.
  • Share and Send dialogs – Enable sharing content from your app to Facebook.
  • App Events – Log events in your application.
  • Graph API – Read and write to Graph API.

Frameworks

The frameworks for the Facebook SDK in Swift are organized in the same way as the Facebook SDK for iOS . They also depend upon the Facebook SDK for iOS, although this may change at some point in the future.

FacebookCore.framework (Depends on FBSDKCoreKit.framework)

The following types are included, with enhancements for Swift:

  • AccessToken: Now a struct.
  • ApplicationDelegate
  • AppEvents: A myriad of improvements, including type-safe built-in AppEvents, an AppEvent struct, and more.
  • GraphRequest: You can now implement your own type-safe GraphRequests, including native-typed results.
  • SDKSettings: Logging behaviors are now implemented as a type-safe set, based on Swift enums.
  • Permissions: No longer string-based. Contains separate types for read and write permissions, including a built-in permission list that includes the most common permissions by default.

FacebookLogin.framework (Depends on FacebookCore.framework, FBSDKLoginKit.framework)

The following types are included, with enhancements for Swift:

  • LoginManager: Now uses the type-safe permissions from FacebookCore with constructors for LoginBehavior and DefaultAudience instead of requiring manual setting of properties.
  • LoginButton: Can no longer change permissions after creation, helping to enforce the use of a single login button for a given set of permissions.
  • LoginButton is not intended to work with interface builder or storyboards at this time.

FacebookShare.framework (Depends on FacebookCore.framework, FBSDKShareKit.framework)

The following types are included, with enhancements for Swift:

  • GraphSharer (Previously FBSDKShareAPI): Now a generic type that can handle any type of content.
  • LinkShareContent: Now a struct with an initializer that enforces required properties.
  • OpenGraphShareContent: Now a struct that uses type-safe OpenGraphPropertyName and OpenGraphPropertyValue as well as structs for OpenGraphObject and OpenGraphAction.
  • PhotoShareContent: Now a struct with better type-safety for its properties.
  • VideoShareContent: Now a struct with better type-safety for its properties.
  • ShareDialog: Now a generic type that can handle any type of content.
  • MessageDialog: Now a generic type that can handle any type of content.
  • GameRequest (Previously FBSDKGameRequestContent): Now a struct that contains a type-safe enum for Recipient and Result.
  • Dialog
  • AppGroupRequest (Previously FBSDKAppGroupContent): Now an enum that encapsulates both Create and Join requests.
  • Dialog
  • AppInvite (Previously FBSDKAppInviteContent): Now a struct that uses a type-safe Promotion property instead of separate promotionCode and promotionText.
  • AppInvite.Dialog
Share this post
[social_warfare]
iOS SDK Classess and Protocols
SDK Installation and Configuration

Get industry recognized certification – Contact us

keyboard_arrow_up