# Setup

## Basic integration steps

### Install AATKit plugin package

Run below command with Flutter to add AATKit Flutter package to your project.

```shell
 $ flutter pub add aatkit_flutter_plugin
```

This will add a line like this to your package's pubspec.yaml (and run an implicit `flutter pub get`):

```yaml
dependencies:
  aatkit_flutter_plugin: ^LATEST_PLUGIN_VERSION
```

Alternatively, your editor might support `flutter pub get`. Check the docs for your editor to learn more.

### Import it

Now in your Dart code, you can use:

```dart
import 'package:aatkit_flutter_plugin/aatkit.dart';
```

Create `AatkitFlutterPlugin` object to access API:

```
final _aatkitFlutterPlugin = AatkitFlutterPlugin();
```

#### Google App ID

Google requires your app's Google App ID to be declared in your project. **This step is mandatory** — without it, your app will crash at launch.

To obtain your Google App ID, please contact our [support](mailto:support@gravite.net).

**Android**

Open `android/app/src/main/AndroidManifest.xml` and add the following inside the `<application>` tag:

```xml
<manifest>
    <application>
        <!-- ... your other config ... -->

        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX"/>
    </application>
</manifest>
```

Replace `ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX` with your actual Google App ID.

See also: [Google documentation for Android](https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk).

**iOS**

Open `ios/Runner/Info.plist` and add the following key inside the root `<dict>`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <!-- ... your other keys ... -->

    <key>GADApplicationIdentifier</key>
    <string>ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX</string>
</dict>
</plist>
```

Replace `ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX` with your actual Google App ID.

See also: [Google documentation for iOS](https://developers.google.com/admob/ios/quick-start#update_your_infoplist).

## Optional

### Configure dependencies

AATKit plugin allows you to selectively include or exclude SDK dependencies for both Android and iOS. These dependencies cover not only ad networks, but also other optional components such as CMPs (Consent Management Platforms) or utility libraries.

You can manage these dependencies directly in your `pubspec.yaml` file under the `aatkit_flutter_plugin` section.

#### iOS: Enable dependency management in Podfile

To enable proper iOS dependency management, set the `AATKIT_PROJECT_DIR` environment variable in your Podfile to the path of your Flutter project. This allows the plugin to read the dependency configuration from your `pubspec.yaml` .

Add the following line near the top of your `ios/Podfile`:

```ruby
# Path for AATKit plugin's dependency management.
ENV['AATKIT_PROJECT_DIR'] = __dir__
```

#### **Exclude default dependencies**

Some dependencies (mostly ad networks) are included by default. To exclude them from your build, list the dependency name under `dependencies_android` or `dependencies_ios` and set it to `false`.

#### **Include optional dependencies**

Other dependencies are optional and not included by default. To use them, add the dependency name and set it to `true`.

#### List of dependencies

**Android**

| Dependency name         | Included by default |
| ----------------------- | ------------------- |
| AppLovin                | ✅ Yes               |
| AppNexus                | ✅ Yes               |
| FacebookAudienceNetwork | ✅ Yes               |
| FeedAd                  | ✅ Yes               |
| GraviteRTB              | ✅ Yes               |
| InMobi                  | ✅ Yes               |
| IronSourceNew           | ✅ Yes               |
| Mintegral               | ✅ Yes               |
| MolocoBidding           | ✅ Yes               |
| Ogury                   | ✅ Yes               |
| Prebid                  | ✅ Yes               |
| PubNative               | ✅ Yes               |
| SmartAdServer           | ✅ Yes               |
| Tappx                   | ✅ Yes               |
| UnityAds                | ✅ Yes               |
| Vungle                  | ✅ Yes               |
| YOC                     | ✅ Yes               |
| AmazonHB                | ❌ No                |
| DisplayIO               | ❌ No                |
| Kidoz                   | ❌ No                |
| SuperAwesome            | ❌ No                |
| Teads                   | ❌ No                |
| GoogleCMP               | ❌ No                |
| SourcepointCMP          | ❌ No                |
| AppConsent              | ❌ No                |

#### iOS

| Dependency name         | Included by default |
| ----------------------- | ------------------- |
| AdMob                   | ✅ Yes               |
| AdX                     | ✅ Yes               |
| AppLovin                | ✅ Yes               |
| AppNexus                | ✅ Yes               |
| DFP                     | ✅ Yes               |
| FacebookAudienceNetwork | ✅ Yes               |
| GraviteRTB              | ✅ Yes               |
| InMobi                  | ✅ Yes               |
| IronSourceNew           | ✅ Yes               |
| MetaBidding             | ✅ Yes               |
| Mintegral               | ✅ Yes               |
| MolocoBidding           | ✅ Yes               |
| Ogury                   | ✅ Yes               |
| Prebid                  | ✅ Yes               |
| PubNative               | ✅ Yes               |
| SmartAdServer           | ✅ Yes               |
| UnityAds                | ✅ Yes               |
| Vungle                  | ✅ Yes               |
| YOC                     | ✅ Yes               |
| AmazonHB                | ❌ No                |
| DisplayIO               | ❌ No                |
| FeedAd                  | ❌ No                |
| Kidoz                   | ❌ No                |
| SuperAwesome            | ❌ No                |
| Tappx                   | ❌ No                |
| Teads                   | ❌ No                |
| GoogleCMP               | ❌ No                |
| SourcepointCMP          | ❌ No                |
| AppConsent              | ❌ No                |

#### **Example**

```yaml
aatkit_flutter_plugin:
  dependencies_android:
    AppLovin: false                 # Exclude default dependency
    AmazonHB: true                  # Include optional ad network
    GoogleCMP: true                 # Include optional CMP SDK

  dependencies_ios:
    FacebookAudienceNetwork: false  # Exclude default dependency
    Teads: true                     # Include optional ad network
    GoogleCMP: true                 # Include optional CMP SDK
```

#### Notes

* Dependency names are case-sensitive.
* If a dependency (or the entire `aatkit_flutter_plugin` section) is not specified in your `pubspec.yaml`, the plugin behaves as follows:
  * Default dependencies are included by default.
  * Optional dependencies are not included unless explicitly enabled.
* Define `dependencies_android` and `dependencies_ios` separately, depending on the platform requirements.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aatkit.gitbook.io/aatkit-flutter-integration/start/setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
