> For the complete documentation index, see [llms.txt](https://docs.blueseasx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blueseasx.com/adapters/max.md).

# MAX

**Supported Ad Format**

* Interstitial
* Rewarded video
* Banner

### **1.  Integrate BlueSea SDK and Adapter**

### **Android**

To integrate BlueSea SDK and adapter, add dependencies like below into your `build.gradle` file

```
dependencies {
    implementation 'com.applovin:applovin-sdk:+'
    ...
    implementation 'com.blueseasx:bluesea-ads:1.8.1'
    implementation 'com.blueseasx:max-adapter:1.8.1.0'
}
```

To reduce video ad loading time, BlueSea SDK allows cleartext traffic to `127.0.0.1` by default in `AndroidManifest.xml`.

* `127.0.0.1` is a local server address used for 'download while playing', which speeds up ad loading and improves impression rates.
* Allowing cleartext traffic to `127.0.0.1` complies with Google policies.

```
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    ...
    <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">127.0.0.1</domain>
    </domain-config>
    ...
</network-security-config>
```

If a `networkSecurityConfig` conflict occurs after introducing the BlueSea SDK, you can replace the `android:networkSecurityConfig` attribute in the `AndroidManifest` file.

```
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <application
        ...
        android:networkSecurityConfig="@xml/network_security_config">
        tools:replace="android:networkSecurityConfig"
        ...
    </application>
</manifest>
```

The SDK requires network permissions to run. After introducing the BlueSea SDK, it will automatically add the network permission declaration in the `AndroidManifest.xml` file. Additionally, starting from Android 12, obtaining the GAID requires a declaration in the `AndroidManifest.xml`. To ensure optimal ad performance, the SDK will automatically add this declaration in the XML file, as shown below:

```
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
    <application
        ...
        android:networkSecurityConfig="@xml/network_security_config">
        tools:replace="android:networkSecurityConfig"
        ...
    </application>
</manifest>
```

In addition, the BlueSea SDK is using third-party dependency (`io.appmetrica.analytics:analytics`) to boost publishers’ yield. If your project has already involved this dependency, please read the following description carefully to prevent potential conflicts:&#x20;

The version of this dependency BlueSea used is `7.12.0`. If your project is using a version below than `7.12.0`, we recommend you to upgrade to `7.12.0` or higher version. While you are using a version higher than `7.12.0`, then you don’t have to make any changes.

### **iOS**

Include BlueSea Ads SDK and adapter via CocoaPods. Add below snippet in your Podfile and execute: `pod install --repo-update`

```
pod 'BlueSeaSDK', '1.4.1'
pod 'BlueSeaMaxAdapter', '1.4.1.0'
pod 'AppLovinSDK', '~> 13.2.0'
```

Update SKAdnetwork IDs. Please perform an incremental update of the IDs provided [here.](/ios/skadnetwork-ids.md)

### **2. MAX Setup**

### **Step1.  Add Custom Network**

Go to `MAX ➣ Mediation ➣ Manage ➣ Networks`. At the bottom of the page, click `Add Custom Network` to open the Manage Network page.

* **Network Type:** SDK
* **Name:**  BlueSea
* **Android Adapter Class Name**:  `com.applovin.mediation.adapters.BSXAdsMediationCustomAdapter`
* **iOS Adapter Class Name**: `ALBlueSeaMediationCustomAdapter`

<div align="left"><img src="/files/aziOmb4z2DAaLSYgpmTJ" alt="" height="384" width="717"></div>

<div align="left"><img src="/files/2TkluI1vXZ9SMmrMOKoE" alt="" height="395" width="719"></div>

### **Step2.  Ad Units Setup**

Go to `MAX ➣ Mediation ➣ Manage ➣ Ad Units` to configure Custom Networks:

* **App ID**: Enter the App ID generated when creating the app in the BlueSea dashboard.
* **Placement ID**: Enter the Placement ID created in the BlueSea dashboard.
* **CPM Price**: Enter the Floor Price set for the Placement ID in the BlueSea dashboard.

Click Save to complete the BlueSea Ad Unit configuration.

<div align="left"><img src="/files/lVHBQYYPLoyH1H2C9Iuh" alt="" height="374" width="712"></div>

### **3. Testing & Verification**

You can verify whether the BlueSea SDK and Adapter are integrated successfully using the steps below.

### **Step 1. Configure Test Device IDs**

Log in BlueSea’s console, navigate to `Integration > Test Device IDs`. Add the GAID/IDFA

<div align="left"><img src="/files/Qc7rUrPFxBr0JQY9qLi4" alt="" height="291" width="725"></div>

### **Step 2. Disable MAX Test Mode**

Turn off MAX Test Mode either by code or by removing the test device in the MAX dashboard.

> Ensure that MAX SDK Test Mode is disabled, because MAX SDK will not load custom adapters when Test Mode is enabled.

<div align="left"><img src="/files/4LGcBkInfYXAwIMgPlIZ" alt="" height="103" width="665"></div>

<div align="left"><img src="/files/jSinv7hRMmmtn4F0Dw8n" alt="" height="213" width="663"></div>

Next, enable `MAX Verbose Logging`.

```
AppLovinSdk.getInstance(this).settings.setVerboseLogging(true)
```

### **Step3. Configure MAX Ad Units**

Configure the live app id and placement ids on MAX, see [Step2.  Ad Units Setup](#step2.-a-d-units-setup). In the initial test stage, you can set higher price floors to ensure the max mediation sends ad requests to BlueSea.

### **Step4.  Test Ad**

Request and view ads. The following ad format is the BlueSea ad.

<div align="left"><img src="/files/XNWV8MKj4XlMykf9IIs7" alt="" height="496" width="244"></div>

<br>
