GoogleInteractiveMediaAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
IMASettings
@interface IMASettings : NSObject <NSCopying>
The IMASettings class stores SDK wide settings.
-
Publisher Provided Identification (PPID) sent with ads request.
Declaration
Swift
var ppid: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *ppid;
-
Language specification used for localization. |Language| must be formatted as
a canonicalized IETF BCP 47 language identifier such as would be returned by
[NSLocale preferredLanguages]. Setting this property after it has been sent
to the IMAAdsLoader will be ignored and a warning will be logged.
Declaration
Swift
var language: String { get set }
Objective-C
@property (nonatomic, copy) NSString *_Nonnull language;
-
Specifies maximum number of redirects after which subsequent redirects will
be denied, and the ad load aborted. The number of redirects directly affects
latency and thus user experience. This applies to all VAST wrapper ads. If
the number of redirects exceeds |maxRedirects|, the ad request will fail with
error code 302. The default value is 4.
Declaration
Swift
var maxRedirects: UInt { get set }
Objective-C
@property (nonatomic) NSUInteger maxRedirects;
-
Feature flags and their states. Used to control experimental features.
Declaration
Swift
var featureFlags: [String : String] { get set }
Objective-C
@property (nonatomic, copy) NSDictionary<NSString *, NSString *> *_Nonnull featureFlags;
-
Enable background audio playback for the SDK. The default value is NO.
Declaration
Swift
var enableBackgroundPlayback: Bool { get set }
Objective-C
@property (nonatomic) BOOL enableBackgroundPlayback;
-
Specifies whether to automatically play VMAP and ad rules ad breaks. The
default value is YES.
Declaration
Swift
var autoPlayAdBreaks: Bool { get set }
Objective-C
@property (nonatomic) BOOL autoPlayAdBreaks;
-
Specifies whether to update the MPNowPlayingInfoCenter content with the
title “Advertisement”. If disabled, MPNowPlayingInfoCenter is untouched.
The default value is NO.
Declaration
Swift
var disableNowPlayingInfo: Bool { get set }
Objective-C
@property (nonatomic) BOOL disableNowPlayingInfo;
-
The partner specified video player that is integrating with the SDK.
Declaration
Swift
var playerType: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *playerType;
-
The partner specified player version that is integrating with the SDK.
Declaration
Swift
var playerVersion: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *playerVersion;
-
The session ID to identify a single user session. This should be a UUID. It
is used exclusively for frequency capping across the user session.
Declaration
Swift
var sessionID: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *sessionID;
-
Controls whether Same App Key is enabled. The value set persists across app sessions. The key is
enabled by default.
Declaration
Swift
var sameAppKeyEnabled: Bool { get set }
Objective-C
@property (nonatomic) BOOL sameAppKeyEnabled;
-
Toggles debug mode which will output detailed log information to the console.
Debug mode should be disabled in Release and will display a watermark when
enabled. The default value is NO.
Declaration
Swift
var enableDebugMode: Bool { get set }
Objective-C
@property (nonatomic) BOOL enableDebugMode;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eIMASettings\u003c/code\u003e class provides SDK-wide configurations for ad requests and playback, affecting features like localization, redirects, and background audio.\u003c/p\u003e\n"],["\u003cp\u003ePublishers can customize settings for ad requests using properties like \u003ccode\u003eppid\u003c/code\u003e (Publisher Provided Identification), \u003ccode\u003elanguage\u003c/code\u003e, and \u003ccode\u003emaxRedirects\u003c/code\u003e to enhance ad targeting and user experience.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIMASettings\u003c/code\u003e class allows publishers to manage ad break behaviors (like autoplay), content information displayed during ads, and enables debug mode for detailed logging during development.\u003c/p\u003e\n"],["\u003cp\u003ePartners integrating with the IMA SDK can identify their players using \u003ccode\u003eplayerType\u003c/code\u003e and \u003ccode\u003eplayerVersion\u003c/code\u003e, allowing Google to collect insights into platform usage.\u003c/p\u003e\n"],["\u003cp\u003eThe SDK offers settings for frequency capping using \u003ccode\u003esessionID\u003c/code\u003e, a UUID for unique user sessions, and controls experimental features using \u003ccode\u003efeatureFlags\u003c/code\u003e for advanced configurations.\u003c/p\u003e\n"]]],[],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMASettings\n===========\n\n @interface IMASettings : NSObject \u003cNSCopying\u003e\n\nThe IMASettings class stores SDK wide settings.\n- `\n ``\n ``\n `\n\n ### [ppid](#/c:objc(cs)IMASettings(py)ppid)\n\n `\n ` \n Publisher Provided Identification (PPID) sent with ads request. \n\n #### Declaration\n\n Swift \n\n var ppid: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *ppid;\n\n- `\n ``\n ``\n `\n\n ### [language](#/c:objc(cs)IMASettings(py)language)\n\n `\n ` \n Language specification used for localization. \\|Language\\| must be formatted as\n a canonicalized IETF BCP 47 language identifier such as would be returned by\n \\[NSLocale preferredLanguages\\]. Setting this property after it has been sent\n to the IMAAdsLoader will be ignored and a warning will be logged. \n\n #### Declaration\n\n Swift \n\n var language: String { get set }\n\n Objective-C \n\n @property (nonatomic, copy) NSString *_Nonnull language;\n\n- `\n ``\n ``\n `\n\n ### [maxRedirects](#/c:objc(cs)IMASettings(py)maxRedirects)\n\n `\n ` \n Specifies maximum number of redirects after which subsequent redirects will\n be denied, and the ad load aborted. The number of redirects directly affects\n latency and thus user experience. This applies to all VAST wrapper ads. If\n the number of redirects exceeds \\|maxRedirects\\|, the ad request will fail with\n error code 302. The default value is 4. \n\n #### Declaration\n\n Swift \n\n var maxRedirects: UInt { get set }\n\n Objective-C \n\n @property (nonatomic) NSUInteger maxRedirects;\n\n- `\n ``\n ``\n `\n\n ### [featureFlags](#/c:objc(cs)IMASettings(py)featureFlags)\n\n `\n ` \n Feature flags and their states. Used to control experimental features. \n\n #### Declaration\n\n Swift \n\n var featureFlags: [String : String] { get set }\n\n Objective-C \n\n @property (nonatomic, copy) NSDictionary\u003cNSString *, NSString *\u003e *_Nonnull featureFlags;\n\n- `\n ``\n ``\n `\n\n ### [enableBackgroundPlayback](#/c:objc(cs)IMASettings(py)enableBackgroundPlayback)\n\n `\n ` \n Enable background audio playback for the SDK. The default value is NO. \n\n #### Declaration\n\n Swift \n\n var enableBackgroundPlayback: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL enableBackgroundPlayback;\n\n- `\n ``\n ``\n `\n\n ### [autoPlayAdBreaks](#/c:objc(cs)IMASettings(py)autoPlayAdBreaks)\n\n `\n ` \n Specifies whether to automatically play VMAP and ad rules ad breaks. The\n default value is YES. \n\n #### Declaration\n\n Swift \n\n var autoPlayAdBreaks: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL autoPlayAdBreaks;\n\n- `\n ``\n ``\n `\n\n ### [disableNowPlayingInfo](#/c:objc(cs)IMASettings(py)disableNowPlayingInfo)\n\n `\n ` \n Specifies whether to update the MPNowPlayingInfoCenter content with the\n title \"Advertisement\". If disabled, MPNowPlayingInfoCenter is untouched.\n The default value is NO. \n\n #### Declaration\n\n Swift \n\n var disableNowPlayingInfo: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL disableNowPlayingInfo;\n\n- `\n ``\n ``\n `\n\n ### [playerType](#/c:objc(cs)IMASettings(py)playerType)\n\n `\n ` \n The partner specified video player that is integrating with the SDK. \n\n #### Declaration\n\n Swift \n\n var playerType: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *playerType;\n\n- `\n ``\n ``\n `\n\n ### [playerVersion](#/c:objc(cs)IMASettings(py)playerVersion)\n\n `\n ` \n The partner specified player version that is integrating with the SDK. \n\n #### Declaration\n\n Swift \n\n var playerVersion: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *playerVersion;\n\n- `\n ``\n ``\n `\n\n ### [sessionID](#/c:objc(cs)IMASettings(py)sessionID)\n\n `\n ` \n The session ID to identify a single user session. This should be a UUID. It\n is used exclusively for frequency capping across the user session. \n\n #### Declaration\n\n Swift \n\n var sessionID: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *sessionID;\n\n- `\n ``\n ``\n `\n\n ### [sameAppKeyEnabled](#/c:objc(cs)IMASettings(py)sameAppKeyEnabled)\n\n `\n ` \n Controls whether Same App Key is enabled. The value set persists across app sessions. The key is\n enabled by default. \n\n #### Declaration\n\n Swift \n\n var sameAppKeyEnabled: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL sameAppKeyEnabled;\n\n- `\n ``\n ``\n `\n\n ### [enableDebugMode](#/c:objc(cs)IMASettings(py)enableDebugMode)\n\n `\n ` \n Toggles debug mode which will output detailed log information to the console.\n Debug mode should be disabled in Release and will display a watermark when\n enabled. The default value is NO. \n\n #### Declaration\n\n Swift \n\n var enableDebugMode: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL enableDebugMode;"]]