Rewarded Ads
Rewarded ads let users opt-in to watch a video ad in exchange for an in-app reward (extra lives, premium content, virtual currency, etc.).
Each ad format uses a Zone ID to identify the ad placement. Zone IDs are configured in the Empower dashboard.
Note: All ad status listeners are optional. The SDK handles ad loading and display automatically. Use listeners only if you need to track ad states for analytics, UI updates, or custom logic.
Quick Start
import 'dart:async';import 'dart:io';import 'package:empower_mobile_ads/empower_mobile_ads.dart';final zoneId = Platform.isAndroid ? 'ANDROID_ZONE_ID' : 'IOS_ZONE_ID';// Step 1: Preload the rewarded adEmpowerAds.loadRewardedAd(zoneId);// Step 2: Listen for rewardfinal subscription = EmpowerAds.onRewardedStatusChanged.listen((event) {final status = event['status'];if (status == 'REWARDED') {// User earned the reward — grant it heregrantReward();}});// Step 3: Show when user taps "Watch Ad" buttonvoid onWatchAdPressed() {EmpowerAds.showRewarded(zoneId);}
Loading Rewarded Ads
import 'package:empower_mobile_ads/empower_mobile_ads.dart';// Load with zone IDawait EmpowerAds.loadRewardedAd('YOUR_ZONE_ID');
The method returns a Future<bool> that resolves to true when the ad starts loading.
Showing Rewarded Ads
import 'package:empower_mobile_ads/empower_mobile_ads.dart';Future<void> showRewardedAd() async {final shown = await EmpowerAds.showRewarded('YOUR_ZONE_ID');if (!shown) {print('Rewarded ad not ready yet');}}
Listening to Rewarded Status (Optional)
import 'dart:async';import 'package:empower_mobile_ads/empower_mobile_ads.dart';final zoneId = 'YOUR_ZONE_ID';final subscription = EmpowerAds.onRewardedStatusChanged.listen((event) {final status = event['status'];switch (status) {case 'READY':// Ad is ready to be shown — enable "Watch Ad" buttonbreak;case 'REWARDED':// User earned the reward — grant it heregrantReward();break;case 'COMPLETE_PLAYING':// Video finished playingbreak;case 'SKIPPED':// User closed without completing — no rewardbreak;case 'FAILED':// Ad failed to load — disable "Watch Ad" buttonbreak;case 'USED':// Ad was closed — reload for next timeEmpowerAds.loadRewardedAd(zoneId);break;}});// Clean upsubscription.cancel();
Important: Only grant rewards when the status is
REWARDED. TheSKIPPEDstatus means the user closed the ad without completing it — do not grant a reward in this case.
Complete Example
import 'dart:async';import 'dart:io';import 'package:flutter/material.dart';import 'package:empower_mobile_ads/empower_mobile_ads.dart';class StoreScreen extends StatefulWidget {@overrideState<StoreScreen> createState() => _StoreScreenState();}class _StoreScreenState extends State<StoreScreen> {int _coins = 0;bool _adReady = false;StreamSubscription? _rewardedSub;final String _zoneId = Platform.isAndroid ? 'ANDROID_ZONE_ID' : 'IOS_ZONE_ID';@overridevoid initState() {super.initState();// Preload rewarded adEmpowerAds.loadRewardedAd(_zoneId);_rewardedSub = EmpowerAds.onRewardedStatusChanged.listen((event) {final status = event['status'];switch (status) {case 'READY':setState(() => _adReady = true);break;case 'REWARDED':setState(() => _coins += 100);ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('You received 100 coins!')),);break;case 'FAILED':setState(() => _adReady = false);break;case 'USED':case 'SKIPPED':setState(() => _adReady = false);EmpowerAds.loadRewardedAd(_zoneId); // Reload for next timebreak;}});}@overridevoid dispose() {_rewardedSub?.cancel();super.dispose();}@overrideWidget build(BuildContext context) {return Scaffold(body: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center,children: [Text('Coins: $_coins',style: const TextStyle(fontSize: 32, fontWeight: FontWeight.bold),),const SizedBox(height: 20),ElevatedButton(onPressed: _adReady ? () => EmpowerAds.showRewarded(_zoneId) : null,child: Text(_adReady ? 'Watch Ad for 100 Coins' : 'Loading...'),),],),),);}}
Status Flow
loadRewardedAd() → INITIALIZING → READY → showRewarded() → SHOWN → User watches → REWARDED → USED↓ ↓FAILED User skips → SKIPPED → USED
Best Practices
- Wait for SDK readiness — Load rewarded ads after the SDK has fully initialized. Listening for an
onBannerStatusChangedevent is a reliable signal that ad zones are parsed and ready. - Clear value exchange — Clearly communicate what reward users will receive before showing the ad
- User-initiated — Only show when users actively choose to watch (e.g., tapping a "Watch Ad" button)
- Grant rewards on REWARDED only — Only grant rewards on
REWARDEDstatus, notSKIPPEDorUSED - Reload after use — Load a new ad after each display
- Disable button while loading — Use the
READY/FAILEDstatus to toggle the "Watch Ad" button
Ad Status Reference
| Status | Description |
|---|---|
INITIALIZING | Ad is loading |
READY | Ad is loaded and ready to display |
FAILED | Ad failed to load |
SHOWN | Ad is being displayed |
COMPLETE_PLAYING | Video finished playing |
REWARDED | User earned the reward |
SKIPPED | User closed without completing |
USED | Ad was shown and closed |