Google Mobile Ads Rewarded
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Software development
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides technical guidance for integrating rewarded ads using the Google Mobile Ads (GMA) SDK. It outlines the necessary steps to load ads, register callbacks, and implement user opt-in UI elements for Android, iOS, and Unity platforms. The skill emphasizes the requirement for user-initiated ad viewing and provides platform-specific implementation details, including mandatory threading considerations for Android and Swift-specific patterns for iOS.
What it does
- Provides step-by-step workflows for integrating rewarded ads.
- Details required imports and method signatures for Android implementation.
- Explains the use of async/await patterns for iOS rewarded ad loading.
- Highlights mandatory UI threading requirements for Android callbacks.
- Provides instructions for verifying build success across platforms.
- Defines the requirement for explicit user opt-in UI elements.
When to use it
- When you need to integrate rewarded ads into an Android, iOS, or Unity mobile application.
- When you are setting up the loading and display logic for rewarded ad units.
- When you need to troubleshoot build errors related to the Google Mobile Ads SDK.
- When you need to ensure proper callback handling and UI thread management for ad events.
Advantages
- Provides platform-specific guidance for Android, iOS, and Unity.
- Includes critical warnings regarding UI thread safety to prevent application crashes.
- Standardizes the workflow for ad loading and event registration.
- Offers clear verification steps to ensure successful project compilation.
Usage examples
- “How do I implement a rewarded ad in my Android app?”
- The agent will provide the required imports, the load method signature, and the mandatory UI threading instructions for Android.
- “What are the steps to show a rewarded ad in iOS?”
- The agent will outline the workflow including loading the ad, setting the fullScreenContentDelegate, and using the present method with a reward handler.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/google/google-mobile-ads-rewarded/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip google-mobile-ads-rewarded.zip -d .agents/skills
Documentation by Google
Google Mobile Ads SDK - Rewarded Ads
Rewarded ads reward users with in-app items for interacting with full-screen ads. Rewarded ads are served after a user explicitly opts in to view a rewarded ad.
Workflow
Determine the user's platform: Identify if the project is Android, iOS, or Unity. If unclear, ask before proceeding.
Read the platform guide for implementation details:
Android:
references/android-rewarded.mdiOS:
references/ios-rewarded.mdUnity:
references/unity-rewarded.md
Follow these steps in order:
[ ] Load the ad
[ ] Register for ad event callbacks
[ ] Add a UI element to view the ad for a reward
[ ] Show the ad
[ ] Verify the implementation
Files
- ATTRIBUTION.mdAdded by AutoGineer868 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md1.1 KiB
- references/android-rewarded.md2.4 KiB
- references/ios-rewarded.md1.5 KiB
- references/unity-rewarded.md3.8 KiB
references/android-rewarded.md
AI Integration Agent Instructions for Rewarded Ads
Required Imports
Use the following imports to implement a rewarded ad:
import com.google.android.libraries.ads.mobile.sdk.common.AdRequest
import com.google.android.libraries.ads.mobile.sdk.common.AdLoadCallback
import com.google.android.libraries.ads.mobile.sdk.common.FullScreenContentError
import com.google.android.libraries.ads.mobile.sdk.common.LoadAdError
import com.google.android.libraries.ads.mobile.sdk.rewarded.OnUserEarnedRewardListener
import com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAd
import com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAdEventCallbackMethod Signatures
Use the following method signatures to implement rewarded ads:
The AdRequest object takes the ad unit ID:
AdRequest.Builder(adUnitId: String).build()The method signature to load an ad from RewardedAd:
fun load(
adRequest: AdRequest,
adLoadCallback: AdLoadCallback<RewardedAd>
): UnitThe AdLoadCallback interface is defined as:
interface AdLoadCallback<T> {
fun onAdLoaded(ad: T): Unit
fun onAdFailedToLoad(adError: LoadAdError): Unit
}Gotchas
UI Threading: MANDATORY: Callbacks in GMA-Next Gen SDK are invoked on a
background thread. ALL UI-RELATED OPERATIONS (e.g., Toasts, View updates,
Fragment transactions) MUST be wrapped in runOnUiThread {} or
Dispatchers.Main.launch {} within GMA SDK callbacks. SKIPPING THIS STEP WILL
CAUSE THE APPLICATION TO CRASH.
Rewarded ad workflow
Load the ad
Register for ad event callbacks
[ ] Set the
adEventCallbackon theRewardedAdobject.Drop the reference to the rewarded ad when the ad is dismissed or fails to show.
Add a UI element to view the ad for a reward
Rewarded ads must never be shown automatically. Users must explicitly opt in.
Add a UI element, such as a button, that shows the ad upon user interaction.
Show the ad
The
show()method requires anOnUserEarnedRewardListener.
Verify the implementation: Verify the build to ensure there are no compile errors:
[ ] Run
gradle build -x testto confirm a successful clean build. Resolve any GMA SDK related compile errors.
Links
Additional documentation:
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/ads/google-mobile-ads-rewarded · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google or Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-mobile-ads-rewarded.zip