Skip to main content
Version: v2.0

PremiumAds AppLovin MAX Adapter — Cocos Creator

Integrate PremiumAds as a mediation ad source in your Cocos Creator game through AppLovin MAX.

Supported formats: Banner, MREC, Interstitial, Rewarded, Native

App Open is not supported.

Reference repo: premium-ads/max-adapter-cocos-creator

What this is

AppLovin MAX loads the PremiumAds adapter natively when the MAX dashboard maps a placement to it. You integrate the AppLovin MAX SDK natively in your Cocos Creator project (Gradle on Android, CocoaPods on iOS) exactly as you normally would — this integration does not replace or wrap the MAX SDK. It only adds:

  1. The PremiumAds adapter dependency to your generated native project (Gradle/Podfile snippets below).
  2. A tiny native bridge + TS plugin so you can optionally toggle verbose adapter logging from script code.

This is a copy-in integration, not a sample app: copy the files below into your existing Cocos Creator project.

Prerequisites

  • Cocos Creator with the AppLovin MAX SDK already integrated natively (Android + iOS)

1. Copy the TS Plugin

Copy assets/PremiumAdsMaxAdapter/ from the reference repo into your project's assets/ folder as-is. It contains PremiumAdsMaxAdapter.ts — the plugin's only method is setDebug().

2. Android Bridge

Copy native/android/PremiumAdsMaxAdapterBridge.java into your generated (or persisted native/engine/android/) Android project, preserving its package path net/premiumads/cocos/. See native/README-android.md in the reference repo for exact paths.

Add the adapter AAR to your app module's build.gradle:

repositories {
maven { url 'https://repo.premiumads.net/artifactory/mobile-ads-sdk/' }
}

dependencies {
implementation 'net.premiumads.sdk:max-adapter:1.0.0'
}

3. iOS Bridge

Copy native/ios/PACMaxPremiumAdsAdapter.h and .mm into your generated (or persisted native/engine/ios/) Xcode project's Classes/ folder. See native/README-ios.md for exact paths.

Add the adapter pod to your Podfile:

pod 'PremiumAdsMaxAdapter', '~> 1.0.1'

Then pod install and rebuild.

4. Configure the MAX Custom Network

In the AppLovin MAX dashboard, add PremiumAds as a Custom Network:

FieldValue
Network namePremiumAds Custom Adapter
iOS classPremiumAdsAdapter
Android classnet.premiumads.sdk.adapter.max.PremiumAdsAdapter
PlacementYour PremiumAds ad unit ID

5. Use the API in TypeScript

Optional — turn on verbose adapter logs while testing:

import { PremiumAdsMaxAdapter } from './PremiumAdsMaxAdapter/PremiumAdsMaxAdapter';

PremiumAdsMaxAdapter.setDebug(true);

Logs are tagged [PremiumAdsAdapter]:

  • Android Logcat: filter tag:PremiumAdsAdapter
  • iOS Xcode console: prefix [PremiumAdsAdapter]

setDebug is a no-op on web/editor builds (jsb.reflection is unavailable there).

For ad loading, use the AppLovin MAX Cocos Creator SDK API directly — the PremiumAds adapter is invoked by MAX's waterfall, not by your TS code.

6. Build & Run

In the Cocos Creator editor:

  1. Project → Build → Android (or iOS)
  2. Select platform options, click Build
  3. After build completes, click Make (Android Studio) or Open in Xcode (iOS) to compile & run on device/emulator

Troubleshooting

PremiumAdsMaxAdapter.setDebug does nothing on web/preview: expected. jsb.reflection.callStaticMethod only exists on Android/iOS native builds. Test on a device.

Adapter never appears in MAX's initialization log: confirm the AAR/Pod is actually linked (./gradlew :app:dependencies | grep premium, pod list | grep PremiumAds).

New ad units / waterfall changes don't take effect immediately: Changes to ad units or waterfall configuration in the MAX dashboard take 30–60 minutes to propagate.

Ads never load / NO FILL (HTTP 204): A NO FILL response means the waterfall has no eligible line item for the requesting app/device — check that your ad unit has active demand and that the app's bundle/package ID matches the app configured in the MAX dashboard.

What gets shipped

PremiumAds Cocos Creator integration is mediation custom-event only — your game uses the AppLovin MAX Cocos Creator SDK to load ads. The PremiumAds adapter activates only when MAX's waterfall picks it for a given ad unit.

Source Code

Documentation

Support

Contact your PremiumAds account manager or email [email protected]