SASNativeAdView
Objective-C
@interface SASNativeAdView : UIView
Swift
class SASNativeAdView : UIView
A view that loads and displays a native ad creative.
-
The native ad view delegate if any, nil otherwise.
Declaration
Objective-C
@property (weak, nullable) id<SASNativeAdViewDelegate> delegate;
Swift
weak var delegate: (any SASNativeAdViewDelegate)? { get set }
-
The modal parent view controller of the current native ad view.
This controller will be used as root controller by the SDK if it needs to display a fullscreen controller.
Note
You should always set a valid modal parent view controller, otherwise most post-click interactions will not be able to work properly (post-click modal, StoreKit, …).Declaration
Objective-C
@property (weak, nullable) UIViewController *modalParentViewController;
Swift
weak var modalParentViewController: UIViewController? { get set }
-
The last placement loaded in the native ad view if any, nil otherwise.
Declaration
Objective-C
@property (readonly, nullable) SASAdPlacement *adPlacement;
Swift
var adPlacement: SASAdPlacement? { get }
-
Attempt to load an ad using the provided ad placement.
Declaration
Objective-C
- (void)loadAdWithAdPlacement:(nonnull SASAdPlacement *)adPlacement;
Swift
func loadAd(with adPlacement: SASAdPlacement)
Parameters
adPlacement
The ad placement used to load the ad.
-
Track the specified mediation view instead of this native ad view instance.
Calling this method is useful for mediation scenarios where the primary SDK is in charge of rendering the native ad assets and where its own rendered view must be tracked for impression, viewability, clicks, …
This method has no effect if the native ad view instance was already displayed (i.e. when it has been added to a superview after a successful loading) or the loadAd() method has not been called yet. The typical use is to call this method on a native ad view instance after it has successfully loaded but before it was added to any UI.
Note
Calling this method will immediately call the impression pixel of the ad.
Declaration
Objective-C
- (void)trackMediationView:(nonnull UIView *)mediationView;
Swift
func trackMediationView(_ mediationView: UIView)
Parameters
mediationView
The mediation view that is used to perform the native ad rendering and must be tracked instead of this native ad view instance.