Banner Ads
Banner Ads
Banners are rectangular ads that appear at the top or bottom of the screen when the user interacts with your app. The user can view banners but cannot dismiss them. The DT FairBid SDK automatically refreshes banners after 20 seconds.
Showing a Banner
Implement the code below to show a Banner:
val placementId = "12345"
Banner.show(placementId, activity)String placementId = "12345";
Banner.show(placementId, activity);let options = FYBBannerOptions(placementId: placementId)
FYBBanner.show(in: view, options: options)FYBBannerOptions *options = [[FYBBannerOptions alloc] initWithPlacementId:placementId];
[FYBBanner showBannerInView:view options:options];string placementId = "1234";
Banner.Show(placementId);Hiding the Banner
If you want to hide the banner temporarily, implement the code below:
//hides the banner for a specific placement
val placementId = "12345"
Banner.hide(placementId)//hides the banner for a specific placement
String placementId = "12345";
Banner.hide(placementId);let placementId = "1234" FYBBanner.hide(placementId)NSString *placementId = @"1234"; [FYBBanner hide:placementId];string placementId = "1234";
Banner.Hide(placementId);Destroying the Banner
Once you have decided that you no longer want to use the banner, you must destroy it.
To destroy the banner, implement the code below:
Banner Position
You can show your banner at the top or bottom of your screen. If you want to change this behavior, use the following code:
Loading a Banner
If you want to use DT FairBid with other mediations or demand sources, you can pre-load a banner to review its pricing and other details. This allows you to compare it against banners from other demand sources outside our platform before showing it.
To load a banner, create a BannerView object instance and then call the load method. Please be aware that this integration method disables banner refresh, and you must add your own refresh logic.
This is supported starting DT FairBid Android SDK 3.51.0.
You are responsible for adding FYBBannerAdView instance to your view hierarchy. This FYBBannerAdView instance is available on bannerDidLoad:impressionData: callback. To pre-load a banner, implement the code below:
This feature is not available on Unity.
Adaptive Banners
By enabling the adaptive banner feature, you can receive the best banner size based on the ad width and screen size. This feature is currently supported by Google AdMob, Google Bidding, and Google Ad Manager only. This feature is disabled by default.
Networks that support adaptive banners will return ads with the best-fit height based on your banner size. Other networks will continue to deliver banners according to the specified ad size.
To use this feature, add the adaptive flag when defining your banner size using the code below:
This feature is not available on Unity.
Adding Callbacks
The callback code below is required for the SDK to properly track the activity of your ad.
Last updated

