Floxis Unity LevelPlay adapter guide#
The Floxis LevelPlay adapter adds Floxis demand to an Android app that monetises with Unity LevelPlay. Floxis becomes a custom network in your LevelPlay waterfalls. When LevelPlay reaches a Floxis instance, the adapter runs one Floxis auction and renders the winning ad itself.
Availability. The adapter (tech.floxis:floxis-sdk-levelplay) is available from the next SDK release. You also
need the Floxis network key, which LevelPlay issues once Floxis is registered with Unity as a custom adapter network.
Until you have the key, LevelPlay cannot add Floxis to a waterfall. Contact your Floxis account manager for early
access and for the key.
Before you start, set up an endpoint for the app on the Supply page with Integration type Floxis SDK. Open
the saved endpoint. Its integration panel shows the app's seat (under Prebid Server URL), and the
Android setup code shows both values in one line: FloxisConfig(seat = "…", region = "…", …). You need only
the seat and region. The rest of the Android setup code and the AdMob setup sheet are for the AdMob integration, so
skip them.
How it works#
- LevelPlay calls Floxis. Your LevelPlay waterfall reaches the Floxis instance at the eCPM you set for it.
- Floxis auction. The adapter runs one auction for the instance's placement (1.5 s deadline by default, 0.10 USD floor).
- Render or pass. If Floxis has a bid, the adapter loads and shows the ad. If not, LevelPlay moves on down the waterfall as usual.
Floxis does not send LevelPlay a real-time price. Its position in the waterfall is the instance eCPM you enter in LevelPlay. Your endpoint's settings on the Supply page still apply to every auction.
| Format | Supported | Notes |
|---|---|---|
| Banner | Yes | Bids at the size LevelPlay asks for. A smart banner bids as 320x50, or 728x90 on screens wider than 720 dp. LevelPlay drives refresh, and each refresh is a new auction. |
| Interstitial | Yes | Display only (320x480, 480x320, 768x1024, 1024x768). |
| Rewarded | Yes | Video only. The request asks buyers for an end card (companion ad). |
| Native | No |
Requirements#
| Item | Version |
|---|---|
| Android | Minimum SDK 24. The adapter is compiled against API 34. |
| Unity LevelPlay SDK | com.unity3d.ads-mediation:mediation-sdk 9.6.1 (built and tested with this version) |
| Prebid Mobile | 3.4.0, brought in by the adapter and available to your code |
| Kotlin coroutines | org.jetbrains.kotlinx:kotlinx-coroutines-android 1.10.1, added by you |
The adapter does not need the Google Mobile Ads SDK or either Floxis AdMob artifact. Check any other LevelPlay version with your account manager before you ship it. The SDK release notes list what changed in each adapter version.
1. Add the adapter#
Add the Floxis repository to settings.gradle.kts. The exclusiveContent filter makes Gradle look there only for
tech.floxis packages:
dependencyResolutionManagement {
repositories {
google(); mavenCentral()
exclusiveContent {
forRepository { maven("https://maven.floxis.tech/releases") }
filter { includeGroup("tech.floxis") }
}
}
}Then add the dependencies to app/build.gradle.kts. Replace <version> with the release your account manager gives
you:
implementation("tech.floxis:floxis-sdk-levelplay:<version>")
implementation("com.unity3d.ads-mediation:mediation-sdk:9.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1")The adapter does not bring LevelPlay in, so the app always adds it. LevelPlay 9.6.1 needs the coroutines library at start-up but does not declare it.
The adapter brings in the shared Floxis runtime (floxis-sdk-common) and Prebid Mobile 3.4.0 as part of its API, so
your code can call TargetingParams (for COPPA or the store URL, see Privacy and consent) without adding Prebid
Mobile yourself. If the app also uses another Floxis artifact on a different version, Gradle raises them all to the
newest version in the build.
R8 / ProGuard. The adapter ships its own keep rules inside the AAR. You add no rules for Floxis. Keep the rules Unity asks you to add for LevelPlay itself.
Manifest. The adapter adds no permissions of its own. Prebid Mobile, which it brings in, merges INTERNET and
ACCESS_NETWORK_STATE into your manifest; LevelPlay declares the same two. Follow LevelPlay's own manifest steps for
anything else it needs.
2. Add Floxis as a custom network in LevelPlay#
In the LevelPlay platform, open the SDK networks setup for your app, choose to set up a custom network, and enter the Floxis network key. If you don't see a custom network option, ask Unity support to enable custom adapters for your account.
Open the new Floxis network and fill in the app-level settings:
Setting Value If left blank seatThe seat from your endpoint's integration panel. Required. Init fails regionThe region from the panel, for example us-e.us-etimeoutMsAuction deadline in whole milliseconds, 200–10000. 1500Type plain values, without quotes or units.
Create one Floxis instance per ad unit and format. Set its instance setting
configIdto your name for the placement (for examplehome_banner,level_end_interstitial). Floxis reports by placement, so give each placement its own name and keep it the same across app versions.Set each instance's eCPM, add the instances to your waterfalls, and save.
You never type a class name. The network key tells LevelPlay which classes to load from the adapter:
| LevelPlay loads | Class |
|---|---|
| Network | com.ironsource.adapters.custom.floxis.FloxisCustomAdapter |
| Banner | com.ironsource.adapters.custom.floxis.FloxisCustomBanner |
| Interstitial | com.ironsource.adapters.custom.floxis.FloxisCustomInterstitial |
| Rewarded | com.ironsource.adapters.custom.floxis.FloxisCustomRewardedVideo |
The adapter reports its version as the Floxis SDK version, and its network SDK version as the Prebid Mobile version (3.4.0).
3. App code#
There is no Floxis code to call. Initialise LevelPlay and load ads the way you already do, and LevelPlay calls the adapter. For example, in an Activity:
import com.unity3d.mediation.LevelPlay
import com.unity3d.mediation.LevelPlayAdError
import com.unity3d.mediation.LevelPlayAdInfo
import com.unity3d.mediation.LevelPlayConfiguration
import com.unity3d.mediation.LevelPlayInitError
import com.unity3d.mediation.LevelPlayInitListener
import com.unity3d.mediation.LevelPlayInitRequest
import com.unity3d.mediation.interstitial.LevelPlayInterstitialAd
import com.unity3d.mediation.interstitial.LevelPlayInterstitialAdListener
val interstitial = LevelPlayInterstitialAd("YOUR_INTERSTITIAL_AD_UNIT_ID").apply {
setListener(object : LevelPlayInterstitialAdListener {
override fun onAdLoaded(info: LevelPlayAdInfo) { }
override fun onAdLoadFailed(error: LevelPlayAdError) { }
override fun onAdDisplayed(info: LevelPlayAdInfo) { }
override fun onAdDisplayFailed(error: LevelPlayAdError, info: LevelPlayAdInfo) { }
override fun onAdClosed(info: LevelPlayAdInfo) { loadAd() }
})
}
LevelPlay.init(this, LevelPlayInitRequest.Builder("YOUR_LEVELPLAY_APP_KEY").build(), object : LevelPlayInitListener {
override fun onInitSuccess(configuration: LevelPlayConfiguration) { interstitial.loadAd() }
override fun onInitFailed(error: LevelPlayInitError) { }
})
// When the placement is reached:
if (interstitial.isAdReady) interstitial.showAd(this)Banners (LevelPlayBannerAdView) and rewarded ads (LevelPlayRewardedAd) work the same way. What the adapter does
for you:
- A loaded Floxis ad shows once. After the bid expires (the bid's own lifetime, 5 minutes by default) or consent is
withdrawn,
isAdReadyno longer counts the Floxis ad, and the next load runs a new auction. - Close and reward are each reported once per ad, even when LevelPlay starts the next load while an ad is still on screen. A reward that arrives just after the close is still reported.
- A rewarded bid whose video has neither a click-through nor an end card is declined as no fill, so it can't break the player.
One seat per app. The whole app process uses one Floxis seat, region and timeout. A second LevelPlay setup with
different values fails to initialise. If the app also uses another Floxis artifact (the AdMob, Next-Gen, Google Ad
Manager or MAX integration), give FloxisConfig the same seat, region and timeoutMs as the LevelPlay settings, call
Floxis.initialize first, and start LevelPlay from its callback. The two share one Prebid Mobile setup, so in a
debug build that artifact's testMode marks LevelPlay auctions as test traffic too.
4. Privacy and consent#
Your CMP must write the standard IAB keys to the app's default SharedPreferences. The adapter reads them on every
load and before every show. It runs no Floxis auction, and reports no fill, when any of these is true:
- you denied GDPR consent with
LevelPlayPrivacySettings.setGDPRConsent(false); - GDPR applies (
IABTCF_gdprApplies= 1) and there is no TCF string (IABTCF_TCString) or no consent to Purpose 1; - the US privacy string (
IABUSPrivacy_String) records an opt-out of sale; - an applicable GPP US section (national, a state, or US privacy) in
IABGPP_HDR_GppString/IABGPP_GppSIDrecords an opt-out of sale, sharing or targeted advertising.
LevelPlay does not pass LevelPlayPrivacySettings.setCCPA, setCOPPA, or the do_not_sell and
is_child_directed metadata to custom networks. Floxis never sees them, so US opt-outs must come from your CMP's
IAB strings.
Children (COPPA). Floxis does not refuse child-directed traffic; it passes your flag on to buyers. For a child-directed app or user, set the flag on Prebid Mobile after LevelPlay reports that initialisation succeeded, and again before each ad load. Prebid Mobile ignores the call until the Floxis network has started it, and keeps the flag only until the app process ends:
import org.prebid.mobile.TargetingParams
TargetingParams.setSubjectToCOPPA(true)The auction then runs with regs.coppa = 1. Read the SDK privacy and consent guide before you enable Floxis in an app
for children or in Google Play's Families program.
What is sent. When an auction runs, the adapter sends the placement, the app's store URL (call
TargetingParams.setStoreUrl to override the Play Store default), and device and session signals: dark mode, battery
level, charging, battery saver, ringer mute, impression depth and session length, and for rewarded video whether the
sound is muted (as playbackmethod). Impression depth counts the Floxis auctions in the session that carried these
signals, and more than 30 minutes without one starts a new session; the adapter shares this session with any other
Floxis artifact in the app. The adapter turns off location sharing before each auction and never asks for a
permission. Prebid Mobile forwards the TCF, US privacy and GPP strings with the request. Requests from users who
limited ad tracking or opted out have user IDs, the full IP address and the device and session signals removed at the
exchange. For the Play Data safety form, see the SDK privacy and consent guide.
5. Add the app-ads.txt line#
Buyers that check app-ads.txt will not bid on the app without the Floxis line. Add it to app-ads.txt at the root
of the developer website on the app's Play Store listing. The Floxis ads.txt, app-ads.txt and sellers.json Guide has the
details. Ask the dashboard assistant "what is my ads.txt line for Floxis" for the exact line for your account.
6. Test before release#
The adapter has no test mode of its own, so every Floxis auction is real traffic. Ask your account manager for a test seat, and keep test volume low.
Before
LevelPlay.init, enable LevelPlay's integration test suite, then open it once init succeeds:LevelPlay.setMetaData("is_test_suite", "enable") // in onInitSuccess: LevelPlay.launchTestSuite(applicationContext)The suite runs in portrait only. If it lists Floxis, check the adapter version and load each format from it. Either way, also load each Floxis ad unit from your own app code.
In a debug build, call
LevelPlay.setAdaptersDebug(true)and watch logcat. Floxis failures carry the messages in the table below.Check that an ad Floxis won shows, closes and (for rewarded) rewards through your LevelPlay listeners.
Remove the test suite and adapter debug calls before release.
Tell your account manager your placement names and the release date, so the first live traffic can be checked with you.
Troubleshooting#
| Message from the Floxis adapter | Code | What to do |
|---|---|---|
Invalid Floxis seat, region, or timeoutMs | 1002 | Fix the app-level settings: seat as shown in the panel, lowercase region, whole-number timeout 200–10000. |
Floxis process already configured for a different seat, region, or timeout | 1000 | Use one seat, region and timeout for the whole app. |
Prebid already initialized for another auction host or account | 1000 | Another Floxis artifact or Prebid integration in the app uses a different seat or region. Make them match. |
Prebid auction host or account differs from Floxis configuration | 1000 | Something else changed the Prebid Mobile setup while Floxis started. Start every Floxis artifact with the same seat and region, and don't point Prebid Mobile at another server. |
Floxis not initialized | 1000 | The Floxis network did not finish initialising. Check the init error logged before it. |
Floxis configuration differs from initialized network | 1000 | An instance has its own seat, region or timeoutMs that differs from the app-level settings. Clear it or make it match. |
Prebid auction host or account changed | 1000 | Another Prebid integration in the app changed the seat or server after Floxis started. Make them match. |
Missing configId | 1002 | Set configId on the instance. |
Invalid banner size | 1002 | LevelPlay asked for a banner with no width or height. Check the banner size in your code. |
Advertising restricted by privacy signals | 10001 | Expected: consent or an opt-out stopped the auction (no fill). See Privacy and consent. |
declined: rewarded VAST without ClickThrough or companion end card | 1000 | Expected: a rewarded bid that can't render was declined (no fill). |
Floxis interstitial unavailable / Floxis rewarded unavailable | 1001 | Already shown, expired, or consent withdrawn. Load again. |
| Prebid's no-bid message | 10001 | Normal no fill. LevelPlay continues down the waterfall. |
| Any other Prebid message (for example a timeout) | 1000 | LevelPlay continues down the waterfall. Raise timeoutMs only if timeouts are frequent. |
If LevelPlay logs failed to load or Failed to load adapter class for a Floxis class, the adapter is missing from
the app or the network key belongs to another network. Check the dependency, and check the key with your account
manager.
More documentation#
- SDK testing and troubleshooting: every adapter message and common problems.
- SDK API reference: the adapter classes and network settings.
- SDK release notes: what changed in each version.
Licence and sample app#
The adapter ships as signed binaries from maven.floxis.tech, under the licence published there. Your account manager
can share a sample app that loads each LevelPlay format on your seat.