Integrate AdTogether
"Show an ad, get an ad shown" — the reciprocal ad exchange designed to increase conversions and grow your application's audience globally.
Step 1: Create your Developer Account
Before you can integrate any SDK, you must first create a developer account to generate your appId and configure your ad units.
* Integration will not work without a valid appId from the dashboard.
Are you an AI Coding Assistant?
We have provided optimized, machine-readable documentation files perfectly tuned for LLMs. Scroll down to the Integration Guides section below and click the "LLM" badge next to the platform you are building for to get the specific integration context, endpoints, and code snippets.
Standard Ad Formats
SDK Architecture
AdTogether is distributed as five separate SDK packages — each optimized for its target platform. The Flutter SDK is special: it wraps the native Android and iOS cores under the hood, giving Flutter developers a single Dart API that works everywhere.
Developer Entry Points
Platforms Served
How the Flutter SDK works internally
lib/Unified Dart API — AdTogetherBanner, AdTogetherInterstitial, initialization.
android/Kotlin plugin — uses Platform Channels to call the native Android ad renderer.
ios/Swift plugin — uses Platform Channels to call the native iOS ad renderer.
On Flutter Web, the SDK renders ads using an HtmlElementView that loads the Web SDK (sdk.js) under the hood — no native plugin required.
Integration Guides
REST API endpoints
LLMFor complete control, or if you are building an integration for a custom platform, you can directly interact with the AdTogether Ad Serving REST API.
Fetch Ad
curl -X GET "https://adtogether.relaxsoftwareapps.com/api/ads/serve?country=global"Track Impression
curl -X POST "https://adtogether.relaxsoftwareapps.com/api/ads/impression" \
-H "Content-Type: application/json" \
-d '{"adId": "123456", "token": "HMAC_TOKEN_FROM_FETCH"}'Web SDK
LLMEmbed ads into any webpage using our lightweight script. Zero dependencies — works with any framework.
Distribution
NPM Package (React/Next.js) or CDN-hosted script tag.
1. Install (React/Next.js)
npm install @adtogether/web-sdk2. Usage (React)
"use client";
import { useState } from 'react';
import { AdTogether } from '@adtogether/web-sdk';
import { AdTogetherBanner, AdTogetherInterstitial } from '@adtogether/web-sdk/react';
if (typeof window !== 'undefined') {
AdTogether.initialize({ appId: 'YOUR_APP_ID' });
}
export default function MyComponent() {
const [showAd, setShowAd] = useState(false);
return (
<div>
{/* Banner Ad */}
<AdTogetherBanner
adUnitId="YOUR_AD_UNIT_ID"
onAdLoaded={() => console.log('Ad loaded!')}
/>
{/* Interstitial Ad */}
<button onClick={() => setShowAd(true)}>Show Interstitial</button>
<AdTogetherInterstitial
adUnitId="YOUR_AD_UNIT_ID"
isOpen={showAd}
onClose={() => setShowAd(false)}
onAdLoaded={() => console.log('Interstitial loaded!')}
/>
</div>
);
}Alternative: Plain HTML (CDN)
<script src="https://adtogether.relaxsoftwareapps.com/sdk.js" defer></script>
<!-- Banner Ad -->
<div id="adtogether-ad" data-ad-unit="YOUR_AD_UNIT_ID"></div>Flutter SDK
LLMOne Dart package — full cross-platform coverage. Uses native platform channels on mobile and the Web SDK under the hood for Flutter Web.
Distribution
pub.dev package
1. Install
flutter pub add adtogether_sdk2. Initialize
import 'package:adtogether_sdk/adtogether_sdk.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AdTogether.initialize(appId: 'YOUR_APP_ID');
runApp(MyApp());
}3. Show Ad
// Show Banner
AdTogetherBanner(
adUnitId: 'YOUR_AD_UNIT_ID',
size: AdSize.banner,
onAdLoaded: () => print('Ad loaded!'),
onAdFailedToLoad: (e) => print('Error: $e'),
)
// Show Interstitial
AdTogetherInterstitial.show(
context: context,
adUnitId: 'YOUR_AD_UNIT_ID',
closeDelay: const Duration(seconds: 3),
onAdLoaded: () => print('Interstitial loaded!'),
);Native iOS SDK
LLMPure Swift SDK for native iOS and iPadOS apps. Distributed via Swift Package Manager.
Distribution
Swift Package Manager — add via Xcode or Package.swift
1. Add Package
.package(
url: "https://github.com/undecided2003/AdTogether.git",
from: "0.1.27"
)2. Initialize & Display
import AdTogether
@main
struct MyApp: App {
init() {
AdTogether.initialize(appId: "YOUR_APP_ID")
}
var body: some Scene {
WindowGroup { ContentView() }
}
}
struct ContentView: View {
@State private var showAd = false
var body: some View {
VStack {
Text("My App")
// Banner Ad
AdTogetherView(
adUnitId: "YOUR_AD_UNIT_ID",
onAdLoaded: { print("Ad loaded!") }
)
.frame(height: 50)
// Interstitial Ad
Button("Show Interstitial") {
showAd = true
}
.fullScreenCover(isPresented: $showAd) {
AdTogetherInterstitialView(
adUnitId: "YOUR_AD_UNIT_ID",
closeDelay: 3,
onAdLoaded: { print("Interstitial loaded!") }
) { showAd = false }
}
}
}
}Native Android SDK
LLMKotlin-first SDK for native Android apps. Distributed via Maven Central.
Distribution
Maven Central — add to build.gradle.kts
1. Add Dependency
dependencies {
implementation("com.relaxsoftwareapps.adtogether:sdk:0.1.27")
}2. Initialize & Display
import com.adtogether.sdk.AdTogether
import com.adtogether.sdk.views.AdTogetherView
import com.adtogether.sdk.views.AdTogetherInterstitial
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
AdTogether.initialize(this, "YOUR_APP_ID")
}
}
@Composable
fun MainScreen() {
var showAd by remember { mutableStateOf(false) }
Column {
Text("My App")
// Banner Ad
AdTogetherView(
adUnitId = "YOUR_AD_UNIT_ID",
modifier = Modifier.fillMaxWidth().height(50.dp),
onAdLoaded = { println("Ad loaded!") }
)
// Interstitial Ad
Button(onClick = { showAd = true }) {
Text("Show Interstitial")
}
if (showAd) {
AdTogetherInterstitial(
adUnitId = "YOUR_AD_UNIT_ID",
closeDelay = 3,
onDismiss = { showAd = false },
onAdLoaded = { println("Interstitial loaded!") }
)
}
}
}React Native SDK
LLMOfficial support for React Native applications. Easy drop-in components to monetize your mobile apps.
Distribution
NPM Package
1. Install
npm install @adtogether/react-native-sdk2. Initialize
import { AdTogether } from '@adtogether/react-native-sdk';
// Call before rendering ad components
AdTogether.initialize({ appId: 'YOUR_APP_ID' });3. Usage
import { useState } from 'react';
import { View, Button } from 'react-native';
import {
AdTogetherBanner,
AdTogetherInterstitial
} from '@adtogether/react-native-sdk';
export default function MyScreen() {
const [showAd, setShowAd] = useState(false);
return (
<View style={{ flex: 1 }}>
{/* Banner Ad */}
<AdTogetherBanner
adUnitId="YOUR_AD_UNIT_ID"
onAdLoaded={() => console.log('Ad loaded!')}
/>
{/* Interstitial Ad */}
<Button
title="Show Interstitial"
onPress={() => setShowAd(true)}
/>
<AdTogetherInterstitial
adUnitId="YOUR_AD_UNIT_ID"
isOpen={showAd}
onClose={() => setShowAd(false)}
onAdLoaded={() => console.log('Interstitial loaded!')}
/>
</View>
);
}

