Skip to main content

MREC

MREC is a 300x250 banner. This type can be useful if the application interface has a large free area for placing a banner.

Check If Ad Is Loaded

// MREC view
mrec.isReady

Display

AppodealMRECView is a subclass of AppodealBannerView. The size of AppodealMRECView is 300x250.

MREC ads are refreshed every 15 seconds automatically by default. To display MREC, you need to call the following code:

import UIKit
import Appodeal

class YourViewController: UIViewController, AppodealBannerViewDelegate {

override func viewDidLoad () {
super.viewDidLoad()
// required: init ad banner
let mrecView: AppodealMRECView = AppodealMRECView()
mrecView.usesSmartSizing = false
mrecView.rootViewController = self

// optional: set delegate
mrecView.delegate = self

// required: add banner to superview and call -loadAd to start banner loading
self.view.addSubview(mrecView)
mrecView.loadAd()
}

// optional: implement any of AppodealBannerViewDelegate methods
func bannerViewDidLoadAd(_ bannerView: APDBannerView, isPrecache precache: Bool) {
NSLog("bannerView was loaded")
}

func bannerView(_ bannerView: APDBannerView, didFailToLoadAdWithError error: Error) {
NSLog("bannerView failed to load");
}

func bannerViewDidInteract(_ bannerView: APDBannerView) {
NSLog("bannerView was clicked")
}

func bannerViewDidShow(_ bannerView: APDBannerView) {
NSLog("bannerView was shown")
}

func bannerViewExpired(_ bannerView: APDBannerView) {
NSLog("bannerView did expire and could not be shown")
}
}

You can use our demo app as a reference project.

Demo App


If you want to use advanced MREC integration, you can find detailed documentation here