RewardedInterstitialAd
import { RewardedInterstitialAd } from 'nitro-ui-admob'
A full-screen ad shown at transition points that grants a reward when watched, without an opt-in. Each loaded ad can be shown once, within one hour of loading. Guide: rewarded ads.
It has the same members as RewardedAd; only load resolves with a RewardedInterstitialAd.
| Member | Description |
|---|---|
load(adUnitId, options?) | Loads an ad. |
expiresAt | When the ad expires, one hour after loading. |
reward | The reward the ad grants. |
onUserEarnedReward | Called when the user earned the reward. |
setServerSideVerificationOptions(options) | Data for your server-side verification callback. Call before show(). |
show() | Presents the ad once; throws if shown or expired. |
| Callbacks | The shared full-screen events. |
load
static load(adUnitId: string, options?: AdmobRequestOptions): Promise<RewardedInterstitialAd>
Loads an ad, starting the SDK if needed. options is an AdmobRequestOptions. Rejects with "<code>: <message>" from the SDK.
const ad = await RewardedInterstitialAd.load(Admob.testAdUnitId('rewardedInterstitial'))
ad.onUserEarnedReward = (reward) => grant(reward.amount, reward.type)
ad.show()