Overview
Rewarded ads are full-screen ads where users receive rewards after watching the entire ad. Use them to provide rewards such as in-game items, additional content, etc.Key Features
- Full-screen ads that cover the entire screen
- Video ad support
- Reward event callbacks
- Reward type and amount information
- Separate load and show for flexible timing control
Use the test unit ID in development:
PUBLIC_TEST_UNIT_ID_REWARDEDAdropRewardedAd
Constructor
| Parameter | Type | Required | Description |
|---|---|---|---|
unitId | String | Y | Unit ID created in the Ad Control Console |
listener | AdropRewardedListener | N | Ad event listener |
Properties
| Property | Type | Description |
|---|---|---|
isLoaded | bool | Whether the ad is loaded |
unitId | String | Ad unit ID |
creativeId | String | Creative ID |
txId | String | Transaction ID |
campaignId | String | Campaign ID |
destinationURL | String | Destination URL |
browserTarget | BrowserTarget? | Browser target (external or internal) |
serverSideVerificationOptions | ServerSideVerificationOptions? | Server-side verification options (userId, customData) |
Methods
| Method | Return Type | Description |
|---|---|---|
load() | Future<void> | Loads the ad |
show() | Future<void> | Shows the ad on screen |
dispose() | Future<void> | Releases resources |
Basic Usage
AdropRewardedListener
A listener for handling rewarded ad events.Callbacks
Callback Descriptions
| Callback | Description |
|---|---|
onAdReceived | Called when ad loads successfully |
onAdClicked | Called when ad is clicked |
onAdImpression | Called when ad is displayed |
onAdWillPresentFullScreen | Called before ad is presented (iOS only) |
onAdDidPresentFullScreen | Called after ad is presented |
onAdWillDismissFullScreen | Called before ad is dismissed (iOS only) |
onAdDidDismissFullScreen | Called after ad is dismissed |
onAdFailedToReceive | Called when ad fails to load |
onAdFailedToShowFullScreen | Called when ad fails to show |
onAdEarnRewardHandler | Called when reward is earned |
Reward Handling
Reward Callback
Process reward information in theonAdEarnRewardHandler callback.
Reward Timing
Ad Recreation
Rewarded ads are one-time use. Once shown, an ad cannot be displayed again, so you must recreate the instance to load a new ad.Error Handling
Best Practices
1. Preload Ads
Preload ads so they can be shown immediately when users request rewards.2. Inform Users About Rewards
Clearly communicate the rewards users can receive before watching the ad.3. Show Ad Availability
Only enable the reward button when an ad is ready.4. Reward Reliability
It’s recommended to verify rewards on the server.5. Resource Management
Always dispose unused ad instances.Complete Example
Server-Side Verification (SSV)
Server-side verification allows you to securely verify reward grants on your server. SetServerSideVerificationOptions to include userId and customData in the server-to-server callback when the ad is loaded.
Setup
SetserverSideVerificationOptions before calling load().
ServerSideVerificationOptions
| Property | Type | Description |
|---|---|---|
userId | String? | User identifier for server-side verification |
customData | String? | Custom data string to include in the server callback |
Full Example
Backfill Ads
When backfill ads are enabled, backfill ads are automatically loaded when direct ads are unavailable. You can handle backfill-related errors using the error code.To use backfill ads, add the backfill dependency to native platforms. See Getting Started.
Next Steps
Popup Ads
Implement popup-style ads
Targeting
Set up targeting for personalized ads
Reference
Check types, methods, and error codes