AdCompanionViewDelegate
@objc(AASDKAdCompanionViewDelegate)
public protocol AdCompanionViewDelegate
                The AdCompanionViewDelegate protocol defines delegate methods to communicate changes in the lifecycle of AdCompanionView instances.
- 
                  
                  
Called when the
AdCompanionViewis about to load its content.Declaration
Swift
@objc optional func adCompanionViewWillLoad(_ adCompanionView: AdCompanionView)Parameters
adCompanionViewThe
AdCompanionViewinstance that triggers the ad request - 
                  
                  
Called when the companion has started to be displayed on screen.
Declaration
Swift
@objc optional func adCompanionViewDidDisplay(_ adCompanionView: AdCompanionView)Parameters
adCompanionViewThe
AdCompanionViewinstance that displayed the ad content - 
                  
                  
Called when an ad request failed. Failure is normally due to network connectivity issues.
Declaration
Swift
@objc optional func adCompanionView(_ adCompanionView: AdCompanionView, didFailToDisplay error: Error)Parameters
adCompanionViewThe
AdCompanionViewinstance that failed to displayerrorThe error received
 - 
                  
                  
Called when the companion view ends displaying.
Declaration
Swift
@objc optional func adCompanionViewDidEndDisplay(_ adCompanionView: AdCompanionView)Parameters
adCompanionViewThe
AdCompanionViewinstance that ended displaying - 
                  
                  
Called immediately when a touch event is detected over the ad companion view. It gives your application a chance to override the default behavior when a
clickThroughevent occurs. Returntrueif you want your application to handle the targetURL. Otherwise, returnfalse, in which case the targetURL will be opened in the external browser.Declaration
Swift
@objc optional func adCompanionView(_ adCompanionView: AdCompanionView, shouldOverrideCompanionClickThrough url: URL) -> BoolParameters
adCompanionViewThe
AdCompanionViewinstance that received the touch eventurlThe
URLthat was loaded by theAdCompanionView - 
                  
                  
Called when the application is about to go to the background as a result of a
clickThroughevent and the targetURL is opened in the external browser.Declaration
Swift
@objc optional func adCompanionViewWillLeaveApplication(_ adCompanionView: AdCompanionView)Parameters
adCompanionViewThe
AdCompanionViewinstance that triggers the event