# Medium Rectangle Ads

Medium Rectangle (MREC) ads are 300x250 sized ads, serving both static and video, and positioned within editorial content of the app. There is no close button on MREC ads, and they are not skippable. Similar to Banner ads, MREC ads are refreshed according to a set refresh rate of between 10-120 seconds.

{% hint style="info" %}
MREC Ads are available from FairBid SDK version 3.33.1.
{% endhint %}

### Showing an MREC

Implement the code below to show an MREC:

{% tabs %}
{% tab title="Android" %}
{% code title="Kotlin" %}

```kotlin
fun showBanner() {
    val bannerOptions = BannerOptions().withSize(BannerSize.MREC)
            // if you don't specify your container view,
            // we'll display it at the bottom of the screen
            .placeInContainer(YOUR_CONTAINER_VIEW_GOES_HERE)
    Banner.show("placementId", bannerOptions, activity)
}
```

{% endcode %}

{% code title="Java" %}

```java
private void showBanner() {
    BannerOptions bannerOptions = new BannerOptions().withSize(BannerSize.MREC)
        // if you don't specify your container view,
        // we'll display it at the bottom of the screen
        .placeInContainer(YOUR_CONTAINER_VIEW_GOES_HERE);
    Banner.show("placementId", bannerOptions, activity);
}
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}

Implement the code below to request an MREC:

{% code title="Swift" %}

```swift
 FYBBanner.delegate = MyBannerDelegate()
    let bannerOptions = FYBBannerOptions(placementId: "1234", size: .MREC)
    FYBBanner.request(with: options)
```

{% endcode %}

{% code title="Objective-C" %}

```objective-c
#import <FairBidSDK/FairBid.h>

      FYBBanner.delegate = [[MyBannerDelegate alloc] init];
      NSString *placementId = @"1234";
      FYBBannerOptions *bannerOptions = [[FYBBannerOptions alloc] initWithPlacementId:@"1234" size:FYBBannerSizeMREC];
      [FYBBanner requestWithOptions:bannerOptions];
```

{% endcode %}

To show an MREC ad, display the view received in the `bannerDidLoad:impressionData:` that’s part of `FYBBannerDelegate` protocol.&#x20;

{% code title="Swift" %}

```swift
extension MyViewController: FYBBannerDelegate {

    func bannerDidLoad(_ banner: FYBBannerAdView, impressionData: FYBImpressionData)
    {
      // set up the MREC banner constraints
       myView.addSubview(banner)
       banner.center = CGPoint(x: myView.frame.width / 2, y: myView.center.y)
    }

    …
}
```

{% endcode %}

{% code title="Objective-C" %}

```objective-c
// in implementation of FYBBannerDelegate protocol

- (void)bannerDidLoad:(FYBBannerAdView *)banner impressionData:(FYBImpressionData *)impressionData {
    [self.myView addSubview:banner];
    banner.center = CGPointMake(self.myView.bounds.size.width / 2, self.bounds.size.height / 2);
}
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
This feature is not available on Unity.
{% endtab %}
{% endtabs %}
