Overview
Settings exposes the configuration options that control how the SDK behaves throughout your app. Most properties read their default values from your Info.plist, but you can override any of them in code before calling ApplicationDelegate.shared.application(_:didFinishLaunchingWithOptions:).
| Module | FacebookCore |
| Objective-C name | FBSDKSettings |
| Availability | iOS 12+ |
Singleton
The shared settings instance. Prefer instance methods on this object over type-level properties and methods.
Identity properties
Your Facebook App ID. The SDK reads this automatically from the
FacebookAppID key in your Info.plist. You can override it in code before the SDK initializes.Info.plist key: FacebookAppIDThe client token for your Facebook app, used for anonymous API calls made without a user access token. Find it in the Facebook Developer Dashboard under Settings → Advanced → Security.Info.plist key:
FacebookClientTokenThe display name for your app. This should match the name set in the Facebook App Dashboard.Info.plist key:
FacebookDisplayNameThe URL scheme suffix used to differentiate multiple Facebook apps on the same device. Only set this if your app uses a custom URL scheme suffix.Info.plist key:
FacebookUrlSchemeSuffixData collection properties
Controls whether the SDK automatically logs basic app events such as app installs and app launches. Defaults to
true. Set to false and then back to true after you have received user consent.Info.plist key: FacebookAutoLogAppEventsEnabledControls whether the SDK reads the device Advertiser ID (IDFA). Defaults to
true. Disable this if you do not use the IDFA for advertising.Info.plist key: FacebookAdvertiserIDCollectionEnabledReflects the advertiser tracking status of data sent to Facebook. On iOS 17+, this value is determined by
ATTrackingManager.trackingAuthorizationStatus and cannot be set manually.Logging properties
The set of active logging behaviors. The default set contains only
.developerErrors. Set this to an empty set to disable all logging.You can also configure this via the FacebookLoggingBehavior array key in your Info.plist.Common values:| Value | Description |
|---|---|
.developerErrors | Logs SDK usage errors. Enabled by default. |
.networkRequests | Logs all Graph API requests and responses. |
.graphAPIDebugInfo | Includes debug info from the Graph API. |
.graphAPIDebugWarning | Includes debug warnings from the Graph API. |
.appEvents | Logs app event activity. |
.informational | General SDK informational messages. |
The version string of the Facebook SDK currently in use. Read-only.
Logging methods
enableLoggingBehavior(_:)
Adds a single logging behavior to the active set.
The behavior to enable, such as
.networkRequests or .appEvents.disableLoggingBehavior(_:)
Removes a single logging behavior from the active set.
The behavior to disable.
setDataProcessingOptions(_:)
Sets data processing options, for example to enable Limited Data Use (LDU) mode.
An array of processing option strings, or
nil to clear all options. Pass ["LDU"] to enable Limited Data Use.setDataProcessingOptions(_:country:state:)
Sets data processing options with an explicit country and state code.
An array of processing option strings, or
nil to clear.The numeric country code.
The numeric state code.