Ad Request

The Ad Request is used for ad loading.

There are four types of Ad Requests:

Ad Request type

Class

Banner

BDMBannerRequest

Interstitial

BDMInterstitialRequest

Rewarded

BDMRewardedRequest

Native Ad

BDMNativeAdRequest

Rich media

BDMRichMediaRequest

Parent class BDMRequest allows transferring various targeting and custom parameters to the server, managing ad loading and state.

Price floors

While using Price Floors, the user gets the opportunity to control the price of advertising.

Parameter

Type

Description

ID

String

Unique bid identifier.

value

Decimal number

Bid price

func populate(_ request: BDMRequest) {
   let priceFloor = BDMPriceFloor()
   priceFloor.ID = UUID().uuidString
   priceFloor.value = NSDecimalNumber(decimal: Decimal(0.01))
   request.priceFloors = [priceFloor]
}
- (void)populateRequest:(BDMRequest *)request {
   BDMPriceFloor *priceFloor = BDMPriceFloor.new
   priceFloor = NSUUID.UUID.UUIDString;
   priceFloor.value = [NSDecimalNumber decimalNumberWithDecimal:[@0.01f decimalValue]];
   request.priceFloors = @[priceFloor];
}

Contextual data

With the help of contextual data, publisher can transmit advertising analytics manually

Parameter

Type

Description

impressions

NSUInteger

The count of impressions for a specific placement type in a given app session

sessionDuration

NSUInteger

The total duration of time a user has spent so far in a specific app session expressed in seconds

clickRate

NSUInteger

The percentage of clicks/impressions per user per placement type over a given number of impressions, where 5 represents a 5% CTR

completionRate

NSUInteger

The percentage of successful completions/impressions for a user per placement type for a given number of impressions, where 70 represents a 70% completion rate.
This only applies to Rewarded and Video placement types

lastClickForImpression

NSUInteger

An integer value indicating if the user clicked on the last impression in a given session per placement type, where "1" = user clicked, "0" = user didn't click

lastBundle

NSString

The last app bundle the user saw on the previous impression in a given session per placement type

lastAdomain

NSString

The last advertiser domain the user saw on the previous impression in a given session per placement type

func populate(_ request: BDMRequest, _ contextualData: BDMContextualProtocol) {
   request.contextualData = contextualData
}
- (void)populateRequest:(BDMRequest *)request contextualData:(id<BDMContextualProtocol>)contextualData {
   request.contextualData = contextualData;
}

Timeout

Using the timeout parameter, you can set a custom timeout interval for a request

Parameter

Type

Description

timeout

NSNumber

Request timeout interval (sec)

func populate(_ request: BDMRequest) {
   request.timeout = 10
}
- (void)populateRequest:(BDMRequest *)request {
   request.timeout = @(10);
}

Bid payload

By setting the bidPayload parameter, you can load the request from the payload.

Parameter

Type

Description

bidPayload

NSString

Request bid payload

func populate(_ request: BDMRequest) {
   request.bidPayload = "Custom payload string"
}
- (void)populateRequest:(BDMRequest *)request {
   request.bidPayload = @"Custom payload string";
}

Placement Id

PlacementId is used to pass custom placement for a request

Parameter

Type

Description

placementId

NSString

Custom placement id

func populate(_ request: BDMRequest) {
   request.placementId = "Custom placement id string"
}
- (void)populateRequest:(BDMRequest *)request {
   request.placementId = @"Custom placement id string";
}

Mediation

If the request is involved in third-party mediation, you can use such methods to notify the SDK about the win or loss events:

func notifyMediationWin(_ request: BDMRequest) {
   request.notifyMediationWin()
}

func notifyMediationLoss(_ request: BDMRequest) {
   request.notifyMediationLoss()
   // or
   request.notifyMediationLoss("network", ecpm: 0.1)
}
- (void)notifyMediationWin:(BDMRequest *)request {
   [request notifyMediationWin];
}

- (void)notifyMediationLoss:(BDMRequest *)request {
   [request notifyMediationLoss];
   // or
   [request notifyMediationLoss: @"network" ecpm: @(0.1)];
}