IOS - Monetarisierungs-App-SDK-Dokumentation

⌘K
  1. IOS - Monetize App SDK Do...
  2. User Manual
  3. Anzeigenformate
  4. Outstream

Outstream

Prerequisites

Wrapper

For creating a wrapper, you can follow this small guide: Einen Wrapper erstellen.

Zeige die Anzeige

In the example we are using a Test Id.

If you are not testing the app, change it for the proper ID that you got from us.


The method below will add an Ad to the provided wrapper.

func addOutstrem(wrapper:UIView){
    let configurationID = ConfigBuilder.companion.VIDEO_OUTSTREAM_TEST_R89_CONFIG_ID
    RefineryAdFactory.shared.createVideoOutstreamBanner(
       configurationID: configurationID, 
       wrapper: wrapper,
       lifecycleCallbacks: nil)
}
    

Lebenszyklusereignisse

You can subscribe to these events with the same method by passing a new instance of BannerEventListener as a LebenszyklusRückrufeparameter to the createBanner method. Details about this object can be found in the Referenz.

Here is what the implementation looks like.

First, extend from the BannerEventListener.

        class BannerEventLogger: BannerEventListener {
            override func onLayoutChange(width: Int32, height: Int32) {
                print(“onLayoutChange”,”width=\(width)”,”height=\(height)”)
            }

            override func onLoaded() {
                print(“onLoaded”)
            }

            override func onOpen() {
                print(“onOpen”)
            }

            override func onClick() {
                print(“onClick”)
            }

            override func onClose() {
                print(“onClose”)
            }

            override func onImpression() {
                print(“onImpression”)
            }

            override func onFailedToLoad(error: R89LoadError) {
                print(“onFailedToLoad”,”error=\(error)”)
            }
        }   
    

Next, provide the instance of BannerEventLogger zu createBanner method, via LebenszyklusRückrufe Parameter.

        func addOutstrem(wrapper:UIView){
            let configurationID = ConfigBuilder.companion.VIDEO_OUTSTREAM_TEST_R89_CONFIG_ID
            let bannerEventLogger = BanneEventLogger()
            RefineryAdFactory.shared.createVideoOutstreamBanner(configurationID: configurationID, wrapper: wrapper, lifecycleCallbacks: bannerEventLogger)
        }
    

Wie können wir helfen?