iOS SDK Version
FBAdSettings
Objective-C
@interfaceFBAdSettings:NSObject
Swift
classFBAdSettings:NSObject
AdSettings contains global settings for all ad controls.
- Controls support for audio-only video playback when the app is backgrounded. Note that this is only supported when using FBMediaViewVideoRenderer, and requires corresponding support for background audio to be added to the app. Default value is NO.
Declaration
Objective-C@property(class,nonatomic,assign,unsafe_unretained,readwrite,getter=isBackgroundVideoPlaybackAllowed)BOOLbackgroundVideoPlaybackAllowed;
SwiftclassvarisBackgroundVideoPlaybackAllowed:Bool{getset}
- When test mode is on, setting a non default value for testAdType will requests the specified type of ad.
Declaration
Objective-C@property(class,nonatomic)FBAdTestAdTypetestAdType;
SwiftclassvartestAdType:FBAdTestAdType{getset}
- When this delegate is set, logs will be redirected to the delegate instead of being logged directly to the console with NSLog. This can be used in combination with external logging frameworks.
Declaration
Objective-C@property(class,nonatomic,weak,nullable)id<FBAdLoggingDelegate>loggingDelegate;
SwiftweakclassvarloggingDelegate:FBAdLoggingDelegate?{getset}
- Generates bidder token that needs to be included in the server side bid request to Facebook endpoint.
Declaration
Objective-C@property(class,nonatomic,copy,readonly)NSString*_NonnullbidderToken;
SwiftclassvarbidderToken:String{get}
- Generates routing token needed for requests routing in reverse-proxy, since we don’t have cookies in app environments.
Declaration
Objective-C@property(class,nonatomic,copy,readonly)NSString*_NonnullroutingToken;
SwiftclassvarroutingToken:String{get}
- User’s consent for advertiser tracking.The setter API only works in iOS14 or above and won’t take effect in iOS13 or below.
Declaration
Objective-C+(void)setAdvertiserTrackingEnabled:(BOOL)advertiserTrackingEnabled;
SwiftclassfuncsetAdvertiserTrackingEnabled(_advertiserTrackingEnabled:Bool)
- Returns test mode on/off.
Declaration
Objective-C+(BOOL)isTestMode;
SwiftclassfuncisTestMode()->Bool
- Returns the hashid of the device to use test mode on.
Declaration
Objective-C+(nonnullNSString*)testDeviceHash;
SwiftclassfunctestDeviceHash()->String
- Adds a test device.Copy the current device Id from debug log and add it as a test device to get test ads. Apps running on emulator will automatically get test ads. Test devices should be added before loadAd is called.
Declaration
Objective-C+(void)addTestDevice:(nonnullNSString*)deviceHash;
SwiftclassfuncaddTestDevice(_deviceHash:String)
Parameters
- Add a collection of test devices. See
+addTestDevices:
for details.Declaration
Objective-C+(void)addTestDevices:(nonnullNSArray<NSString*>*)devicesHash;
SwiftclassfuncaddTestDevices(_devicesHash:[String])
Parameters
- Clear all the added test devices
Declaration
Objective-C+(void)clearTestDevices;
SwiftclassfuncclearTestDevices()
- Clears the added test device
Declaration
Objective-C+(void)clearTestDevice:(nonnullNSString*)deviceHash;
SwiftclassfuncclearTestDevice(_deviceHash:String)
Parameters
- DeprecatedisChildDirected method is no longer supported in Audience Network. Use +mixedAudience insteadConfigures the ad control for treatment as child-directed.Note that you may have other legal obligations under the Children’s Online Privacy Protection Act (COPPA). Please review the FTC’s guidance and consult with your own legal counsel.
Declaration
Objective-C+(void)setIsChildDirected:(BOOL)isChildDirected;
SwiftclassfuncsetIsChildDirected(_isChildDirected:Bool)
Parameters
- Configures the ad control for treatment as mixed audience directed. Information for Mixed Audience Apps and Services: https://developers.facebook.com/docs/audience-network/coppa
Declaration
Objective-C@property(class,nonatomic,assign,unsafe_unretained,readwrite,getter=isMixedAudience)BOOLmixedAudience;
SwiftclassvarisMixedAudience:Bool{getset}
- If an ad provided service is mediating Audience Network in their sdk, it is required to set the name of the mediation service
Declaration
Objective-C+(void)setMediationService:(nonnullNSString*)service;
SwiftclassfuncsetMediationService(_service:String)
Parameters
- Gets the url prefix to use when making ad requests.This method should never be used in production.
Declaration
Objective-C+(nullableNSString*)urlPrefix;
SwiftclassfuncurlPrefix()->String?
- Sets the url prefix to use when making ad requests.This method should never be used in production.
Declaration
Objective-C+(void)setUrlPrefix:(nullableNSString*)urlPrefix;
SwiftclassfuncsetUrlPrefix(_urlPrefix:String?)
- Gets the current SDK logging level
- Sets the current SDK logging level
Declaration
Objective-C+(void)setLogLevel:(FBAdLogLevel)level;
SwiftclassfuncsetLogLevel(_level:FBAdLogLevel)
- Data processing options. Please read more details at https://developers.facebook.com/docs/marketing-apis/data-processing-options
Declaration
Objective-C+(void)setDataProcessingOptions:(nonnullNSArray<NSString*>*)optionscountry:(NSInteger)countrystate:(NSInteger)state;
SwiftclassfuncsetDataProcessingOptions(_options:[String],country:Int,state:Int)
Parameters
- Data processing options. Please read more details at https://developers.facebook.com/docs/marketing-apis/data-processing-options
Declaration
Objective-C+(void)setDataProcessingOptions:(nonnullNSArray<NSString*>*)options;
SwiftclassfuncsetDataProcessingOptions(_options:[String])
Parameters