SDK Bidding
The Boldwin SDK supports bidding integrations with mediation platforms. This implementation uses a token-based flow for bid generation and ad rendering.
Bidding is supported for the following ad formats:
- Banner
- Interstitial
- Rewarded
Bidding Token Generation
The Boldwin SDK provides an API to generate a bidding token. The token is returned as a Base64-encoded string.
To generate a token, use the following method:
This token must be sent to the Boldwin bidding endpoint with every bidding request in the user.data[0].segment[0].signal field.
Bidding
UEndpoint: Contact your Boldwin support manager to obtain the bidding endpoint.
The bid request must include the SDK-generated token in the user.data[0].segment[0].signal OpenRTB field.
When a bid is successfully returned, the response will contain a signal token at seatbid[0].bid[0].ext.signaldata field. This signaldata value must be passed back to the SDK for ad rendering when the bid wins (see Rendering section).
Rendering
The seatbid[0].bid[0].ext.signaldata bid response field should be passed to the SDK to complete the entire lifecycle of ad creation and display. This string should be passed to respective Ad Unit methods.
Your publisher UI should allow to enter in a placementID for each ad unit which should also be passed to the setPlacementId() method.
The sections below demonstrate how to render each supported ad format.
Banner Ads
Note: In this integration type, the auto-refresh feature is not available.
// Initialize a `BoldwinAdView` instance
val adView = BoldwinAdView(context)
// Disable autorefresh
adView.setAutoRefreshPeriod(0)
// Set placement id
adView.setPlacementId(PLACEMENT_ID)
// Load and display ad with token
adView.loadAd(TOKEN)
// Add to the scree
wrapperView.addView(adView)
Interstitial Ads
// Initialize a `BoldwinInterstitial` instance
val interstitial = BoldwinInterstitial(PLACEMENT_ID, this)
// Load ad with token
interstitial.loadAd(TOKEN)
// Show the ad when ready
override fun onAdLoaded(ad: BoldwinAd?) {
interstitial.showAd()
}