-
Notifications
You must be signed in to change notification settings - Fork 0
YMPlacementViewDelegate Methods
The YMPlacementViewDelegate protocol provides callbacks that can be used during the lifecycle of a YMPlacementView. Below is a brief description of each.
- (BOOL) adViewShouldResize: (nonnull YMPlacementView *) placementView
toPosition: (CGRect) position;This method is called when a placement requests permission to change size. Return YES to allow resizing. Returning NO may cause Yieldmo ads to fail because we cannot resize. If you need to modify your layout to accommodate the new size, do so in adViewDidResize.
- (void) adViewDidReceiveAd: (nonnull YMPlacementView *) placementView;This method is invoked when the placement view has fully loaded an ad.
- (void) adViewDidFailToReceiveAd: (nonnull YMPlacementView *) placementView
withError: (YMError) error;This method is invoked when the ad request does not fill or ad loading fails.
- (void) adViewWillPresentScreen: (nonnull YMPlacementView *) placementView;This method is invoked just before the ad presents a modal on the screen, for example when tapping on a YMPlacementView produces a modal controller to load the advertiser's URL.
- (void) adViewDidDismissScreen: (nonnull YMPlacementView *) placementView;This method is invoked when the ad dismisses a modal from the screen, for example when a user dismisses a modal controller that had been launched by the YMPlacementView.
- (void) adViewWillLeaveApplication: (nonnull YMPlacementView *) placementView;This method is invoked when the ad leads the user to leave your application, for example when clicking on an ad launches an external browser.
- (void) adViewTapped: (nonnull YMPlacementView *) placementView;This method is invoked when the ad is tapped by the user.
- (void) adViewDidResize: (nonnull YMPlacementView *) placementView
toPosition: (CGRect) position;This method is invoked after an ad has changed size.
- (CGRect) visibleContainerFrame: (nonnull YMPlacementView *) placementView;This method is used to define and return the region within which a placement animates. This frame should not include regions that are occluded by status bars, navigation bars, or other UI elements. If this method is not implemented, the Yieldmo SDK assumes the ad's visible container frame is the entire screen.
See the Visible Frame page for more information.
Start Here
iOS Version Support
Troubleshooting & Logging
Have a previous SDK?