> 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/topon.md).

# TopOn

**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 {
    ...
   # if your topon sdk version is or lower than 6.5.10, please add
    implementation 'com.blueseasx:bluesea-ads:1.8.1'
    implementation 'com.blueseasx:topon-adapter-v6510:1.8.1.0' 

   # if your topon sdk version is higher than 6.5.10, please add
    implementation 'com.blueseasx:bluesea-ads:1.8.1'
    implementation 'com.blueseasx:topon-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 'BlueSeaTopOnAdapter', '1.4.1.0'
pod 'TPNiOS', '~> 6.4.94'
```

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

### **2. TopOn Setup**

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

Go to `Network page`, click on `+Custom Network Firm`

<div align="left"><img src="/files/6aBzbQd0OgPMFzuZK9Fe" alt="" height="265" width="695"></div>

In `Add Custom Network Firm Page`, input

* **Network Firm Name**: `BlueSea`
* **Account Name**: `BlueSea`

**Android Adapter’s Class names**：

* **Reward**: `com.anythink.bluesea.adapter.BlueseaRewardVideoCustomAdapter`
* **Banner**: `com.anythink.bluesea.adapter.BlueseaBannerCustomAdapter`
* **Interstitial**: `com.anythink.bluesea.adapter.BlueseaInterstitialCustomAdapter`

<div align="left"><img src="/files/XD8aRy3vuK33t3lT6MDQ" alt="" height="274" width="312"> <img src="/files/pVO8uAsDN1gkE44kjyE6" alt="" height="275" width="320"></div>

### **Step2. Associate Network**

In the `Application page`, find the targeted application that integrates with BlueSea SDK, click on `+Associate Network`.

<div align="left"><img src="/files/m0snci2rYHu4x3C1j2YP" alt="" height="310" width="690"></div>

In the `Network page`, input:

* **Network Firm**：`BlueSea`
* **App Dimension Parameters**：input `app_id` generated from BlueSea console

<div align="left"><img src="/files/lPemLOvzdfxbIBNNNHps" alt="" height="344" width="408"></div>

### **Step3. Configure Placement ID**

In the `Mediation` page, click on `+Add Ad Source` under the targeted app and placements

<div align="left"><img src="/files/YI5WObI8LUfaQLqZLZQE" alt="" height="292" width="693"></div>

In the `Add Ad Source` page, select BlueSea:

* **Slot ID**：Input BlueSea placement ID created on BlueSea platform
* **Ad Source Dimension Parameters**: input pid and its value created on BlueSea platform

**Header Bidding：**

* If your BlueSea placement ID is client bidding , then select Yes

<div align="left"><img src="/files/9vQEoLKcX5J3v8gwYH2L" alt="" height="462" width="463"></div>

* If your BlueSea placement ID is waterfall , then select No, and input the floor price that you’ve created on BlueSea platform

<div align="left"><img src="/files/zUKoij2zcSYm3VQFhXJe" alt="" height="410" width="456"></div>

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

Log in BlueSea’s console, navigate to `Integration > Test Device IDs`. Add the GAID/IDFA, use the live app id and placement ids to request ads for integration validation.

<img src="/files/vnynggdPMWEdhAhxWSNN" alt="" height="291" width="725">

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

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

<br>
