Skip to main content

Overview

Rewarded ads are full-screen video ads that provide rewards such as in-game currency, lives, or hints when users watch the video to completion.

Key Features

  • Full-screen video ads
  • Rewards only provided when user completely watches the ad
  • User chooses to watch ad (e.g., “Watch video to get lives” button)
  • Configurable reward type and amount
Use test unit ID in development environment: PUBLIC_TEST_UNIT_ID_REWARDED

Implementation Steps

Implement rewarded ads in the following steps:
  1. Create AdropRewardedAd Instance - Create ad object with unit ID
  2. Set Delegate - Set delegate to handle ad events
  3. Load Ad - Request ad using load() method
  4. Show Ad - Display ad using show() method and handle rewards

Swift Example

Basic Implementation

SwiftUI Example


Objective-C Example


Delegate Methods

Required Methods

void
Called when ad is received successfully. You can show the ad using show() method from this point.
void
Called when ad fails to load. You can check the cause of failure through the error code.

Optional Methods

void
Called when ad impression is recorded and sent.
void
Called when user clicks the ad.
void
Called just before the ad screen is displayed. You can pause background music, etc.
void
Called after the ad screen is fully displayed.
void
Called just before the ad screen is dismissed.
void
Called after the ad screen is fully dismissed. You can resume background music or preload the next ad.
void
Called when ad fails to show. You can check the cause of failure through the error code.

Closure Callbacks

As an alternative to delegates, you can use closure-based callbacks.
If both a delegate and closures are set, both will be called.

Reward Handling

Reward Callback

Pass the reward callback through the userDidEarnRewardHandler parameter of the show() method.

Reward Type and Amount

  • type: Reward type set in Ad Control Console (integer value)
  • amount: Reward amount set in Ad Control Console (integer value)

Server-Side Verification

Server-side verification (SSV) allows you to verify reward grants on your server, preventing client-side manipulation. Use AdropServerSideVerificationOptions to pass user identification and custom data that will be included in the server-to-server callback.
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.

Setting Up SSV

AdropServerSideVerificationOptions

Set serverSideVerificationOptions before calling load(). The userId and customData values are sent to your server callback URL when the user earns a reward.

Best Practices

1. Preload Ads

Preload ads for better user experience.

2. Check Ad Ready State

Check if ad is loaded and update UI.

3. Background Music Handling

Control background music appropriately before and after showing ads.

4. Error Handling

Implement retry logic when ad loading fails.

5. Memory Management

Clean up ad object when ViewController is deallocated.

Testing

Test Unit ID

Always use a test unit ID during development.
Testing with a real unit ID may be considered invalid traffic and could result in account suspension. Always use a test unit ID.

Managing Unit IDs by Environment

Automatically switch unit IDs based on build configuration.

Interstitial Ads

Interstitial ad implementation guide

Error Codes

AdropErrorCode reference

Example Project

View complete example code