# BuzzBanner

Source: https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/banner
Platform: iOS
SDK major version: v6
Language: English (en)
Translation: AI-translated from Korean. Original: https://docs.buzzvil.com/docs/buzzbenefit-ios/v6/banner

BuzzBanner is a non-rewarded ad product that increases inventory revenue while taking the user experience into account. You can integrate BuzzBanner below Feed and the ad participation instructions page, or at any other location you choose.

![](https://docs.buzzvil.com/api/content-image/buzzbenefit-ios/v6/image/07-banner/00-buzzbanner.png)

> ✅  **Important**
>
> - BuzzBanner supports SPM integration from v6.5.2+, v6.6.1+, and v6.7+. Earlier versions support only CocoaPods integration.

## Integrate BuzzBanner

### Integrate below Feed and ad participation instructions

You can easily integrate BuzzBanner below Feed and the ad participation instructions page without code changes. Contact your Buzzvil representative to integrate it.

### Integrate BuzzBanner at a custom location

Follow these steps to integrate BuzzBanner wherever you choose.

1. Choose a BuzzBanner size.

**BuzzBanner sizes**

| Size             | Enum                      |
| ---------------- | ------------------------- |
| Banner 320 x 50  | `BuzzBannerSize.w320h50`  |
| Banner 320 x 100 | `BuzzBannerSize.w320h100` |
| Banner dynamic   | `BuzzBannerSize.dynamic`  |
| Banner 300 x 250 | `BuzzBannerSize.w300h250` |

> ✏️  **Note**\
> `BuzzBannerSize.w300h250` (Objective-C: `BuzzBannerSizeW300h250`) is supported in Buzzvil SDK 6.8.0 and later.

> ✏️  **Note**\
> dynamic supports sizes other than 320 x 50 and 320 x 100. To serve banners in a variety of sizes for monetization, set the BuzzBanner size to dynamic and ask your Buzzvil representative to serve ads for that size.

2. Contact your Buzzvil representative to obtain a Placement ID and Banner Size for the integration.

| ID type      | Description                                                                                                                                |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Placement Id | A unique ID that identifies each ad placement. The banner size must match the PlacementId for ads to be allocated and displayed correctly. |
| Banner Size  | Determines the size of the displayed BuzzBanner.                                                                                           |

3. Add `BuzzBannerView` at the desired location.

**Swift**

```swift
import UIKit
import BuzzvilSDK

final class ViewController: UIViewController {
  private lazy var bannerView: BuzzBannerView = {
    let bannerView = BuzzBannerView(frame: .zero)
    bannerView.delegate = self
    return bannerView
  }()

  override func viewDidLoad() {
    super.viewDidLoad()

    let config = BuzzBannerConfig.Builder(placementId: "YOUR_PLACEMENT_ID")
      .setSize(.w320h50)
      .build()
    bannerView.setConfig(rootViewController: self, config: config)

    view.addSubview(bannerView)

    // ...
  }

  override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    bannerView.requestAd()
  }

  override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)

    bannerView.removeAd()
  }
}

extension ViewController: BuzzBannerViewDelegate {
  func bannerView(_ bannerView: BuzzBannerView, didLoadApid: String) {
    // Banner에 광고가 할당 되었을 때 호출 됩니다.
  }
  
  func bannerView(_ bannerView: BuzzBannerView, didFailApid: String, error: Error) {
    // Banner에 광고 할당이 실패했을 때 호출 됩니다.
  }
  
  func bannerView(_ bannerView: BuzzBannerView, didClickApid: String) {
    // Banner가 클릭되었을 때 호출 됩니다.
  }
  
  func bannerView(_ bannerView: BuzzBannerView, didRemoveApid: String) {
    // Banner가 제거되었을 떄 호출 됩니다.
  }
}
```

**Objective-C**

```objectivec
@import BuzzvilSDK;

@interface ViewController () <BuzzBannerViewDelegate>

@property (nonatomic, strong, readonly) BuzzBannerView *bannerView;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  
  [self setupView];
}

- (void)setupView {
  BuzzBannerConfig * config = [BuzzBannerConfig configWith:^(BuzzBannerConfigBuilder * _Nonnull builder) {
    builder.placementId = @"YOUR_PLACEMENT_ID";
    builder.size = BuzzBannerSizeW320h50;
  }];
  _bannerView = [[BuzzBannerView alloc] initWithFrame:CGRectZero];
  [_bannerView setConfigWithRootViewController:self config:config];
  
  [self.view addSubview:_bannerView];
}

- (void)viewWillAppear:(BOOL)animated {
  [super viewWillAppear:animated];
  
  [_bannerView requestAd];
}

- (void)viewWillDisappear:(BOOL)animated{
  [super viewWillDisappear:animated];
  
  [_bannerView removeAd];
}

#pragma mark - BuzzBannerViewDelegate

- (void)bannerView:(BuzzBannerView * _Nonnull)bannerView didLoadApid:(NSString * _Nonnull)didLoadApid { 
  // Banner에 광고가 할당 되었을 때 호출 됩니다.
}

- (void)bannerView:(BuzzBannerView * _Nonnull)bannerView didFailApid:(NSString * _Nonnull)didFailApid error:(NSError * _Nonnull)error { 
  // Banner에 광고 할당이 실패했을 때 호출 됩니다.
}

- (void)bannerView:(BuzzBannerView * _Nonnull)bannerView didClickApid:(NSString * _Nonnull)didClickApid { 
  // Banner가 클릭되었을 때 호출 됩니다.
}

- (void)bannerView:(BuzzBannerView * _Nonnull)bannerView didRemoveApid:(NSString * _Nonnull)didRemoveApid { 
  // Banner가 제거되었을 떄 호출 됩니다.
}

@end
```

## Integrate additional ADNs to increase BuzzBanner revenue

This section explains how to integrate additional ad networks to maximize BuzzBanner revenue.

> ✏️  **Note**\
> BuzzBanner ADNs are integrated through AvatyeAdCash, a library used by the Buzzvil SDK. See the [AvatyeAdCash ad mediation integration guide](https://avatye.notion.site/67f7ff00a8b447dfbf1312eb77ae6d82).

### AdFit (Kakao)

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the adfit directory to your application project.

2. Add the AdFit dependency to `Podfile`.

> ✏️  **Note**\
> From v3.18.6, only Swift Package Manager integration is supported. See [AdFit SPM](https://github.com/adfit/adfit-spm).

```
pod 'AdFitSDK', '= 3.18.3'
```

3. No separate initialization code is required.

### GAM (Google AdMob)

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the admob directory to your application project.

2. Add the GAM SDK dependency to `Podfile`.

```
pod 'Google-Mobile-Ads-SDK', '= 12.14.0'
```

3. Call the initialization code below.

**Swift**

```swift
import GoogleMobileAds

GADMobileAds.sharedInstance().start(completionHandler: nil)
```

**Objective-C**

```objectivec
@import GoogleMobileAds;

[GADMobileAds.sharedInstance startWithCompletionHandler:nil];
```

### AppLovin

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the applovin directory to your application project.

2. Add the AppLovin SDK dependency to `Podfile`.

```
pod 'AppLovinSDK', '= 13.5.1'
```

3. Contact your Buzzvil representative at <help@buzzvil.com> to obtain an integration key.

4. Call the initialization code below.

**Swift**

```swift
import AppLovinSDK

let initConfig = ALSdkInitializationConfiguration(sdkKey: "YOUR_APPLOVIN_SDK_KEY") { builder in
  builder.mediationProvider = ALMediationProviderMAX
}
ALSdk.shared().initialize(with: initConfig) { sdkConfig in }
```

**Objective-C**

```objectivec
@import AppLovinSDK;

ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: @"YOUR_APPLOVIN_SDK_KEY" builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
  builder.mediationProvider = ALMediationProviderMAX;
}];

[[ALSdk shared] initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) {}];
```

### Cauly

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add `CaulyAdapter.h` and `CaulyAdapter.m` from the cauly directory to your application project.

2. Add the Cauly SDK dependency to `Podfile`.

```
pod 'CaulySDK', :git => 'https://github.com/cauly/CaulySDK_iOS.git', :tag => '3.1.22'
```

3. Contact your Buzzvil representative at <help@buzzvil.com> to obtain an integration key.

4. Call the initialization code below.

**Swift**

```swift
import CaulySDK

if let adSetting = CaulyAdSetting.global() {
  CaulyAdSetting.setLogLevel(CaulyLogLevelInfo)
  adSetting.appId = "YOUR_CAULY_APP_ID"
  adSetting.appCode = "YOUR_CAULY_APP_CODE"
  adSetting.animType = CaulyAnimNone
  adSetting.closeOnLanding = true
} else {
  print("Cauly failed")
}
```

**Objective-C**

```objectivec
@import CaulySDK;

if ([CaulyAdSetting globalSetting]) {
  [CaulyAdSetting setLogLevel:CaulyLogLevelInfo];
  CaulyAdSetting *adSetting = [CaulyAdSetting globalSetting];
  adSetting.appId = @"YOUR_CAULY_APP_ID";
  adSetting.appCode = @"YOUR_CAULY_APP_CODE";
  adSetting.animType = CaulyAnimNone;
  adSetting.closeOnLanding = YES;
} else {
  NSLog(@"Cauly failed");
}
```

### FAN (Facebook Audience Network)

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the facebook directory to your application project.

2. Add the FAN SDK dependency to `Podfile`.

> ✏️  **Note**\
> FAN SDK v6.21.0 and later require Xcode 26 or later. In environments with Xcode earlier than 26 (Buzzvil SDK 6.8.x), use FAN SDK v6.20.1.

```
pod 'FBAudienceNetwork', '= 6.21.0'
```

3. No separate initialization code is required.

### Pangle

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the pangle directory to your application project.

2. Add the Pangle SDK dependency to `Podfile`.

```
pod 'Ads-Global', '= 7.8.0.3'
```

3. Contact your Buzzvil representative at <help@buzzvil.com> to obtain an integration key.

4. Call the initialization code below.

**Swift**

```swift
import PAGAdSDK

let config = PAGConfig.share()
config.appID = "YOUR_PANGLE_APP_ID"
PAGSdk.start(with: config) { success, error in
  if success {
    print("Pangle succeed")
  }
}
```

**Objective-C**

```objectivec
@import PAGAdSDK;

PAGConfig *config = [PAGConfig shareConfig];
config.appID = @"YOUR_PANGLE_APP_ID";
[PAGSdk startWithConfig:config completionHandler:^(BOOL success, NSError * _Nonnull error) {
  if (success) {
    NSLog(@"Pangle succeed");
  }
}];
```

### UnityAds

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the unityads directory to your application project.

2. Add the UnityAds SDK dependency to `Podfile`.

```
pod 'UnityAds', '= 4.16.4'
```

3. No separate initialization code is required.

### Vungle

1. Download the [Adapter](https://avatye.notion.site/Adapter-19ac92b24d018003b73cc90adfa46d34) and add the files in the vungle directory to your application project.

2. Add the Vungle SDK dependency to `Podfile`.

```
pod 'VungleAds', '= 7.6.2'
```

3. Contact your Buzzvil representative at <help@buzzvil.com> to obtain an integration key.

4. Call the initialization code below.

**Swift**

```swift
import VungleAdsSDK

VungleAds.initWithAppId("YOUR_VUNGLE_APP_ID") { error in
  if let error = error {
    print("Vungle failed")
  } else {
    print("Vungle succeed")
  }
}
```

**Objective-C**

```objectivec
@import VungleAdsSDK;

[VungleAds initWithAppId:@"YOUR_VUNGLE_APP_ID" completion:^(NSError * _Nullable error) {
  if (error) {
    NSLog(@"Vungle failed");
  } else {
    NSLog(@"Vungle succeed");
  }
}];
```
