Overview
Rewarded ads are full-screen video ads that provide users with in-game currency, extra lives, hints, or other rewards when they watch the video to completion.Key Features
- Full-screen video ads
- Rewards only provided when user fully watches the ad
- User chooses to watch the ad (e.g., “Watch video to get a life” button)
- Configurable reward type and amount
Use test unit IDs in development environments.
Implementation Methods
Rewarded ads can be implemented in two ways:- Class Method - Using
AdropRewardedAdclass directly - Hook Method - Using
useAdropRewardedAdHook (recommended)
Hook Method Implementation (Recommended)
Use React Hooks for a more concise and React-like implementation.Basic Example
useAdropRewardedAd Hook
The Hook automatically manages ad state.Parameters
string | null
Ad unit ID from the Ad Control console. Pass
null to skip ad instance creation.Return Values
() => void
Requests an ad.
() => void
Shows the ad.
() => void
Resets ad state and creates a new ad instance.
boolean
Whether the ad is loaded and ready to show.
boolean
Whether the ad is displayed on screen.
boolean
Whether the ad has been closed.
boolean
Whether the user has earned a reward.
{ type: number, amount: number } | undefined
Reward information (type and amount).
string | undefined
Error code (only present on error).
boolean
Whether the ad instance is ready for use.
boolean
Whether the ad has been clicked.
boolean
Whether the back button was pressed while the ad is displayed. Android only.
BrowserTarget | undefined
Browser target setting of the loaded ad (
BrowserTarget.EXTERNAL or BrowserTarget.INTERNAL).Class Method Implementation
You can implement ads using theAdropRewardedAd class directly.
Basic Example
AdropRewardedAd Class
Constructor
string
Ad unit ID from the Ad Control console.
Properties
string
Ad unit ID (read-only).
boolean
Whether the ad is loaded and ready to show (read-only).
string
Creative ID of the loaded ad (read-only).
string
Transaction ID (read-only).
string
Campaign ID of the loaded ad (read-only).
string
Destination URL of the loaded ad (read-only).
BrowserTarget
Browser target setting of the loaded ad (
BrowserTarget.EXTERNAL or BrowserTarget.INTERNAL) (read-only).AdropListener | undefined
Listener for receiving ad events.
Methods
void
Requests an ad. Results are delivered via
onAdReceived or onAdFailedToReceive listener callbacks.void
Shows the ad.
void
Releases ad resources. Should be called on component unmount.
AdropListener Interface
All callbacks are optional. Set only the ones you need.Callbacks
void
Called when ad is received successfully. You can call
show() from this point.void
Called when ad fails to receive. Check error code for failure reason.
void
Called when ad impression is recorded.
void
Called when user clicks the ad.
void
Called just before the ad screen is presented.
void
Called after the ad screen is fully presented.
void
Called just before the ad screen is dismissed.
void
Called after the ad screen is fully dismissed. Good time to preload next ad.
void
Called when ad fails to show. Check error code for failure reason.
void
Called when the user presses the back button while the ad is displayed. Android only.
Reward-specific Callback
void
Called when user has watched the ad to completion and earned a reward.
type: Reward type set in the Ad Control console (integer)amount: Reward amount set in the Ad Control console (integer)
Reward Handling
Hook Method Reward Handling
Class Method Reward Handling
Server-Side Verification
You can verify reward grants on your server to prevent fraud. UsesetServerSideVerificationOptions() to pass user and custom data that will be included in server-side verification callbacks.
To receive SSV callbacks on your server, register a callback URL in the console: [Management] > [Integrations] > Reward Ad SSV. The
userId and customData set here are included in the encrypted payload sent to that URL. See the Reward Ad SSV guide for payload decryption and setup.Setup
ServerSideVerificationOptions
userId(string, optional): User identifier sent in the server callbackcustomData(string, optional): Custom data sent in the server callback
setServerSideVerificationOptions() should be called before load(). The options are sent to the server when the user earns a reward.Testing
Test Unit IDs
Always use test unit IDs during development. Testing with real unit IDs may result in invalid traffic and account suspension.Error Handling
Hook Method Error Handling
Class Method Error Handling
Best Practices
1. Preload Ads
Preload ads for better user experience.2. Check Ad Ready State
Check if ad is loaded and update UI accordingly.3. Memory Management
Clean up ad resources on component unmount.4. Error Handling
Improve user experience with proper error handling.Complete Example
Hook Method Complete Example
Backfill Ads
To use backfill ads, you must have the backfill dependency added to your native platforms (Android/iOS).
Related Documentation
Interstitial Ads
Interstitial ad implementation guide
Popup Ads
Popup ad implementation guide
Native Ads
Native ad implementation guide
Error Codes
Error code reference