GoogleInteractiveMediaAds Framework Reference

  • IMAStreamRequest is a data class that describes a stream request.

  • The network code is required for some stream request types and optional for others, used for applying Ad Manager settings and locating/playing the stream.

  • The stream request includes properties for the ad display container and the video display.

  • Authentication for the stream request can be done using either an API key or an authorization token.

  • Various optional parameters can be included in the stream request, such as a stream activity monitor ID, ad tag parameters, manifest URL suffix, content URL, secure signals, and user context.

IMAStreamRequest

@interface IMAStreamRequest : NSObject

Data class describing the stream request.

  • The network code for the publisher making this stream request. Network codes are required for Pod serving stream requests (made with IMAPodStreamRequest or IMAPodVODStreamRequest) and Cloud stitching stream requests (IMAVideoStitcherLiveStreamRequest or IMAVideoStitcherVODStreamRequest) and are optional but recommended for Full service stream requests (IMALiveStreamRequest or IMAVODStreamRequest). The code is used to apply settings selected in the Ad Manager UI such as programmatic limited ads enablement. For Pod serving and Cloud stitching it is also used to locate and play the stream. To find the network code, see this article.

    Declaration

    Swift

    var networkCode: String? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *networkCode;
  • The stream display container for displaying the ad UI.

    Declaration

    Swift

    var adDisplayContainer: IMAAdDisplayContainer { get }

    Objective-C

    @property (nonatomic, readonly) IMAAdDisplayContainer *_Nonnull adDisplayContainer;
  • The video display where the stream can be played.

    Declaration

    Swift

    var videoDisplay: any IMAVideoDisplay { get }

    Objective-C

    @property (nonatomic, readonly) id<IMAVideoDisplay> _Nonnull videoDisplay;
  • The stream request API key. It’s configured through the DFP Admin UI and provided to the publisher to unlock their content. It verifies the applications that are attempting to access the content.

    Declaration

    Swift

    var apiKey: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *apiKey;
  • The stream request authorization token. This is used in place of the API key for stricter content authorization. The publisher can control individual content streams authorized based on this token.

    Declaration

    Swift

    var authToken: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *authToken;
  • The ID to be used to debug the stream with the stream activity monitor. This is used to provide a convenient way to allow publishers to find a stream log in the stream activity monitor tool.

    Declaration

    Swift

    var streamActivityMonitorID: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *streamActivityMonitorID;
  • You can override a limited set of ad tag parameters on your stream request. Supply targeting parameters to your stream provides more information.

    You can use the dai-ot and dai-ov parameters for stream variant preference. See Override Stream Variant Parameters for more information.

    Declaration

    Swift

    var adTagParameters: [String : String]? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSDictionary<NSString *, NSString *> *adTagParameters;
  • The suffix that the SDK will append to the query of the stream manifest URL. Do not include the ‘?’ separator at the start. The SDK will account for the existence of parameters in the URL already, removing existing ones that collide with ones supplied here. This suffix needs to be sanitized and encoded as the SDK will not do this.

    Declaration

    Swift

    var manifestURLSuffix: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *manifestURLSuffix;
  • Specifies the universal link to the content’s screen. If provided, this parameter is passed to the OM SDK. See Apple documentation for more information.

    Declaration

    Swift

    var contentURL: URL? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSURL *contentURL;
  • Specifies the Secure Signal with custom data for this stream request. Secure Signal with custom data is an encrypted blob containing signals collected by the publisher and previously agreed upon by the publisher and bidder. The Secure Signal with custom data can be cleared out by passing null to this function.

    Declaration

    Swift

    var secureSignals: IMASecureSignals? { get set }

    Objective-C

    @property (nonatomic, strong, nullable) IMASecureSignals *secureSignals;
  • The user context.

    Declaration

    Swift

    var userContext: Any? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) id userContext;