RichieAdsController

@MainActor
public final class RichieAdsController

RichieAdsController is the main interface for loading ads with Richie SDK.

If possible, you should be using this class instead of RichieAds. RichieAds does not force usage from the main thread but strongly recommends it; this class forces the issue and defines itself to work on the main actor.

If you create a RichieAdsController, yourself, you should call invalidate() on it before relinquishing the last reference. If you use Richie to create it, it keeps a reference to the RichieAdsController it creates and you should use its invalidate method instead.

  • Initialize RichieAdsController.

    Declaration

    Swift

    @MainActor
    public convenience init(
        appIdentifier: String
    )
  • Initialize RichieAdsController with a RichieAds instance.

    Declaration

    Swift

    @MainActor
    public init(richieAds: RichieAds)
  • This method should be called before relinquishing last reference to a RichieAdsController instance. It allows RichieAds to nicely shut down and clean up.

    Declaration

    Swift

    @MainActor
    public func invalidate()

Global persisted parameters

  • Global persisted parameters can be used by ad creatives (using JavaScript API) to query global state. This gives creatives the opportunity to communicate with each other, using simple string values. For example, one creative can set a value for a key when some action has been performed by the user, and then another creative can know that this event has occurred.

    Note

    Parameters are retained only for a limited duration. They will be cleaned after 30 days of inuse.

    Declaration

    Swift

    @MainActor
    func setGlobalPersistedParameter(key: String, value: String?)
  • Returns value for a global persisted parameter.

    Declaration

    Swift

    @MainActor
    func globalPersistedParameterValue(key: String) -> String?

Slot ads