AppLovin
This guide shows you how to integrate our BlueStack mediation adapter of AppLovin MAX SDK with your current Android app and set up additional request parameters.
Release notes can be found here
Supported ad formats
- Banner
- Interstitial
- MREC
- Rewarded
Requirements
- Android 5 (API level 21) or higher.
- CompileSdkVersion at least 33.
AppLovin Configuration
When in the Applovin MAX dashboard, navigate to Manage -> Networks, at the bottom of the page you have the option to add a Custom Network. You'll be directe to a new page. Please use the following details when setting up the custom network:
Custom Network Name: Azerion Bluestack
iOS Class name: BlueStackAppLovinAdapter.BlueStackMediationAdapter
Android Class Name: com.azerion.bluestack.ApplovinAdapter
Next navigate to Manage -> Ad Units, and select the Ad Unit you would like to have Bluestack added. On the ad unit configuration page, scroll down to Custom Networks and click on Azerion Bluestack to show the configuration options. The Bluestack Application ID and the Placement ID's can be configured here. All ID's and CPM configuration will be provided by our publishing team.
Integrate MNGAds in your application project
In the main build.gradle of your project, you must declare the Bluestack repository:
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://packagecloud.io/smartadserver/android/maven2'
}
}
}
In the build.gradle of to your application module, you can now import the Bluestack Google Adapter SDK by declaring it in the dependencies section:
dependencies {
implementation 'com.applovin:applovin-sdk:12.1.0'
implementation 'com.azerion:bluestack-applovin-adapter:4.3.0.0'
implementation 'com.azerion:bluestack-sdk-core:4.3.0'
}
Ad Formats
Banner
Supported MaxAdViewAdapterListener Callback
- void onAdViewAdLoaded(View var1, @Nullable Bundle var2)
The BlueStacks AppLovin adapter includes the preferredHeightDP
when passing the banner adview in the banner load callback.
override fun bannerDidLoad(adView: View, preferredHeightDP: Int) {
val bundle = Bundle()
bundle.putInt(BlueStackKeys.BANNER_PREFERRED_HEIGHT, preferredHeightDP)
maxAdViewAdapterListener?.onAdViewAdLoaded(adView, bundle)
}
You can use the preferredHeightDP
to resize your banner container.
-
void onAdViewAdLoadFailed(MaxAdapterError var1)
-
void onAdViewAdClicked()
Passing Location data to BlueStack
adView = MaxAdView("YOUR_AD_UNIT_ID", this)
adView.setLocalExtraParameter(BlueStackKeys.LOCATION_LONGITUDE, 1.2281)
adView.setLocalExtraParameter(BlueStackKeys.LOCATION_LATITUDE, 0.2819)
adView.setLocalExtraParameter(BlueStackKeys.LOCATION_CONSENT_FLAG, 3)
MREC
Supported MaxAdViewAdapterListener Callback
- void onAdViewAdLoaded(View var1, @Nullable Bundle var2)
The BlueStacks AppLovin adapter includes the preferredHeightDP
when passing the banner adview in the banner load callback.
override fun bannerDidLoad(adView: View, preferredHeightDP: Int) {
val bundle = Bundle()
bundle.putInt(BlueStackKeys.BANNER_PREFERRED_HEIGHT, preferredHeightDP)
maxAdViewAdapterListener?.onAdViewAdLoaded(adView, bundle)
}
You can use the preferredHeightDP
to resize your banner container.
-
void onAdViewAdLoadFailed(MaxAdapterError var1)
-
void onAdViewAdClicked()
Passing Location data to BlueStack
adView = MaxAdView("YOUR_AD_UNIT_ID", MaxAdFormat.MREC, this)
adView.setLocalExtraParameter(BlueStackKeys.LOCATION_LONGITUDE, 1.2281)
adView.setLocalExtraParameter(BlueStackKeys.LOCATION_LATITUDE, 0.2819)
adView.setLocalExtraParameter(BlueStackKeys.LOCATION_CONSENT_FLAG, 3)
Interstitial
Supported MaxInterstitialAdapterListener Callback
- void onInterstitialAdLoaded()
- void onInterstitialAdLoadFailed(MaxAdapterError var1)
- void onInterstitialAdDisplayed()
- void onInterstitialAdClicked()
- void onInterstitialAdHidden()
Passing Location data to BlueStack
interstitialAd = MaxInterstitialAd("YOUR_AD_UNIT_ID", this)
interstitialAd.setLocalExtraParameter(BlueStackKeys.LOCATION_LONGITUDE, 1.2281)
interstitialAd.setLocalExtraParameter(BlueStackKeys.LOCATION_LATITUDE, 0.2819)
interstitialAd.setLocalExtraParameter(BlueStackKeys.LOCATION_CONSENT_FLAG, 3)
Rewarded
Supported MaxRewardedAdapterListener Callback
- void onRewardedAdLoaded()
- void onRewardedAdLoadFailed(MaxAdapterError var1)
- void onRewardedAdDisplayed()
- void onRewardedAdClicked()
- void onRewardedAdHidden()
- void onUserRewarded(MaxReward var1)
Passing Location data to BlueStack
rewardedAd = MaxRewardedAd.getInstance("YOUR_AD_UNIT_ID", this)
rewardedAd.setLocalExtraParameter(BlueStackKeys.LOCATION_LONGITUDE, 1.2281)
rewardedAd.setLocalExtraParameter(BlueStackKeys.LOCATION_LATITUDE, 0.2819)
rewardedAd.setLocalExtraParameter(BlueStackKeys.LOCATION_CONSENT_FLAG, 3)
Meaning of LOCATION_CONSENT_FLAG
- 0 = Not allow to send location.
- 1 = When you managed location according to consent value.
- 2 and 3 = Allow the SDK to managed location directly in accordance with the consent value use TCF v1 or TCF v2, see with the madvertise team it depends on your implementation.