GoogleInteractiveMediaAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
IMAFriendlyObstruction
@interface IMAFriendlyObstruction : NSObject
An obstruction that is marked as “friendly” for viewability measurement purposes.
-
The view causing the obstruction.
Declaration
Swift
var view: UIView { get }
Objective-C
@property (nonatomic, readonly) UIView *_Nonnull view;
-
The purpose for registering the obstruction as friendly.
-
Optional, detailed reasoning for registering this obstruction as friendly.
If the detailedReason
is not null, it must follow the IAB
standard by being 50 characters or less and only containing characters
A-z
, 0-9
, or spaces.
Declaration
Swift
var detailedReason: String? { get }
Objective-C
@property (nonatomic, readonly, nullable) NSString *detailedReason;
-
Initializes a friendly obstruction.
Declaration
Objective-C
- (nonnull instancetype)initWithView:(nonnull UIView *)view
purpose:(IMAFriendlyObstructionPurpose)purpose
detailedReason:(nullable NSString *)detailedReason;
Parameters
view
|
The view causing the obstruction.
|
purpose
|
The purpose for registering the obstruction as friendly.
|
detailedReason
|
Optional, detailed reasoning for registering this obstruction as friendly.
|
Return Value
A new IMAFriendlyObstruction instance
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 2024-08-21 UTC.
[null,null,["Last updated 2024-08-21 UTC."],[[["\u003cp\u003e\u003ccode\u003eIMAFriendlyObstruction\u003c/code\u003e allows marking specific views as "friendly" for viewability measurement, ensuring they don't negatively impact ad metrics.\u003c/p\u003e\n"],["\u003cp\u003eIt requires specifying the obstructing \u003ccode\u003eview\u003c/code\u003e, the \u003ccode\u003epurpose\u003c/code\u003e of the obstruction (e.g., for navigation or content), and an optional \u003ccode\u003edetailedReason\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edetailedReason\u003c/code\u003e, if provided, must adhere to IAB standards: 50 characters or less, containing only \u003ccode\u003eA-z\u003c/code\u003e, \u003ccode\u003e0-9\u003c/code\u003e, or spaces.\u003c/p\u003e\n"],["\u003cp\u003eInitialized with \u003ccode\u003einitWithView:purpose:detailedReason:\u003c/code\u003e, taking the obstructing view, purpose, and optional detailed reason as parameters.\u003c/p\u003e\n"]]],[],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMAFriendlyObstruction\n======================\n\n @interface IMAFriendlyObstruction : NSObject\n\nAn obstruction that is marked as \"friendly\" for viewability measurement purposes.\n- `\n ``\n ``\n `\n\n ### [view](#/c:objc(cs)IMAFriendlyObstruction(py)view)\n\n `\n ` \n The view causing the obstruction. \n\n #### Declaration\n\n Swift \n\n var view: UIView { get }\n\n Objective-C \n\n @property (nonatomic, readonly) UIView *_Nonnull view;\n\n- `\n ``\n ``\n `\n\n ### [purpose](#/c:objc(cs)IMAFriendlyObstruction(py)purpose)\n\n `\n ` \n The purpose for registering the obstruction as friendly. \n\n #### Declaration\n\n Swift \n\n var purpose: ../Enums/IMAFriendlyObstructionPurpose.html { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Enums/IMAFriendlyObstructionPurpose.html purpose;\n\n- `\n ``\n ``\n `\n\n ### [detailedReason](#/c:objc(cs)IMAFriendlyObstruction(py)detailedReason)\n\n `\n ` \n Optional, detailed reasoning for registering this obstruction as friendly.\n If the `detailedReason` is not null, it must follow the IAB\n standard by being 50 characters or less and only containing characters\n `A-z`, `0-9`, or spaces. \n\n #### Declaration\n\n Swift \n\n var detailedReason: String? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) NSString *detailedReason;\n\n- `\n ``\n ``\n `\n\n ### [-initWithView:purpose:detailedReason:](#/c:objc(cs)IMAFriendlyObstruction(im)initWithView:purpose:detailedReason:)\n\n `\n ` \n Initializes a friendly obstruction. \n\n #### Declaration\n\n Swift \n\n init(view: UIView, purpose: ../Enums/IMAFriendlyObstructionPurpose.html, detailedReason: String?)\n\n Objective-C \n\n - (nonnull instancetype)initWithView:(nonnull UIView *)view\n purpose:(../Enums/IMAFriendlyObstructionPurpose.html)purpose\n detailedReason:(nullable NSString *)detailedReason;\n\n #### Parameters\n\n |------------------------|----------------------------------------------------------------------------|\n | ` `*view*` ` | The view causing the obstruction. |\n | ` `*purpose*` ` | The purpose for registering the obstruction as friendly. |\n | ` `*detailedReason*` ` | Optional, detailed reasoning for registering this obstruction as friendly. |\n\n #### Return Value\n\n A new IMAFriendlyObstruction instance"]]