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
Ad unit ID from the Ad Control console. Pass
null to skip ad instance creation.Return Values
Requests an ad.
Shows the ad.
Resets ad state and creates a new ad instance.
Whether the ad is loaded and ready to show.
Whether the ad is displayed on screen.
Whether the ad has been closed.
Whether the user has earned a reward.
Reward information (type and amount).
Error code (only present on error).
Whether the ad instance is ready for use.
Whether the ad has been clicked.
Whether the back button was pressed while the ad is displayed. Android only.
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
Ad unit ID from the Ad Control console.
Properties
Ad unit ID (read-only).
Whether the ad is loaded and ready to show (read-only).
Creative ID of the loaded ad (read-only).
Transaction ID (read-only).
Campaign ID of the loaded ad (read-only).
Destination URL of the loaded ad (read-only).
Browser target setting of the loaded ad (
BrowserTarget.EXTERNAL or BrowserTarget.INTERNAL) (read-only).Listener for receiving ad events.
Methods
Requests an ad. Results are delivered via
onAdReceived or onAdFailedToReceive listener callbacks.Shows the ad.
Releases ad resources. Should be called on component unmount.
AdropListener Interface
All callbacks are optional. Set only the ones you need.Callbacks
Called when ad is received successfully. You can call
show() from this point.Called when ad fails to receive. Check error code for failure reason.
Called when ad impression is recorded.
Called when user clicks the ad.
Called just before the ad screen is presented.
Called after the ad screen is fully presented.
Called just before the ad screen is dismissed.
Called after the ad screen is fully dismissed. Good time to preload next ad.
Called when ad fails to show. Check error code for failure reason.
Called when the user presses the back button while the ad is displayed. Android only.
Reward-specific Callback
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