AppOpenAdLoader

@objc(YMAAppOpenAdLoader)
@objcMembers
public final class AppOpenAdLoader : NSObject, @unchecked Sendable

This class is responsible for loading an app open ad.

  • Undocumented

    Declaration

    Swift

    override public init()
  • Loads an ad with the specified targeting data.

    Declaration

    Swift

    @objc(loadAdWithRequest:completion:)
    public func loadAd(
        with request: AdRequest,
        completion: @escaping @MainActor (AppOpenAd?, Error?) -> Void
    )

    Parameters

    request

    Data for targeting and ad configuration.

    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 loadAd(
        with request: AdRequest,
        completion: @escaping @MainActor (Result<AppOpenAd, Error>) -> Void
    )

    Parameters

    request

    Data for targeting and ad configuration.

    completion

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

  • loadAd(with:) Asynchronous

    Asynchronously loads an ad with the specified targeting data.

    Declaration

    Swift

    public func loadAd(with request: AdRequest) async throws -> AppOpenAd

    Parameters

    request

    Data for targeting and ad configuration.

  • Cancel the ad loading, that was launched in loadAdWithAdUnitID:request

    Declaration

    Swift

    public func cancelLoading()