BuzzAd Benefit SDK: Interstitial Ads
...
This documentation provides a guideline for integrating interstitial ads for BuzzAd Benefit.
※ Note
Please proceed with the following process only after BuzzAd Benefit SDK integration is complete.
The interstitial type is available for the convenience of app publishers. For more customization options, please implement the native type.
...
Table of Contents | ||
---|---|---|
|
Basic Usage
...
Setting the BABInterstitialAdHandler
Create the
BABInterstitialAdHandler
withunit_id
andtype
(Dialog or Bottomsheet, see below for details).Request for ads by calling
show:withConfig
.
...
Code Block | ||
---|---|---|
| ||
// Swift let interstitialAdHandler = BABInterstitialAdHandler(unitId: YOUR_INTERSTITIAL_AD_UNIT_ID, type: BABInterstitialDialog) interstitialAdHandler.show(self, with: nil) |
Setting the Interstitial Type
Please set the desired type of interstitial ad either by Dialog
or BottomSheet
:
BABInterstitialDialog
BABInterstitialBottomSheet
...
Advanced Usage
...
Setting the BABInterstitialConfig
The design and the number of advertisement are configurable with the BABInterstitialConfig
. This should be included when calling show:withConfig
.
Common Config
topIcon
: Icon at the top of the Interstitial ad (UIImage)titleText
: Text at the top of the Interstitial ad (NSString)titleTextColor
: Color oftitleText
(UIColor)backgroundColor
: Background color of the interstitial ad (UIColor)ctaViewBackgroundColor
: Background color of CTA view (BABStateValue<UIColor *>)ctaViewIcon
: Default icon included in CTA view (BABStateValue<UIImage *>)ctaViewTextColor
: Color of the text in CTA view (BABStateValue<UIColor *>)
Dialog Specific Config
closeText
: Text for close button
Bottom Sheet Specific Config
adCount
: 1 ~ 5 ads can be requested at one time.adCount
is fixed to 5 if is not set or set beyond 5.
...
Code Block | ||
---|---|---|
| ||
// Swift let config = BABInterstitialConfig() config.topIcon = UIImage(named: "top_icon") config.titleText = "View now and earn points" config.titleTextColor = UIColor.black config.backgroundColor = UIColor.white config.ctaViewIcon = BABStateValue<UIImage>(enabled: UIImage(named: "cta_enabled_icon")!, disabled: UIImage(named: "cta_diabled_icon")!) config.ctaViewTextColor = BABStateValue<UIColor>(enabled: RGB(255, 255, 255), disabled: RGB(177, 177, 177)) config.ctaViewBackgroundColor = BABStateValue<UIColor>(enabled: RGB(240, 89, 82), disabled: RGB(253, 133, 135)) interstitialAdHandler.show(self, with: config) |
Handling the ad loading events via delegation
Implement the BABInterstitialAdHandlerDelegate
to receive ad load success/failure events.
...