NativeBulkAdLoader
@objc(YMANativeBulkAdLoader)
@objcMembers
public final class NativeBulkAdLoader : NSObject, @unchecked Sendable
This class is responsible for loading native ads.
-
Undocumented
Declaration
Swift
override public convenience init() -
Loads an ad with the specified targeting data.
Declaration
Swift
@objc(loadAdsWithRequest:adsCount:options:completion:) public func loadAds( with request: AdRequest, adsCount: UInt, options: NativeAdOptions = .init(), completion: @escaping @MainActor ([NativeAd]?, Error?) -> Void )Parameters
requestData for targeting.
adsCountCount of requested ads.
optionsConfiguration options for native ad loading. Default options load images automatically.
completionThe completion handler to be called when the ad loading is finished.
-
Loads an ad with the specified targeting data.
Declaration
Swift
public func loadAds( with request: AdRequest, adsCount: UInt, options: NativeAdOptions = .init(), completion: @escaping @MainActor (Result<[NativeAd], Error>) -> Void )Parameters
requestData for targeting.
adsCountCount of requested ads.
optionsConfiguration options for native ad loading. Default options load images automatically.
completionThe completion handler to be called when the ad loading is finished.
-
loadAds(with:AsynchronousadsCount: options: ) Asynchronously loads an ad with the specified targeting data.
Declaration
Swift
public func loadAds( with request: AdRequest, adsCount: UInt, options: NativeAdOptions = .init() ) async throws -> [NativeAd]Parameters
requestData for targeting.
adsCountCount of requested ads.
optionsConfiguration options for native ad loading. Default options load images automatically.