LimitedRound 2 is open. Get your first month free, no extra charge.Join the waitlist ›
Wire in your backend

How to add AdMob ads to an iOS app

TL;DR. AdMob shows ads in an iOS app through the Google Mobile Ads SDK. You add the SDK, set your AdMob app ID in Info.plist, request App Tracking Transparency, and place ad units. AppFlight can wire the SDK in, and the app ID and ad unit IDs are client-side, not secrets.

What AdMob does for an iOS app

AdMob lets you earn revenue by showing ads: banners along the bottom of a screen, interstitials between screens, rewarded ads that grant something in exchange for watching. Google fills the ad inventory and pays out based on impressions and clicks. For an iOS app the work is adding the SDK, declaring your app ID, handling the tracking consent prompt, and placing ad views where they fit without hurting the experience.

Adding it with AppFlight, and manually

In AppFlight you ask for AdMob, and the AI adds the Google Mobile Ads SDK, the Info.plist app ID entry, the App Tracking Transparency request, and a banner view. AppFlight treats the app ID and ad unit IDs as client values, since there is no secret to protect. You can then ask the AI to add an ad-free tier gated behind a subscription.

Manually, you create an app and ad units in the AdMob console, add the Google Mobile Ads SDK, put the GADApplicationIdentifier key in Info.plist, call the SDK's start method at launch, request tracking authorization, and add the banner or interstitial views.

A SwiftUI example

Wrap the SDK's banner view so it works in SwiftUI:

import GoogleMobileAds
import SwiftUI

struct BannerView: UIViewRepresentable {
    func makeUIView(context: Context) -> BannerView {
        let banner = BannerView(adSize: AdSizeBanner)
        // Google's test banner ID. Replace with your real unit ID before release.
        banner.adUnitID = "ca-app-pub-3940256099942544/2934735716"
        banner.load(Request())
        return banner
    }
    func updateUIView(_ uiView: BannerView, context: Context) {}
}

Common pitfalls

Shipping with a test ad unit ID earns nothing, and shipping while clicking your own live ads can get your AdMob account suspended, so swap test IDs for real ones only at release. Forgetting the Info.plist app ID crashes the SDK at launch. Skipping the App Tracking Transparency prompt while still trying to use the IDFA breaks personalized ads and can fail review. Overloading screens with interstitials frustrates users and can trigger a rejection for disruptive ads, so read Apple's guidelines on ad placement.

FAQ

Do I need App Tracking Transparency for AdMob?

If your app uses the IDFA for personalized ads, yes. Apple requires the App Tracking Transparency prompt before accessing the IDFA. Without consent, ads still serve but are non-personalized, which usually lowers revenue.

Is the AdMob app ID a secret?

No. The AdMob app ID and ad unit IDs are client-side identifiers that ship in the app, set in Info.plist. There is no secret key for the iOS SDK. Use Google test ad unit IDs during development so you do not click your own live ads.

Can I show ads and sell a subscription?

Yes, and many apps offer a paid tier that removes ads. The subscription itself must use StoreKit in-app purchase under guideline 3.1.1. AdMob revenue is separate from that.

Sources

Build this app without opening Xcode.

AppFlight turns a plain-English prompt into a real native iOS app and ships it to the App Store. Round 2 is open: free for your first month.

Join the waitlist