AI-generated Key Takeaways
-
The
IMACompanionDelegate
protocol enables you to handle events from companion ad slots, like when an ad successfully fills the slot or when a user clicks on it. -
This delegate provides two optional methods:
companionSlot:filled:
which indicates whether a companion ad slot was filled, andcompanionSlotWasClicked:
which is triggered when a user clicks on a companion ad. -
Both methods receive the
IMACompanionAdSlot
object as a parameter, allowing you to identify the specific ad slot involved in the event.
IMACompanionDelegate
@protocol IMACompanionDelegate <NSObject>
Delegate to receive events from the companion ad slot.
-
Called when the slot is either filled or not filled.
Declaration
Swift
optional func companionSlot(_ slot: IMACompanionAdSlot, filled: Bool)
Objective-C
- (void)companionSlot:(nonnull IMACompanionAdSlot *)slot filled:(BOOL)filled;
Parameters
slot
the IMACompanionAdSlot receiving the event
filled
is the slot filled or not
-
Called when the slot is clicked on by the user and will successfully navigate away.
Declaration
Swift
optional func companionSlotWasClicked(_ slot: IMACompanionAdSlot)
Objective-C
- (void)companionSlotWasClicked:(nonnull IMACompanionAdSlot *)slot;
Parameters
slot
the IMACompanionAdSlot receiving the event