Floxis for Unity LevelPlay (Android and iOS)#
The Floxis LevelPlay adapter adds Floxis demand to an Android or iOS app that monetises with Unity LevelPlay. Floxis becomes a custom network in your LevelPlay waterfalls: you add Floxis instances at the rates your Floxis endpoint suggests, and when LevelPlay reaches a Floxis instance, the adapter runs one Floxis auction with that rate as the floor and renders the winning ad itself. This guide covers Android 0.3.1 and iOS 0.3.3. Steps 1 to 6 are for Android; for an iOS app, follow them with the changes in iOS below.
Before you install. Besides the adapter (tech.floxis:floxis-sdk-levelplay on Android, the FloxisSDKLevelPlay
product on iOS), you 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 on either platform.
Contact your Floxis account manager 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. At the bottom of its Connection tab, Mediation entries has a Unity LevelPlay tab: its
Install fold gives the network's app keys (seat, region and timeoutMs), and its table gives, for each format, the
Floxis instances to add, each with its Rate and its configId, floor and min.
How it works#
- LevelPlay calls Floxis. Your LevelPlay waterfall reaches a Floxis instance at the rate you set for it.
- One Floxis auction. The adapter runs one auction for the ad request, with the instance's
flooras the floor (1.5 s deadline by default). - Render or pass. Floxis fills only with a bid at or above that floor, and the adapter loads and shows the ad. Otherwise LevelPlay moves on down the waterfall as usual.
With more than one Floxis instance in an ad unit, the first one LevelPlay reaches runs the auction at the lowest of
their floors (min) and keeps the answer for up to 10 seconds; each Floxis instance serves that bid only if it pays
at least its own floor. A bid serves once.
Floxis does not send LevelPlay a real-time price. Its position in the waterfall is the instance rate you enter in LevelPlay. Your endpoint's settings on the Supply page still apply to every auction, and Floxis never fills below the endpoint's Default bid floor.
| 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 and video in one auction; the higher bid wins. |
| 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.1, 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:
implementation("tech.floxis:floxis-sdk-levelplay:0.3.1")
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.1 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 Mediation entries → Install. Required. Each load fails with 101 regionThe region from the same place, for example us-e.us-etimeoutMsAuction deadline in whole milliseconds, 200 to 10000. 1500Type plain values, without quotes or units.
In Mediation entries, choose the Unity LevelPlay tab and the format, and type the Ad unit name: your name for the placement, for example
home_banner. Floxis reports by it, so give each placement its own name and keep it the same across app versions.In LevelPlay, add one Floxis instance per entry in the panel. Set the instance's Rate and its three instance settings from the same row:
Instance setting Value configIdThe ad unit name. Required. floorThis instance's rate in US dollars, for example 1.50. Required; there is no default.minThe lowest flooramong the ad unit's Floxis instances, for example0.55.Set the rate on the instance itself, never as a group or country rate.
Add the instances to your waterfalls, and save.
The one rule that matters. Each instance's floor must equal its Rate, in US dollars. LevelPlay does not
tell the adapter the rate you typed, so the adapter serves only bids that pay at least floor. Always copy the rate and
the keys from the same row. If your LevelPlay account uses another currency, type the rate converted into it and keep
floor and min exactly as shown (they stay in USD). An instance without a valid configId or floor never runs an
auction.
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.1).
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 video with neither a click-through nor an end card plays normally.
One seat per app. The whole app process uses one Floxis seat, region and timeout. If the app's Floxis.initialize uses another seat or
region, every LevelPlay load fails with Floxis 102 and the app's seat is kept. If the app also uses another Floxis artifact (floxis-sdk for AdMob or Ad
Manager), give FloxisConfig the same seat, region and timeoutMs as the LevelPlay settings and
call Floxis.initialize in Application.onCreate, before LevelPlay starts. 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 the TCF string (IABTCF_TCString) is missing or records no consent to Purpose 1 or to Floxis (vendor 1609); - 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 app-ads.txt 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#
The adapter always reports a successful start to LevelPlay, so a wrong key never switches Floxis off for the session.
Instead each load reports the problem: the Floxis code and message travel in LevelPlay's error message, for example
Floxis 205: bid 2.49 is below the entry floor 2.50.
| LevelPlay reports | Floxis code | What to do |
|---|---|---|
ADAPTER_ERROR_MISSING_PARAMS, message naming the app keys | 101 | Fix the network's app-level settings: seat as shown in Mediation entries, a region such as us-e, timeoutMs a whole number from 200 to 10000. |
ADAPTER_ERROR_MISSING_PARAMS, message naming the instance keys | 101 | Copy the instance's configId, floor and min again from Mediation entries. floor is required, in USD with at most 2 decimals; min is never above floor. |
| No fill (10001) | 201, 207 | Floxis is switched off, or was switched off or lost consent during the auction. |
| No fill (10001) | 202 | Expected: consent was denied or an opt-out applies, so no auction ran. See Privacy and consent. |
| No fill (10001) | 203 | Floxis has not started yet, or start-up failed. Check the earlier log lines; a failed start is retried on later loads. |
| No fill (10001) | 204, 205 | Normal: no bid, or a bid below this instance's floor. A lower Floxis instance may still serve it, and LevelPlay continues down the waterfall. |
| No fill (10001) | 206 | The auction took longer than timeoutMs. Raise it only if this is frequent. |
ADAPTER_ERROR_INTERNAL | 102 | The app also calls Floxis.initialize with another seat or region. Use one seat, region and timeout for the whole app. |
| No fill (10001) | 208, 209 | Network or server error. Send the message to your account manager if it persists. |
ADAPTER_ERROR_INTERNAL | 301, 302 | Render or internal error. Send the message to your account manager if it persists. |
ADAPTER_ERROR_AD_EXPIRED at show | 401 | The bid expired before the ad was shown. Load again. |
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.
iOS#
On iOS the adapter is the FloxisSDKLevelPlay product of the Floxis Swift package. It needs the same Floxis network
key, and the network's app keys (seat, region, timeoutMs), the instance keys (configId, floor, min), the
one rule and the Floxis codes are the same as on Android. These steps change.
Requirements. iOS 15.0 or newer, Xcode 26.2 or newer and Swift 5.9 or newer. Your app links Unity LevelPlay 9.6.1 or newer itself; the Floxis package brings in Prebid Mobile 3.4.0 and not LevelPlay. CocoaPods is not offered.
Add the package (step 1). In Xcode, choose File › Add Package Dependencies…, enter
https://github.com/floxis-tech/floxis-sdk-ios, set the rule to Up to Next Major Version from 0.3.3, and add
the FloxisSDKLevelPlay product to your app target. No linker flags or build settings are needed: the package keeps
the adapter classes in your build, and bundles its privacy manifest.
Custom network (step 2). The same Floxis network and app keys serve both platforms. On iOS, region must be
us-e, eu or apac; any other value fails each load with 101. You never type a class name. The network key tells
LevelPlay which classes to load from the package:
| LevelPlay loads | Class |
|---|---|
| Network | ISFloxisCustomAdapter |
| Banner | ISFloxisCustomBanner |
| Interstitial | ISFloxisCustomInterstitial |
| Rewarded | ISFloxisCustomRewardedVideo |
App code (step 3). There is no Floxis code to call, and no Floxis.initialize: the network's app keys start
Floxis. Initialise LevelPlay and load LPMBannerAdView, LPMInterstitialAd and LPMRewardedAd the way you already
do. If the app also uses FloxisSDK (AdMob or Ad Manager), call Floxis.shared.initialize before
LevelPlay starts, with the same seat, region and timeoutMs as the LevelPlay settings; another seat or region fails
every LevelPlay load with Floxis 102.
Privacy (step 4). Your CMP writes the IAB keys to UserDefaults. The adapter runs no Floxis auction, and reports
no fill, when you denied consent with LevelPlay.setConsent(false), or when the TCF,
US Privacy or GPP checks in step 4 fail. For a child-directed app or user, set the flag on Prebid Mobile (link the
PrebidMobile product at 3.4.0):
import PrebidMobile
Targeting.shared.subjectToCOPPA = trueApp Store privacy labels and the privacy manifest are in SDK privacy and consent.
app-ads.txt (step 5). Add the line at the root of the developer website on the app's App Store listing.
Testing (step 6). As on Android, every Floxis auction is real traffic; use a test seat. LevelPlay's integration test suite shows the adapter version 0.3.3 when it lists Floxis.
Errors. The Floxis code and message travel in LevelPlay's error message, as on Android. A load that ends with
a 2xx code (201 to 209) is a no fill (10001), 101 is ISAdapterErrorMissingParams, and any other code (102, 301, 302) is ISAdapterErrorInternal. At show, 401 is ISAdapterErrorAdExpired.
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 on Android, and as the Swift package on iOS, under the
licence published with each. Your account manager
can share a sample app that loads each LevelPlay format on your seat.