Aller au contenu principal
Version: 5.x.x

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
  • MREC
  • Interstitial
  • Rewarded

Requirements

  • Xcode 14.0
  • iOS: 12.2

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: img.png

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.

img.png

Integrate BlueStackAppLovinAdapter in your application project

In the Podfile of your application project add BlueStackAppLovinAdapter dependency

pod 'BlueStackAppLovinAdapter', '4.3.0.1'

Ad Formats

Supported MAAdDelegate Callback

func didLoad(_ ad: MAAd) { }

func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) { }

func didClick(_ ad: MAAd) { }

The BlueStacks AppLovin adapter includes the preferred height of the banner adview in the banner load callback using BlueStackKeys.BANNER_PREFERRED_HEIGHT key.

func adsAdapter(_ adsAdapter: MNGAdsAdapter!, bannerDidLoad adView: UIView!, preferredHeight: CGFloat) {
self.delegate?.didLoadAd(forAdView: adView, withExtraInfo: [BlueStackKeys.bannerPreferredHeight : preferredHeight])
}

You can use the preferred height to resize your banner container.

Passing Location data to BlueStack Banner Ad

adView = MAAdView(adUnitIdentifier: "YOUR_AD_UNIT_ID")
adView.setLocalExtraParameterForKey(BlueStackKeys.latitude, value: 45.0234)
adView.setLocalExtraParameterForKey(BlueStackKeys.longitude, value: 101.1987)
adView.setLocalExtraParameterForKey(BlueStackKeys.locationConsentFlag, value: 3)

Note: You must set the view controller to load the banner ad.

adView.setLocalExtraParameterForKey(BlueStackKeys.viewController, value: self)

MREC

Supported MAAdDelegate Callback

func didLoad(_ ad: MAAd) { }

func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) { }

func didClick(_ ad: MAAd) { }

The BlueStacks AppLovin adapter includes the preferred height of the MREC adview in the load callback using BlueStackKeys.BANNER_PREFERRED_HEIGHT key.

func adsAdapter(_ adsAdapter: MNGAdsAdapter!, bannerDidLoad adView: UIView!, preferredHeight: CGFloat) {
self.delegate?.didLoadAd(forAdView: adView, withExtraInfo: [BlueStackKeys.bannerPreferredHeight : preferredHeight])
}

You can use the preferred height to resize your MREC ad container.

Passing Location data to BlueStack MREC Ad

adView = MAAdView(adUnitIdentifier: "YOUR_AD_UNIT_ID", adFormat: MAAdFormat.mrec)
adView.setLocalExtraParameterForKey(BlueStackKeys.latitude, value: 45.0234)
adView.setLocalExtraParameterForKey(BlueStackKeys.longitude, value: 101.1987)
adView.setLocalExtraParameterForKey(BlueStackKeys.locationConsentFlag, value: 3)

Note: You must set the view controller to load the MREC ad.

adView.setLocalExtraParameterForKey(BlueStackKeys.viewController, value: self)

Interstitial

Supported MAAdViewAdDelegate Callback

func didLoad(_ ad: MAAd) { }

func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) { }

func didDisplay(_ ad: MAAd) { }

func didClick(_ ad: MAAd) { }

func didHide(_ ad: MAAd) { }

Passing Location data to BlueStack Interstitial Ad

interstitialAd = MAInterstitialAd(adUnitIdentifier: "YOUR_AD_UNIT_ID")
interstitialAd.setLocalExtraParameterForKey(BlueStackKeys.latitude, value: 45.0234)
interstitialAd.setLocalExtraParameterForKey(BlueStackKeys.longitude, value: 101.1987)
interstitialAd.setLocalExtraParameterForKey(BlueStackKeys.locationConsentFlag, value: 3)

Note: You must set the view controller to load and show the Interstitial ad.

interstitialAd.setLocalExtraParameterForKey(BlueStackKeys.viewController, value: self)

Rewarded

Supported MAAdDelegate Callback

func didLoad(_ ad: MAAd) { }

func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError){ }

func didDisplay(_ ad: MAAd) { }

func didClick(_ ad: MAAd) { }

func didHide(_ ad: MAAd) { }

func didFail(toDisplay ad: MAAd, withError error: MAError) { }

Supported MARewardedAdDelegate Callback

func didRewardUser(for ad: MAAd, with reward: MAReward) { }

Passing Location data to BlueStack Rewarded Video Ad

rewardedAd = MARewardedAd.shared(withAdUnitIdentifier: "YOUR_AD_UNIT_ID")
rewardedAd.setLocalExtraParameterForKey(BlueStackKeys.latitude, value: 45.0234)
rewardedAd.setLocalExtraParameterForKey(BlueStackKeys.longitude, value: 101.1987)
rewardedAd.setLocalExtraParameterForKey(BlueStackKeys.locationConsentFlag, value: 3)

Note: You must set the view controller to load and show the Rewarded ad.

rewardedAd.setLocalExtraParameterForKey(BlueStackKeys.viewController, value: self)
  • 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.