<br />

To deliver ads and earn revenue, integrate Google Mobile Ads Flutter Plugin into
your Flutter app. To prepare your project, you import and initialize
Google Mobile Ads Flutter Plugin before you request ads.

This guide covers importing and initializing Google Mobile Ads Flutter Plugin, and selecting an
ad format.

> [!IMPORTANT]
> **Important:** Google Mobile Ads Flutter Plugin only supports Android and iOS, and doesn't support web and desktop platforms.

## Prerequisites

Before you continue, you need the following:

- Flutter version 3.38.1 or higher.
- For Android, the latest Android Studio version.
- For iOS, the latest Xcode version with the enabled command-line tools. For details, see [Install Flutter](https://flutter.dev/docs/get-started/install/macos#install-xcode).
- An Ad Manager app ID. For details, see [Find an app ID or ad unit ID](https://support.google.com/admanager/answer/15014197).

## Import Google Mobile Ads Flutter Plugin

To import Google Mobile Ads Flutter Plugin in your Flutter project, see
[google_mobile_ads](https://pub.dev/packages/google_mobile_ads/install).

## Configure your app

After you import Google Mobile Ads Flutter Plugin, select one of the following platforms to
configure your app:

### Android

1. In Android Studio, navigate to the
   `android/app/src/main/AndroidManifest.xml` file.

2. In the `AndroidManifest.xml` file, add a `<meta-data>` tag to the
   `<application>` tag with the following properties:

   ```xml
   <manifest>
       <application>
           <!-- Sample Ad Manager 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>
   ```

   These properties must have the following values:
   - **`android:name`** : `com.google.android.gms.ads.APPLICATION_ID`.
   - **`android:value`**: your Ad Manager app ID.

   For details on setting up the `AndroidManifest.xml` file, see

   [Set up Google Mobile Ads SDK (Legacy)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start.md.txt).

### iOS

1. In Xcode, navigate to the `ios/Runner/Info.plist` file.
2. In the `Info.plist` file, add a `GADApplicationIdentifier`
   key with your Ad Manager app ID as a string.

   ```xml
   <key>GADApplicationIdentifier</key>
   <string>ca-app-pub-################~##########</string>
   ```

   For details on setting up a `Info.plist` file, see

   [Update your `Info.plist`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/quick-start.md.txt#update_your_infoplist).

## Initialize Google Mobile Ads Flutter Plugin

Before loading ads, initialize Google Mobile Ads Flutter Plugin by calling
[`MobileAds.instance.initialize()`](https://pub.dev/documentation/google_mobile_ads/latest/google_mobile_ads/MobileAds/initialize.html).

This method returns a `Future` that finishes after Google Mobile Ads Flutter Plugin initializes,
or after 30 seconds.

The following example initializes Google Mobile Ads Flutter Plugin:

```dart
// Initialize the Mobile Ads SDK.
MobileAds.instance.initialize();
```

## Select an ad format

After you import Google Mobile Ads Flutter Plugin, you can select an ad format to implement.
Ad Manager offers the following ad formats:

| Ad format | Description | Documentation |
|---|---|---|
| Banner | Shows rectangular ads in a designated area. These ads refresh automatically, letting users view ads while remaining on the same screen. | [Set up banner ads](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/banner.md.txt) |
| Interstitial | Shows full-page ads in your app. Place these ads at natural transition points, such as between game levels. | [Interstitial ads](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/interstitial.md.txt) |
| Native | Lets you customize assets, such as headlines and calls to action, in your apps. When you customize the ad, you create ads that match your app's visual design. | [Load a native ad](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/native.md.txt) |
| Rewarded | Lets users watch videos or take surveys to earn in-app rewards, like coins or extra lives. For each ad unit, you can specify reward values. | [Rewarded ads](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/rewarded.md.txt) |
| Rewarded interstitial | Lets you offer rewards, such as coins or extra lives, for ads that appear during app transitions. | [Rewarded interstitial ads](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/rewarded-interstitial.md.txt) |
| App open | Appears when users open or go back to your app. The ad overlays the loading screen. | [App open ads](https://developers.google.com/ad-manager/mobile-ads-sdk/flutter/app-open.md.txt) |