On this page15 sections
  1. Prerequisites
  2. Connection With Previous Lectures
  3. Learning Objectives
  4. Lesson
  5. 1. The Steps
  6. 2. Test Safely With Real Ids
  7. 3. Policy Checklist
  8. 4. Before Release
  9. Code Examples
  10. Common Beginner Mistakes
  11. Best Practices
  12. Mini Challenge
  13. Practice Questions
  14. Practice Answers
  15. Key Takeaways

Lecture 010 — Going Live: Real Ids & Policies

Category4 — Going Live
Lecture010 of 010
Estimated video length20 min
TargetFlutter 3.44 · Dart 3.12 · google_mobile_ads 9
LevelBeginner
Source codeGitHub — urraan_admob_final

Everything so far used test ads. To earn, create your app in AdMob, create ad units, put the real ids in AdmobManager and follow the policies that keep your account safe.

Contents

Prerequisites · Connection · Objectives · Lesson · Code Examples · Common Mistakes · Best Practices · Mini Challenge · Practice Questions · Answers · Takeaways


Prerequisites

All previous lectures.


Connection With Previous Lectures

The demo is complete and tested. This last lecture is the checklist from "works on my phone" to "earns".


Learning Objectives

By the end of this lecture you will be able to:

  • Create an AdMob account, app and ad units
  • Replace the sample app ids and fill the real-id maps
  • Test with your own device safely
  • Follow the key policies

Lesson

1. The Steps

  1. Sign in at admob.google.com with your Google account.
  2. Apps → Add app. Choose Android or iOS and say whether it is published on a store.
  3. AdMob shows your app id (~). Replace the sample id in AndroidManifest.xml / Info.plist.
  4. Ad units → Add ad unit for each format. Copy each ad unit id (/).
  5. Paste them into _androidIds / _iosIds in AdmobManager.
  6. Set up Privacy & messaging (consent message) and Payments (address, bank).

2. Test Safely With Real Ids

Add your phone as a test device in the AdMob dashboard (Settings → Test devices) or with MobileAds.instance.updateRequestConfiguration(...) and the device id printed in the log. Then even real ids show test ads on that device.

3. Policy Checklist

  • Never tap your own ads or ask others to.
  • Do not place ads so users tap them by accident (banner next to buttons, overlays).
  • Do not show interstitials at app start, on exit, or during a task.
  • Describe a rewarded ad honestly before it plays.
  • Have a privacy policy and mention the ads in it.
  • Keep ad content appropriate for your audience; apps for children need special settings.

4. Before Release

CheckDone
App ids replaced (Android + iOS)☐
All ad unit ids filled in both maps☐
showTestAdsInDebug is fine for release (the release build ignores it)☐
Consent message published☐
Tested a release build on a test device☐

Code Examples

Example 1 — Release Build

bash
flutter build appbundle --release

Install the release build and confirm ads load (as test ads on your test device) before uploading to the store.


Common Beginner Mistakes

1. Leaving the sample app id in a release — no revenue; AdMob cannot match the app.

2. Empty ad unit ids — nothing loads.

3. Testing with real ads without a test device — risks invalid traffic.

4. No privacy policy — stores and AdMob can reject the app.


Best Practices

  • Use separate ad units per placement to compare earnings
  • Add yourself as a test device before touching real ids
  • Re-read the AdMob policies before each major release

Mini Challenge

Make a checklist file in your own project with the table above and tick it before each release.


Practice Questions

  1. What replaces the sample app id?
  2. Where do ad unit ids go in code?
  3. How do you test real ids safely?
  4. Name two policy rules.

Practice Answers

  1. The app id from your AdMob dashboard.
  2. In _androidIds / _iosIds of AdmobManager.
  3. Register a test device.
  4. Never tap your own ads; no interstitials during a task.

Key Takeaways

  • Real ids come from the AdMob dashboard
  • Test device first, then real ids
  • Follow policies to keep the account safe