Integrate Equativ Display SDK as an In-App Bidding partner on Android
Table of contents
Overview
Go to the general In-App Bidding article to have more information.
In-App Bidding APIs
The SASBiddingManager class
The SASBiddingManager
object is in charge of making the In-app Bidding calls to Equativ SSP and returning ads with their corresponding price.
The SASBiddingManager
constructor requires 3 parameters, as described below:
/**
* @param adPlacement The ad placement used to load the ad.
* @param formatType The format type of the requested bidding ad.
* @param currency The currency that must be used for the price of the bidding ad.
*/
init(adPlacement: SASAdPlacement, formatType: SASBiddingAdFormatType, currency: SASBiddingCurrency)
Once the SASBiddingManager
object is created, you can request an ad simply by calling the loadAd
method.
The outcome of the bidding call will be handled by the set SASBiddingManagerDelegate
as described below.
The SASBiddingManagerDelegate protocol
The SASBiddingManagerDelegate
is the protocol that must be implemented by objects responsible for handling the outcome of bidding ad calls.
In case of a failing bidding call, the SASBiddingManagerDelegate
instance will call the biddingManager:didFailToLoadWithError:
method, passing the NSError
object representing the reason of the failure.
In case of successful bidding call, the SASBiddingManagerDelegate
instance will call the biddingManager:didLoadWithBiddingAdResponse:
method, passing the SASBiddingAdResponse
object representing the bid from Equativ platform. You will find more information about it in the section below.
The SASBiddingAdResponse model
The SASBiddingAdResponse
is a model representing a bid that contains the ad content to be displayed, along with its price, its format type and the placement it was delivered on.
To compare this ad with responses from other partners, you will use the price
property, which is an instance of SASBiddingAdPrice
model, representing the CPM of the received ad. For more details about the SASBiddingAdPrice
model, please refer to the API documentation.
How to integrate Equativ Display SDK as bidder in your application
Banner format
1. SASBannerView integration
You will find more information about Equativ Display SDK Banner integration here.
2. Implementation of BiddingManagerListener
As seen previously, the object will handle the outcome of the SASBiddingManager
call.
If the call is successful, you will integrate the received SASBiddingAdResponse
object in your competition. If this ad wins the competition according to your criteria, you will display the ad using the loadAd(with biddingAdResponse: SASBiddingAdResponse)
method of the SASBannerView
class using the received SASBiddingAdResponse
instance as parameter.
You can not call the loadAd(with biddingAdResponse: SASBiddingAdResponse)
method on the SASInterstitialManager
once the show
method was successfully called. Indeed, once the interstitial ad was displayed, the SASBiddingAdResponse
associated with the SASInterstitialManager
will be marked as ‘consumed’ and can not be either loaded or shown again.
Implementation example:
// MARK: - Bidding manager delegate
func biddingManager(_ biddingManager: SASBiddingManager, didFailToLoad error: any Error) {
// Equativ did not return any bidding ad, proceed with your competition process
}
func biddingManager(_ biddingManager: SASBiddingManager, didLoadWith biddingAdResponse: SASBiddingAdResponse) {
// Retrieve the bidding ad price
let biddingAdPrice = biddingAdResponse.price
// Perform the bidding competition using biddingAdPrice.cpm and biddingAdPrice.currency properties.
// Here, we assume Equativ wins the competition
// Load the SASBiddingAdResponse in a previously instantiated SASBannerView
bannerView.loadAd(with: biddingAdResponse)
}
3. SASBiddingManager instantiation and bidding call
Instantiate your SASBiddingManager
like so:
// Create the ad placement
let adPlacement = SASAdPlacement(siteId: 123, pageId: 456, formatId: 789) // Replace with your own ad placement
// Create the bidding manager object
let biddingManager = SASBiddingManager(adPlacement: adPlacement, formatType: .banner, currency: .EUR)
// Set previously created listener
biddingManager.delegate = self
// Perform the bidding call
biddingManager.loadAd()
Interstitial format
1. SASInterstitialManager integration
You will find more information about Equativ Display SDK Interstitial integration here.
2. Implementation of BiddingManagerListener
As seen previously, the object will handle the outcome of the SASBiddingManager
call.
If the call is successful, you will integrate the received SASBiddingAdResponse
object in your competition. If this ad wins the competition according to your criteria, you will display by using the right initializer initWithBiddingAdResponse:
of the SASInterstitialManager
class using the received SASBiddingAdResponse
instance as parameter.
You can not call the loadAd
method more than once with the same SASBiddingAdResponse
instance. After the first call, the SASBiddingAdResponse
will be marked as ‘consumed’ and will not be displayable anymore.
Implementation example:
// MARK: - Bidding manager delegate
func biddingManager(_ biddingManager: SASBiddingManager, didFailToLoad error: any Error) {
// Equativ did not return any bidding ad, proceed with your competition process
}
func biddingManager(_ biddingManager: SASBiddingManager, didLoadWith biddingAdResponse: SASBiddingAdResponse) {
// Retrieve the bidding ad price
let biddingAdPrice = biddingAdResponse.price
// Perform the bidding competition using biddingAdPrice.cpm and biddingAdPrice.currency properties.
// Here, we assume Equativ wins the competition
// Create a new SASInterstitialManager with the received bidding ad response
let interstitialManager = SASInterstitialManager(biddingAdResponse: biddingAdResponse)
// Set interstitial manager delegate
interstitialManager.delegate = self
// Load the interstitial. The interstitial's delegate interstitialManager:didLoadWithInfo: method will be called
// once the interstitial is ready to be shown. You can then call the show() method from there on.
interstitialManageR.loadAd()
}
3. SASBiddingManager instantiation and bidding call
Instantiate your SASBiddingManager
like so:
// Create the ad placement
let adPlacement = SASAdPlacement(siteId: 123, pageId: 456, formatId: 789) // Replace with your own ad placement
// Create the bidding manager object
let biddingManager = SASBiddingManager(adPlacement: adPlacement, formatType: .interstitial, currency: .EUR)
// Set previously created listener
biddingManager.delegate = self
// Perform the bidding call
biddingManager.loadAd()