iOS SDK Version

Classes

The following classes are available globally.
  • Represents an immutable access token for using Facebook services.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAccessToken:NSObject<FBSDKCopying,NSSecureCoding>
    Swift
    classAccessToken:NSObject,Copying,NSSecureCoding
  • The FBSDKApplicationDelegate is designed to post process the results from Facebook Login or Facebook Dialogs (or any action that requires switching over to the native Facebook app or Safari).
    The methods in this class are designed to mirror those in UIApplicationDelegate, and you should call them in the respective methods in your AppDelegate implementation.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKApplicationDelegate:NSObject
    Swift
    classApplicationDelegate:NSObject
  • A base class for common SDK buttons.

    Declaration

    Objective-C
    @interfaceFBSDKButton:UIButton
    Swift
    classFBButton:UIButton
  • Undocumented

    Declaration

    Objective-C
    @interfaceFBSDKMeasurementEvent:NSObject@end
    Swift
    classMeasurementEvent:NSObject
  • Represents an immutable Facebook profile
    This class provides a global “currentProfile” instance to more easily add social context to your application. When the profile changes, a notification is posted so that you can update relevant parts of your UI and is persisted to NSUserDefaults.
    Typically, you will want to call enableUpdatesOnAccessTokenChange:YES so that it automatically observes changes to the [FBSDKAccessToken currentAccessToken].
    You can use this class to build your own FBSDKProfilePictureView or in place of typical requests to “/me”.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKProfile:NSObject<NSCopying,NSSecureCoding>
    Swift
    classProfile:NSObject,NSCopying,NSSecureCoding
  • A view to display a profile picture.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKProfilePictureView:UIView
    Swift
    classFBProfilePictureView:UIView
  • Undocumented
    See more

    Declaration

    Objective-C
    @interfaceFBSDKSettings:NSObject-(instancetype)initNS_UNAVAILABLE;+(instancetype)newNS_UNAVAILABLE;/** Retrieve the current iOS SDK version. */@property(class,nonatomic,copy,readonly)NSString*sdkVersion;/** Retrieve the current default Graph API version. */@property(class,nonatomic,copy,readonly)NSString*defaultGraphAPIVersion;/** The quality of JPEG images sent to Facebook from the SDK, expressed as a value from 0.0 to 1.0. If not explicitly set, the default is 0.9. @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */@property(class,nonatomic,assign)CGFloatJPEGCompressionQualityNS_SWIFT_NAME(jpegCompressionQuality);/** Controls sdk auto initailization. If not explicitly set, the default is true */@property(class,nonatomic,assign,getter=isAutoInitEnabled)BOOLautoInitEnabled;/** Controls the auto logging of basic app events, such as activateApp and deactivateApp. If not explicitly set, the default is true */@property(class,nonatomic,assign,getter=isAutoLogAppEventsEnabled)BOOLautoLogAppEventsEnabled;/** Controls the fb_codeless_debug logging event If not explicitly set, the default is true */@property(class,nonatomic,assign,getter=isCodelessDebugLogEnabled)BOOLcodelessDebugLogEnabled;/** Controls the fb_codeless_debug logging event If not explicitly set, the default is true */@property(class,nonatomic,assign,getter=isAdvertiserIDCollectionEnabled)BOOLadvertiserIDCollectionEnabled;/** Whether data such as that generated through FBSDKAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. */@property(class,nonatomic,assign,getter=shouldLimitEventAndDataUsage)BOOLlimitEventAndDataUsage;/** A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set. */@property(class,nonatomic,assign,getter=isGraphErrorRecoveryEnabled)BOOLgraphErrorRecoveryEnabled;/** The Facebook App ID used by the SDK. If not explicitly set, the default will be read from the application's plist (FacebookAppID). */@property(class,nonatomic,copy,nullable)NSString*appID;/** The default url scheme suffix used for sessions. If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix). */@property(class,nonatomic,copy,nullable)NSString*appURLSchemeSuffix;/** The Client Token that has been set via [FBSDKSettings setClientToken]. This is needed for certain API calls when made anonymously, without a user-based access token. The Facebook App's "client token", which, for a given appid can be found in the Security section of the Advanced tab of the Facebook App settings found at <https://developers.facebook.com/apps/[your-app-id]> If not explicitly set, the default will be read from the application's plist (FacebookClientToken). */@property(class,nonatomic,copy,nullable)NSString*clientToken;/** The Facebook Display Name used by the SDK. This should match the Display Name that has been set for the app with the corresponding Facebook App ID, in the Facebook App Dashboard. If not explicitly set, the default will be read from the application's plist (FacebookDisplayName). */@property(class,nonatomic,copy,nullable)NSString*displayName;/** The Facebook domain part. This can be used to change the Facebook domain (e.g. @"beta") so that requests will be sent to `graph.beta.facebook.com` If not explicitly set, the default will be read from the application's plist (FacebookDomainPart). */@property(class,nonatomic,copy,nullable)NSString*facebookDomainPart;/** The current Facebook SDK logging behavior. This should consist of strings defined as constants with FBSDKLoggingBehavior*. This should consist a set of strings indicating what information should be logged defined as constants with FBSDKLoggingBehavior*. Set to an empty set in order to disable all logging. You can also define this via an array in your app plist with key "FacebookLoggingBehavior" or add and remove individual values via enableLoggingBehavior: or disableLogginBehavior: The default is a set consisting of FBSDKLoggingBehaviorDeveloperErrors */@property(class,nonatomic,copy)NSSet<FBSDKLoggingBehavior>*loggingBehaviorsNS_REFINED_FOR_SWIFT;/** Overrides the default Graph API version to use with `FBSDKGraphRequests`. This overrides `FBSDK_TARGET_PLATFORM_VERSION`. The string should be of the form `@"v2.7"`. Defaults to `FBSDK_TARGET_PLATFORM_VERSION`. */@property(class,nonatomic,copy,null_resettable)NSString*graphAPIVersion;/** Set the data processing options. @param options list of options */+(void)setDataProcessingOptions:(nullableNSArray<NSString*>*)options;/** Set the data processing options. @param options list of the options @param country code of the country @param state code of the state */+(void)setDataProcessingOptions:(nullableNSArray<NSString*>*)optionscountry:(int)countrystate:(int)state;/** Enable a particular Facebook SDK logging behavior. @param loggingBehavior The LoggingBehavior to enable. This should be a string defined as a constant with FBSDKLoggingBehavior*. */+(void)enableLoggingBehavior:(FBSDKLoggingBehavior)loggingBehavior;/** Disable a particular Facebook SDK logging behavior. @param loggingBehavior The LoggingBehavior to disable. This should be a string defined as a constant with FBSDKLoggingBehavior*. */+(void)disableLoggingBehavior:(FBSDKLoggingBehavior)loggingBehavior;@end
    Swift
    classSettings:NSObject
  • Provides methods for managing test accounts for testing Facebook integration.
    Facebook allows developers to create test accounts for testing their applications’ Facebook integration (see https://developers.facebook.com/docs/test_users/). This class simplifies use of these accounts for writing tests. It is not designed for use in production application code.
    This class will make Graph API calls on behalf of your app to manage test accounts and requires an app id and app secret. You will typically use this class to write unit or integration tests. Make sure you NEVER include your app secret in your production app.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKTestUsersManager:NSObject
    Swift
    classTestUsersManager:NSObject
  • Provides a set of utilities for working with NSURLs, such as parsing of query parameters and handling for App Link requests.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKURL:NSObject
    Swift
    classAppLinkURL:NSObject
  • Class to contain common utility methods.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKUtility:NSObject
    Swift
    classUtility:NSObject
  • A model for creating an app group.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppGroupContent:NSObject<FBSDKCopying,NSSecureCoding>
    Swift
    classAppGroupContent:NSObject,Copying,NSSecureCoding
  • A model for app invite.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppInviteContent:NSObject<FBSDKCopying,FBSDKSharingValidation,NSSecureCoding>
    Swift
    classAppInviteContent:NSObject,Copying,SharingValidation,NSSecureCoding
  • A container of arguments for a camera effect. An argument is a NSString identified by a NSString key.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKCameraEffectArguments:NSObject<FBSDKCopying,NSSecureCoding>
    Swift
    classCameraEffectArguments:NSObject,Copying,NSSecureCoding
  • A container of textures for a camera effect. A texture for a camera effect is an UIImages identified by a NSString key.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKCameraEffectTextures:NSObject<FBSDKCopying,NSSecureCoding>
    Swift
    classCameraEffectTextures:NSObject,Copying,NSSecureCoding
  • A model for a game request.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKGameRequestContent:NSObject<FBSDKCopying,FBSDKSharingValidation,NSSecureCoding>
    Swift
    classGameRequestContent:NSObject,Copying,SharingValidation,NSSecureCoding
  • A dialog for sending game requests.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKGameRequestDialog:NSObject
    Swift
    classGameRequestDialog:NSObject
  • Represents a single hashtag that can be used with the share dialog.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKHashtag:NSObject<FBSDKCopying,NSSecureCoding>
    Swift
    classHashtag:NSObject,Copying,NSSecureCoding
  • A dialog for sharing content through Messenger.
    SUPPORTED SHARE TYPES
    • FBSDKShareLinkContent
    UNSUPPORTED SHARE TYPES (DEPRECATED AUGUST 2018)
    • FBSDKShareOpenGraphContent
    • FBSDKSharePhotoContent
    • FBSDKShareVideoContent
    • FBSDKShareMessengerOpenGraphMusicTemplateContent
    • FBSDKShareMessengerMediaTemplateContent
    • FBSDKShareMessengerGenericTemplateContent
    • Any other types that are not one of the four supported types listed above
    See more

    Declaration

    Objective-C
    @interfaceFBSDKMessageDialog:NSObject<FBSDKSharingDialog>
    Swift
    classMessageDialog:NSObject,SharingDialog
  • A button to send content through Messenger.
    Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot be shown, the button will be disable.

    Declaration

    Objective-C
    @interfaceFBSDKSendButton:FBSDKButton<FBSDKSharingButton>
    Swift
    classFBSendButton:FBButton,SharingButton
  • A button to share content.
    Tapping the receiver will invoke the FBSDKShareDialog with the attached shareContent. If the dialog cannot be shown, the button will be disabled.

    Declaration

    Objective-C
    @interfaceFBSDKShareButton:FBSDKButton<FBSDKSharingButton>
    Swift
    classFBShareButton:FBButton,SharingButton
  • A model for content to share with a Facebook camera effect.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKShareCameraEffectContent:NSObject<FBSDKSharingContent,FBSDKSharingScheme>
    Swift
    classShareCameraEffectContent:NSObject,SharingContent,SharingScheme
  • A dialog for sharing content on Facebook.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKShareDialog:NSObject<FBSDKSharingDialog>
    Swift
    classShareDialog:NSObject,SharingDialog
  • A model for status and link content to be shared.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKShareLinkContent:NSObject<FBSDKSharingContent>
    Swift
    classShareLinkContent:NSObject,SharingContent
  • A model for media content (photo or video) to be shared.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKShareMediaContent:NSObject<FBSDKSharingContent>
    Swift
    classShareMediaContent:NSObject,SharingContent
  • A photo for sharing.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKSharePhoto:NSObject<NSSecureCoding,FBSDKCopying,FBSDKShareMedia,FBSDKSharingValidation>
    Swift
    classSharePhoto:NSObject,NSSecureCoding,Copying,ShareMedia,SharingValidation
  • A model for photo content to be shared.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKSharePhotoContent:NSObject<FBSDKSharingContent>
    Swift
    classSharePhotoContent:NSObject,SharingContent
  • A video for sharing.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKShareVideo:NSObject<NSSecureCoding,FBSDKCopying,FBSDKShareMedia,FBSDKSharingValidation>
    Swift
    classShareVideo:NSObject,NSSecureCoding,Copying,ShareMedia,SharingValidation
  • A model for video content to be shared.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKShareVideoContent:NSObject<FBSDKSharingContent>
    Swift
    classShareVideoContent:NSObject,SharingContent
  • Client-side event logging for specialized application analytics available through Facebook App Insights and for use with Facebook Ads conversion tracking and optimization.
    The FBSDKAppEvents static class has a few related roles:
    • Logging predefined and application-defined events to Facebook App Insights with a numeric value to sum across a large number of events, and an optional set of key/value parameters that define “segments” for this event (e.g., ‘purchaserStatus’ : ‘frequent’, or ‘gamerLevel’ : ‘intermediate’)
    • Logging events to later be used for ads optimization around lifetime value.
    • Methods that control the way in which events are flushed out to the Facebook servers.
    Here are some important characteristics of the logging mechanism provided by FBSDKAppEvents:
    • Events are not sent immediately when logged. They’re cached and flushed out to the Facebook servers in a number of situations:
    • when an event count threshold is passed (currently 100 logged events).
    • when a time threshold is passed (currently 15 seconds).
    • when an app has gone to background and is then brought back to the foreground.
    • Events will be accumulated when the app is in a disconnected state, and sent when the connection is restored and one of the above ‘flush’ conditions are met.
    • The FBSDKAppEvents class is thread-safe in that events may be logged from any of the app’s threads.
    • The developer can set the flushBehavior on FBSDKAppEvents to force the flushing of events to only occur on an explicit call to the flush method.
    • The developer can turn on console debug output for event logging and flushing to the server by using the FBSDKLoggingBehaviorAppEvents value in [FBSettings setLoggingBehavior:].
    Some things to note when logging events:
    • There is a limit on the number of unique event names an app can use, on the order of 1000.
    • There is a limit to the number of unique parameter names in the provided parameters that can be used per event, on the order of 25. This is not just for an individual call, but for all invocations for that eventName.
    • Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and must consist of alphanumeric characters, _, -, or spaces.
    • The length of each parameter value can be no more than on the order of 100 characters.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppEvents:NSObject
    Swift
    classAppEvents:NSObject
  • Contains App Link metadata relevant for navigation on this device derived from the HTML at a given URL.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLink:NSObject
    Swift
    classAppLink:NSObject
  • Represents a pending request to navigate to an App Link. Most developers will simply use navigateToURLInBackground: to open a URL, but developers can build custom requests with additional navigation and app data attached to them by creating FBSDKAppLinkNavigations themselves.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLinkNavigation:NSObject
    Swift
    classAppLinkNavigation:NSObject
  • Provides an implementation of the FBSDKAppLinkResolving protocol that uses the Facebook App Link Index API to resolve App Links given a URL. It also provides an additional helper method that can resolve multiple App Links in a single call.
    Usage of this type requires a client token. See [FBSDKSettings setClientToken:]
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLinkResolver:NSObject<FBSDKAppLinkResolving>
    Swift
    classAppLinkResolver:NSObject,AppLinkResolving
  • A controller class that implements default behavior for a FBSDKAppLinkReturnToRefererView, including the ability to display the view above the navigation bar for navigation-based apps.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLinkReturnToRefererController:NSObject<FBSDKAppLinkReturnToRefererViewDelegate>
    Swift
    classAppLinkReturnToRefererController:NSObject,AppLinkReturnToRefererViewDelegate
  • Provides a UIView that displays a button allowing users to navigate back to the application that launched the App Link currently being handled, if the App Link contained referer data. The user can also close the view by clicking a close button rather than navigating away. If the view is provided an App Link that does not contain referer data, it will have zero size and no UI will be displayed.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLinkReturnToRefererView:UIView
    Swift
    classFBAppLinkReturnToRefererView:UIView
  • Represents a target defined in App Link metadata, consisting of at least a URL, and optionally an App Store ID and name.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLinkTarget:NSObject
    Swift
    classAppLinkTarget:NSObject
  • Class containing App Links related utility methods.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKAppLinkUtility:NSObject
    Swift
    classAppLinkUtility:NSObject
  • Defines a type that can process Facebook NSErrors with best practices.
    Facebook NSErrors can contain FBSDKErrorRecoveryAttempting instances to recover from errors, or localized messages to present to the user. This class will process the instances as follows:
    1. If the error is temporary as indicated by FBSDKGraphRequestErrorKey, assume the recovery succeeded and notify the delegate.
    2. If a FBSDKErrorRecoveryAttempting instance is available, display an alert (dispatched to main thread) with the recovery options and call the instance’s [ attemptRecoveryFromError:optionIndex:…].
    3. If a FBSDKErrorRecoveryAttempting is not available, check the userInfo for FBSDKLocalizedErrorDescriptionKey and present that in an alert (dispatched to main thread).
    By default, FBSDKGraphRequests use this type to process errors and retry the request upon a successful recovery.
    Note that Facebook recovery attempters can present UI or even cause app switches (such as to login). Any such work is dispatched to the main thread (therefore your request handlers may then run on the main thread).
    Login recovery requires FBSDKLoginKit. Login will prompt the user for all permissions last granted. If any are declined on the new request, the recovery is not successful but the [FBSDKAccessToken currentAccessToken] might still have been updated. .
    See more

    Declaration

    Objective-C
    @interfaceFBSDKGraphErrorRecoveryProcessor:NSObject
  • Represents a request to the Facebook Graph API.
    FBSDKGraphRequest encapsulates the components of a request (the Graph API path, the parameters, error recovery behavior) and should be used in conjunction with FBSDKGraphRequestConnection to issue the request.
    Nearly all Graph APIs require an access token. Unless specified, the [FBSDKAccessToken currentAccessToken] is used. Therefore, most requests will require login first (see FBSDKLoginManager in FBSDKLoginKit.framework).
    A - start method is provided for convenience for single requests.
    By default, FBSDKGraphRequest will attempt to recover any errors returned from Facebook. You can disable this via disableErrorRecovery:.
    See
    FBSDKGraphErrorRecoveryProcessor
    See more

    Declaration

    Objective-C
    @interfaceFBSDKGraphRequest:NSObject
    Swift
    classGraphRequest:NSObject
  • The FBSDKGraphRequestConnection represents a single connection to Facebook to service a request.
    The request settings are encapsulated in a reusable
    object. The FBSDKGraphRequestConnection object encapsulates the concerns of a single communication e.g. starting a connection, canceling a connection, or batching requests.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKGraphRequestConnection:NSObject
    Swift
    classGraphRequestConnection:NSObject
  • A container class for data attachments so that additional metadata can be provided about the attachment.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKGraphRequestDataAttachment:NSObject
    Swift
    classGraphRequestDataAttachment:NSObject
  • A reference implementation for an App Link resolver that uses a hidden WKWebView to parse the HTML containing App Link metadata.
    See more

    Declaration

    Objective-C
    @interfaceFBSDKWebViewAppLinkResolver:NSObject<FBSDKAppLinkResolving>
    Swift
    classWebViewAppLinkResolver:NSObject,AppLinkResolving