AdMob Integration
Important: Add monetization to your app only after you’ve published it to the app stores. Implementing ads too early in your development process can lead to account issues with Google AdMob.
When to Add AdMob
The BuildWithAI boilerplate comes with AdMob integration ready to be enabled, but we recommend following this timeline:- First develop and test your core app functionality
- Publish your app to App Store and Google Play
- Then set up AdMob and implement monetization
Setup Process Overview
1
Create AdMob Account
Sign up for an AdMob account at admob.google.com if you don’t already have one.
2
Register Your App in AdMob
In the AdMob console:
- Click “Apps” in the left sidebar, then “Add app”
- Select platform (iOS or Android)
- When asked “Is the app listed on a supported app store?” select “Yes”
- Enter your app’s store information
3
Get App IDs for Configuration
After registering your app:
- In the AdMob console, go to “Apps” in the sidebar
- Click on your app to view its details
- Find and copy these essential IDs:
- iOS App ID: Starts with
ca-app-pub-
(needed for app.json) - Android App ID: Starts with
ca-app-pub-
(needed for app.json)
- iOS App ID: Starts with
Implementation
Follow the implementation instructions in theintegrations/admob/README.md
file included in your boilerplate codebase. This file contains all necessary steps for setting up AdMob in your application.
Creating and Configuring Ad Units
When testing your app, always use test ad units. Using production ad units during development can lead to account suspension.
- In AdMob console, click “Add ad unit”
- Configure your ad unit:
- Select ad format (Banner, Interstitial, etc.)
- Name your ad unit (e.g., “Main Screen Banner”)
- Leave partner bidding unchecked for simplicity
- Click “Create ad unit” and copy the generated ad unit ID
- Go to the Expo dashboard: expo.dev
- Navigate to your project’s environment variables:
https://expo.dev/accounts/[account]/projects/[project]/environment-variables/new
- Add the following variables (production only):
Only enable these variables for Production builds. Make sure “Preview” and “Development” environments are unchecked.
Testing Your Configuration
- Test with Development Build: Open your development build and navigate to screens with ads
- Verify Test Ads: Ensure test ad units are displaying correctly
- Check Console: Look for any AdMob-related errors in the console
- Test Different Ad Formats: Verify banner, interstitial, and other ad types work properly
Additional Resources
- Google AdMob Documentation
- Expo AdMob Guide
- Supabase Setup - Required for authentication