Skip to main content

Settings Configuration

info

Settings Overview: This page covers all configuration settings available in the Teads SDK for iOS, organized by placement type and use case.

TeadsSDK

NameTypeField/MethodDescription
TeadsSDKVersionNumberDoubleFieldCurrent TeadsSDK Version number (read-only)
TeadsSDKVersionStringStringFieldCurrent TeadsSDK Version string in semver format (read-only)
configure(with partnerKey: String?)VoidMethodInitialize the Teads SDK. Call this in AppDelegate.didFinishLaunchingWithOptions to increase launch speed and load ads faster. Optional partner key for Outbrain integration.
createPlacement<PlacementType>(with config: PlacementType.Config, delegate: TeadsAdPlacementEventsDelegate?)PlacementTypeMethodGeneric method to create any placement type (Feed, Media, MediaNative, Recommendations) using their respective config objects.
createInReadPlacement(pid: Int, settings: TeadsAdPlacementSettings, delegate: TeadsInReadAdPlacementDelegate?)TeadsInReadAdPlacementMethodCreate a legacy inRead ad placement to request inRead ads. Returns TeadsInReadAdPlacement instance that must be owned/retained.
createNativePlacement(pid: Int, settings: TeadsAdPlacementSettings, delegate: TeadsNativeAdPlacementDelegate?)TeadsNativeAdPlacementMethodCreate a legacy native ad placement to request native ads. Returns TeadsNativeAdPlacement instance that must be owned/retained.
createPrebidPlacement(settings: TeadsAdPlacementSettings, delegate: TeadsInReadAdPlacementDelegate?)TeadsPrebidAdPlacementMethodCreate a legacy inRead ad placement to request load Prebid ad response. Returns TeadsPrebidAdPlacement instance that must be owned/retained.

TeadsAdPlacementMedia

ConfigurationTypeDescription
pidIntPublisher ID from your publisher manager
articleUrlURL?URL of the article where the ad will be displayed. Provides context for brand safety purposes
enableValidationModeBoolEnable the Validation Tool mode for testing and debugging ad placements

TeadsAdPlacementMediaNative

ConfigurationTypeDescription
pidIntPublisher ID from your publisher manager
articleUrlURL?URL of the article where the ad will be displayed. Provides context for brand safety purposes

TeadsAdPlacementFeed

NameTypeField/MethodDescription
articleUrlURLFieldURL of the article where the feed will be displayed
widgetIdStringFieldWidget identifier
installationKeyStringFieldInstallation key for your app
widgetIndexIntFieldIndex of the widget in the feed
userIdString?FieldOptional user identifier for personalization
darkModeBoolFieldEnable dark mode theme for the feed widget (default: false)
testDisplayBoolFieldEnable test display mode for debugging (default: false)
infiniteWidgetsOnTheSamePageBoolFieldAllow infinite widgets on the same page (default: false)
printLogs(domain: String?)VoidStatic MethodPrint logs for debugging purposes with optional domain filtering

TeadsAdPlacementRecommendations

NameTypeField/MethodDescription
articleUrlURLFieldURL of the article for which recommendations will be fetched
widgetIdStringFieldWidget identifier
widgetIndexIntFieldIndex of the widget (default: 0)
testLocationString?FieldTest location for Geo simulation (country code, e.g., "us")
testRTBBoolFieldEnable test RTB mode for debugging (default: false)
configureViewabilityPerListing(for: UIView, withRec: OBRecommendation)VoidStatic MethodConfigure viewability tracking for individual recommendation listings
getAboutURL()StringStatic MethodGet the ad choices URL
getUrl(_ rec: OBRecommendation)StringStatic MethodGet URL for a specific recommendation

TeadsAdapterSettings

NameTypeField/MethodDescription
enableDebug()VoidMethodEnable debug logging for Teads inApp SDK.
userConsent(subjectGdpr: String, consent: String, tcfVersion: TCFVersion, cmpSdkId: Int)VoidMethodThe GDPR consent and status, should match the IAB specifications.
setUsPrivacy(usPrivacy: String)VoidMethodThe CCPA consent string, should match the IAB specifications.
setGppConsent(consent: String, sectionIds: String)VoidMethodThe GPP consent and applicable section ids, should match the IAB specifications.
disableBatteryMonitoring()VoidMethodPrevent to automatically set UIDevice.current.isBatteryMonitoringEnabled.
disableCrashMonitoring()VoidMethodDisable crash monitoring that collects crashes on Teads SDK by default.
disableTeadsAudioSessionManagement()VoidMethodBy default, the Teads SDK handles the audio session by setting its category to ambient. This means that all the audio played by other apps will be simply mixed with the ad sound.
pageUrl(url: String)VoidMethodProvide context for brand safety purposes.
enableValidationMode()VoidMethodEnable the Validation Tool mode.
addExtras(String, for: String)VoidMethodAdd the given extra to your placement and request settings data.
registerAdView(UIView, delegate: TeadsMediatedAdViewDelegate)VoidMethodRegister the ad view in case of mediation adapter.
setMediaScale(_ mediaScale: MediaScale)VoidMethodSet how the MediaView fits on its container. Works for images only on inFeed native creatives.

MediaScale Enum Values

ValueDescription
MediaScale.scaleAspectFillContents scaled to fill with fixed aspect. Some portion of content may be clipped. Behaviour is similar to UIView.ContentMode.scaleToFill.
MediaScale.scaleAspectFitContents scaled to fit with fixed aspect. Remainder is transparent. Behaviour is similar to UIView.ContentMode.scaleAspectFit.

Audio Management

SettingDescriptionUse Case
disableTeadsAudioSessionManagement()Disable automatic audio session managementWhen you want to handle audio sessions manually
Default behaviorSDK sets audio session category to ambientAllows mixing with other app audio

Best Practices

Production Settings

  • Remove enableValidationMode() before production
  • Remove testing configurations in production builds
  • Ensure proper privacy consent is configured
  • Set appropriate url for brand safety
  • Use production placement IDs and installation keys

Testing Settings

  • Use enableValidationMode() for integration testing
  • Use testing configurations for development and debugging
  • Test with different privacy consent scenarios
  • Verify settings work across all placement types
  • Use test placement IDs and installation keys

Performance Optimization

  • Initialize SDK early in application lifecycle
  • Use appropriate placement lifecycle management
  • Monitor memory usage and performance