Class RewardedAd

Extends BaseRewardedAd
Represents a full-screen rewarded ad.

Rewarded ads completely cover the screen of the host application.
Properties
adEventCallback?
The callback to receive ad event notifications.
adUnitId
The unique ad unit ID used to request and load this specific ad.
serverSideVerificationOptions?
Configuration for secure server-to-server validation.
Methods
destroy
Destroys the ad, stopping any extra processing and destroying resources associated with it.
getResponseInfo
Gets information about the ad response for this ad.
setPlacementId
Sets the placement ID for this ad.
show
Shows the rewarded ad.
load
Loads a rewarded ad.

Properties


Optional adEventCallback

adEventCallback?: AdEventCallback
The callback to receive ad event notifications.

Readonly adUnitId

adUnitId: string
The unique ad unit ID used to request and load this specific ad.

Optional serverSideVerificationOptions

serverSideVerificationOptions?: ServerSideVerificationOptions
Configuration for secure server-to-server validation.

Assign this before calling the show method to securely validate the reward on your own backend.

Methods


destroy

destroy(): void
Destroys the ad, stopping any extra processing and destroying resources associated with it.

Do not call any other methods after this.

getResponseInfo

getResponseInfo(): ResponseInfo
Gets information about the ad response for this ad.
Returns
ResponseInfo A ResponseInfo object containing metadata about the loaded ad.

setPlacementId

setPlacementId(placementId): void
Sets the placement ID for this ad. Before presenting the ad, you must set this property.
Parameters
placementId: bigint The identifier for the placement in reporting.

show

show(onUserEarnedReward?): void
Shows the rewarded ad.
Parameters
Optional onUserEarnedReward: ((reward) => void) Callback triggered when the user finishes watching the ad and earns the reward.

Static load

load(request): Promise<RewardedAd>
Loads a rewarded ad.
Parameters
request: AdRequest The ad request configuration.
Returns
Promise<RewardedAd> A Promise that resolves to the loaded RewardedAd instance.