1. Home
  2. Docs
  3. Documentation
  4. Core Modules
  5. Ads

Ads

Admob:

By default our apps use Google’s AdMob service to present ads to users via Native ads, the Ads logic lives in lib\services\AdsUtils.dart

In order to to serve your own Ads your need to follow these steps:

  • To get started with AdMob, first we must Sign up
  • Add a new app to your newly created AdMob account, so we can obtain our AdMob App ID

Android Setup

  • Navigate to android\app\src\main\AndroidManifest.xml
  • Add the following meta-data tag to your application tag
    <manifest>
      <application>
        <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
        <meta-data
          android:name="com.google.android.gms.ads.APPLICATION_ID"
          android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
      </application>
    </manifest>
  • Replace the android:value string with your AdMob App ID, You can find your App ID in the AdMob UI

iOS Setup

  • Navigate to ios\Runner\Info.plist
  • Add a GADApplicationIdentifier key with a string value of your AdMob app ID. You can find your App ID in the AdMob UI

    <key>GADApplicationIdentifier</key>
    <string>Your_Admob_App_ID</string>
  • Add embeded view support

    <key>io.flutter.embedded_views_preview</key>
    <true/>

Dart Setup

  • Navigate to lib\services\AdsUtils.dart
  • change AdsUtils.adUnitID  to your AdMob app ID. You can find your App ID in the AdMob UI

That’s it, now you should be able to see Ads that are connected to your AdMob account and start making revenue 🤑🤑