SDK Integration

Connect AMOS to your app.

Choose your app stack and copy the matching setup. AMOS supports Kotlin Android, React Native, and Flutter for telemetry, decisioning, and optional managed AdMob serving.

Connect to your app

Choose how you want to use AMOS

Need advanced native examples?

Install

Kotlin dependency setup

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}

dependencies {
    // AMOS controls AdMob load/show helpers
    implementation("com.yuktinai:amos-sdk-admob:1.0.16")

    // Or core-only/manual serving
    // implementation("com.yuktinai:amos-sdk:1.0.16")
}

Initialize

Start AMOS early in app startup

Monetization.init(
    context = applicationContext,
    apiKey = "YOUR_API_KEY",
    appId = "YOUR_APP_ID",
    userId = "publisher-user-123"
) {
    AmosAdMob.configure(PublisherAdMobConfigProvider.build())
    AmosAdMob.initialize(this)
}

Use

Track and show from app surfaces

Monetization.trackEventIfAllowed("image_selection")
Monetization.trackMetricIfAllowed("device_model", Build.MODEL)

AmosAdMob.showRewarded(
    activity = this,
    groupRef = "rewarded_bonus_claim",
    onRewardEarned = { grantCreditToUser() }
)

AmosAdMob.showInterstitial(
    activity = this,
    groupRef = "interstitial_level_end"
)

Install

React Native package setup

# Core AMOS only
npm install @amos-sdk/react-native@2.0.12

# AMOS + AdMob wrapper hooks/components
npm install @amos-sdk/react-native-admob@1.0.19

Provider

Initialize once near app root

import { AmosProvider } from '@amos-sdk/react-native-admob';

const amosConfig = {
  apiKey: 'YOUR_API_KEY',
  appId: 'YOUR_APP_ID',
  userId: 'publisher-user-123',
  bootstrap: {
    firstOpenEvent: 'first_open',
    metrics: ['platform', 'country', 'install_source', 'device_model'],
    installSourceFallback: 'other',
  },
  admob: {
    rewardedGroups: {
      default: { unitIds: ['ca-app-pub-xxx/222'], preloadOnInit: true },
    },
    bannerGroups: {
      default: { unitIds: ['ca-app-pub-xxx/333'] },
    },
  },
};

export default function App() {
  return (
    <AmosProvider config={amosConfig}>
      <RootNavigator />
    </AmosProvider>
  );
}

Use

Track events and call ad helpers

import { AmosBannerAd, useAmos } from '@amos-sdk/react-native-admob';

function RewardEntry() {
  const amos = useAmos();

  async function onRewardTap() {
    const rewarded = await amos.showRewarded('default');
    if (rewarded) {
      await amos.trackEvent('rewarded_ad_complete');
      grantCreditToUser();
    }
  }

  return <AmosBannerAd groupRef="default" />;
}

Install

Flutter package setup

# Core only
flutter pub add amos_flutter

# Add for AMOS-managed AdMob on Android
flutter pub add amos_flutter_admob

Initialize

Start core, then AdMob

final state = await AmosClient.instance.initialize(
  const AmosConfiguration(
    apiKey: String.fromEnvironment('AMOS_API_KEY'),
    appId: 'YOUR_APP_ID',
    externalUserId: 'stable-user-reference',
  ),
);

await AmosAdMob.instance.initialize();

Use

Track and show from Flutter

await AmosClient.instance.trackEvent('purchase_completed');

if (state.decision.ads.bannerEnabled) {
  // Add const AmosBannerAd() to the widget tree.
}

final load = await AmosAdMob.instance.preloadRewarded();
if (load.loaded) {
  final result = await AmosAdMob.instance.showRewarded();
  if (result.rewardEarned) grantReward();
}