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

    request

    Data for targeting.

    adsCount

    Count of requested ads.

    options

    Configuration options for native ad loading. Default options load images automatically.

    completion

    The 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

    request

    Data for targeting.

    adsCount

    Count of requested ads.

    options

    Configuration options for native ad loading. Default options load images automatically.

    completion

    The completion handler to be called when the ad loading is finished.

  • 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

    request

    Data for targeting.

    adsCount

    Count of requested ads.

    options

    Configuration options for native ad loading. Default options load images automatically.