◉RORK LABJP
●ARCHIVE — Since 11/22 you can archive a Rork project instead of deleting it, and bring it back from Archived●PLAY FIX — Fixed: Expo apps built for Google Play losing their Rork AI key, which broke AI features●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 7 days left. Check which model your app calls●SPLASH — Expo users report apps stuck on the splash screen after rolling back to an earlier update●NEW — New: Three clues to check before replying to a "stuck on the splash screen" review●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 8 days left●ARCHIVE — Since 11/22 you can archive a Rork project instead of deleting it, and bring it back from Archived●PLAY FIX — Fixed: Expo apps built for Google Play losing their Rork AI key, which broke AI features●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 7 days left. Check which model your app calls●SPLASH — Expo users report apps stuck on the splash screen after rolling back to an earlier update●NEW — New: Three clues to check before replying to a "stuck on the splash screen" review●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 8 days left
Articles/Business
⟐ Business/2026-06-28Advanced

Don't Pay Out a Rewarded Ad on the Client's Word Alone — SSV Verification for a Rork (Expo) App on a Worker

Trusting the client-side 'reward earned' callback alone invites double-grants and spoofing. Here is how to wire AdMob server-side verification (SSV) into a Rork-generated Expo app, verify the signed callback on a Cloudflare Worker, and make payouts idempotent with transaction_id.

AdMob75RewardedSSVCloudflare Workers26Indie Dev40Rork621Monetization40

✦ Premium Article

I run a handful of wallpaper and calming-themed apps as a solo developer, and rewarded ads are how I give back a little something extra to the people who choose to watch one. One day, scanning my analytics, I noticed that for a few users the number of reward grants was clearly higher than the number of completed views. I had been granting rewards straight off the device's onUserEarnedReward, so a modified client was replaying the same signal over and over.

You should never pay out a rewarded ad based only on the device saying "I finished watching." The thing that protects you here is AdMob's server-side verification (SSV). In this article I'll wire SSV into a Rork-generated Expo app and implement the verification endpoint as a Cloudflare Worker, in code close to what I actually run.

Where trusting the device breaks

The client-side callback is convenient, but it lives outside your trust boundary. Modified apps, proxy replays, hammering from an emulator — all of it happens inside the device, so you can't tell the genuine signal from a forged one. When the reward is something with value, like in-app currency or subscription days, this is a direct revenue leak.

SSV replaces that signal with one that travels through Google's servers. When a user finishes watching, AdMob's server sends a signed callback to a URL you specify. The signature is produced with Google's private key, so you only need the matching public key to confirm "this really came from AdMob and wasn't tampered with." You trust the device for nothing.

ConcernClient callback onlyWith SSV
SpoofingIndistinguishableRejected by signature check
Replay (hammering)Goes throughIdempotent via transaction_id
Where reward is finalizedDevice (outside boundary)Your server (inside boundary)
OfflineCan grant instantlyFinalized after server is reached

The key distinction: SSV doesn't replace the client callback, it just moves the finalization of the reward to the server. You can still show the instant "reward earned" feedback on the device, but you only actually increase the balance after the Worker has finished verifying the signature.

Client side — tell SSV who to reward

First, on the device, attach your user ID to the SSV callback. In react-native-google-mobile-ads you pass serverSideVerificationOptions when you build the ad request. userId and customData come back later as the callback's custom_data parameter.

import { RewardedAd, RewardedAdEventType, TestIds } from 'react-native-google-mobile-ads';
 
const adUnitId = __DEV__ ? TestIds.REWARDED : 'ca-app-pub-xxxxxxxx/yyyyyyyy';
 
export function loadRewardedAd(userId: string, purpose: string) {
  const rewarded = RewardedAd.createForAdRequest(adUnitId, {
    serverSideVerificationOptions: {
      // comes back in the SSV callback's custom_data
      userId,
      customData: JSON.stringify({ purpose, ts: Date.now() }),
    },
  });
 
  rewarded.addAdEventListener(RewardedAdEventType.LOADED, () => rewarded.show());
 
  // Use the device signal only for instant UI flair. Don't touch the balance.
  rewarded.addAdEventListener(RewardedAdEventType.EARNED_REWARD, () => {
    showOptimisticRewardUI(); // keep it to a "granting…" indicator
  });
 
  rewarded.load();
}

Putting a timestamp and purpose into customData helps later when you reconcile against your server logs. The important part is not writing a balance update into the device's EARNED_REWARD. If you do, the original hole stays open no matter how good your SSV is.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦A complete Worker that fetches AdMob's public keys with a sub-24h cache and verifies the signature with ECDSA without slicing the signed query string wrong
✦An idempotency design that uses transaction_id as a KV key so a reward is granted exactly once even across Google's five retries
✦A payout flow that carries the user ID in custom_data and finalizes rewards independent of the device, resistant to spoofed views
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Business2026-04-26
Taking a Rork Max Native App Up the App Store Charts — The Order I Build Ads, StoreKit 2, and Subscriptions
The order I follow to grow a Rork Max SwiftUI app into one that stays near the top of its App Store category: a single AdGate that decides when ads may show, StoreKit 2 Transaction.updates monitoring, and where I draw the lines on ASO and retention — with working code.
⟐ Business2026-10-16
AdMob Balance Below the Payment Threshold for Months: Three Screens to Check Before You Worry
If AdMob earnings stay under the payment threshold (8,000 yen for yen accounts), the balance rolls over rather than disappearing. Here is what actually deserves a check: address verification, payment holds, and account deactivation, based on the Help pages.
⟐ Business2026-04-04
Rork App Revenue Design: Where Ads and Subscriptions Eat Each Other
How to layer AdMob, subscriptions, and one-time purchases in a Rork app without letting them cannibalize each other. Covers value-density placement, entitlement-first RevenueCat architecture, server-side receipt verification, and behavior-triggered paywalls.