### Install Ad Review for iOS with FooBar framework Source: https://support.applovin.com/en/max/ad-review/ad-review-faq Example of the previous command when the dedicated framework target is `FooBar.framework`. Run the command with `FooBar` as the framework name. ```bash ruby AppLovinQualityServiceSetup.rb install -localframeworks FooBar ``` -------------------------------- ### Install Ad Review for iOS with local frameworks Source: https://support.applovin.com/en/max/ad-review/ad-review-faq For iOS builds that integrate MAX adapters via a dedicated framework target, redo the integration and specify the framework name without its extension using the `-localframeworks` flag. ```bash ruby AppLovinQualityServiceSetup.rb install -localframeworks «framework name without extension» ``` -------------------------------- ### Unity C# example for app open ads with ExampleHomeScreen and AppOpenManager Source: https://support.applovin.com/en/max/unity/ad-formats/app-open-ads Use this Unity C# example to preload and show app open ads on soft launch and app foregrounding. It assumes app open ads show only on soft launch and does not include a splash/loading screen; the App Developer must handle that. The example overrides OnApplicationPause to show the ad when the app is foregrounded and reloads the ad after dismissal. ```csharp public class ExampleHomeScreen : MonoBehaviour { void Start() { MaxSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration => { MaxSdkCallbacks.AppOpen.OnAdHiddenEvent += OnAppOpenDismissedEvent; AppOpenManager.Instance.ShowAdIfReady(); }; MaxSdk.InitializeSdk(); } public void OnAppOpenDismissedEvent(string adUnitId, MaxSdk.AdInfo adInfo) { MaxSdk.LoadAppOpenAd(AppOpenAdUnitId); } private void OnApplicationPause(bool pauseStatus) { if (!pauseStatus) { AppOpenManager.Instance.ShowAdIfReady(); } } } public class AppOpenManager { #if UNITY_IOS private const string AppOpenAdUnitId = "«iOS-ad-unit-ID»"; #else // UNITY_ANDROID private const string AppOpenAdUnitId = "«Android-ad-unit-ID»"; #endif public void ShowAdIfReady() { if (MaxSdk.IsAppOpenAdReady(AppOpenAdUnitId)) { MaxSdk.ShowAppOpenAd(AppOpenAdUnitId); } else { MaxSdk.LoadAppOpenAd(AppOpenAdUnitId); } } } ``` -------------------------------- ### Initialize AppLovin MAX SDK with configuration (Swift) Source: https://support.applovin.com/en/max/ios/overview/integration Swift equivalent of the Objective-C example: creates an ALSdkInitializationConfiguration with the SDK key, sets the mediation provider to ALMediationProviderMAX, adds a segment collection, configures SDK settings (user identifier, UID2 token, terms and privacy policy flow), and initializes the SDK. Replace placeholder values like «SDK-key» before use. The completion handler is where ad loading starts. ```swift // Create the initialization configuration let initConfig = ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in builder.mediationProvider = ALMediationProviderMAX builder.segmentCollection = MASegmentCollection { segmentCollectionBuilder in segmentCollectionBuilder.add(MASegment(key: 849, values: [1, 3])) } } // Configure the SDK settings if needed before or after SDK initialization. let settings = ALSdk.shared().settings settings.userIdentifier = "«user-ID»" settings.setExtraParameterForKey("uid2_token", value: "«token-value»") // Note: you may also set these values in your Info.plist settings.termsAndPrivacyPolicyFlowSettings.isEnabled = true settings.termsAndPrivacyPolicyFlowSettings.termsOfServiceURL = URL(string: "«https://your-company-name.com/terms-of-service»") settings.termsAndPrivacyPolicyFlowSettings.privacyPolicyURL = URL(string: "«https://your-company-name.com/privacy-policy»") // Initialize the SDK with the configuration ALSdk.shared().initialize(with: initConfig) { sdkConfig in // Start loading ads } ``` -------------------------------- ### Full MaxRecyclerAdapter Example (Java) Source: https://support.applovin.com/en/max/android/ad-formats/native-ads Complete example showing how to configure a RecyclerView with MaxRecyclerAdapter, set repeating interval, register listener, load ads, and destroy the adapter in onDestroy. ```java @Override public void onCreate(Bundle savedInstanceState) { super.onCreate( savedInstanceState ); // Create your own recycler view and original adapter ⋮ // Configure ad adapter MaxAdPlacerSettings settings = new MaxAdPlacerSettings( "«ad-unit-ID»" ); settings.setRepeatingInterval( 5 ); adAdapter = new MaxRecyclerAdapter( settings, originalAdapter, this ); // Optionally, register listener adAdapter.setListener( this ); // Configure recycler view and load ads recyclerView.setAdapter( adAdapter ); adAdapter.loadAds(); } @Override public void onDestroy() { adAdapter.destroy(); super.onDestroy(); } ``` -------------------------------- ### Full MaxRecyclerAdapter Example (Kotlin) Source: https://support.applovin.com/en/max/android/ad-formats/native-ads Kotlin version of the complete example for configuring a RecyclerView with MaxRecyclerAdapter, including settings, listener, loading ads, and cleanup. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // Create your own recycler view and original adapter ⋮ // Configure ad adapter val settings = MaxAdPlacerSettings("«ad-unit-ID»") settings.repeatingInterval = 5 adAdapter = MaxRecyclerAdapter(settings, originalAdapter, this) // Optionally, register listener adAdapter.listener = this // Configure recycler view and load ads recycler.adapter = adAdapter adAdapter.loadAds() } override fun onDestroy() { adAdapter.destroy() super.onDestroy() } ``` -------------------------------- ### Show interstitial ad with showAd() (Kotlin) Source: https://support.applovin.com/en/max/android/overview/manual-integration Kotlin equivalent of the showing example. Check if the interstitial ad is ready using isReady and then call showAd() on the MaxInterstitialAd object created in the loading example. ```kotlin if ( interstitialAd.isReady ) { interstitialAd.showAd() } ``` -------------------------------- ### Waterfall Information API: Example output Source: https://support.applovin.com/en/max/flutter/overview/advanced-settings Sample output from the Waterfall Information API example, showing waterfall name, latency, and per-network details including ad load state, latency, and credentials. Ad load state 1 indicates loaded, 0 indicates not attempted. ```plaintext Waterfall Name: Default Waterfall and Test Name: Control Waterfall latency was: 1635 milliseconds Network -> mediatedNetwork: [name: Mintegral adapterClassName: com.applovin.mediation.adapters.MintegralMediationAdapter sdkVersion: MAL_16.2.61 adapterVersion: 16.2.61.2] ...adLoadState: 1 ...latencyMillis: 1635 ...credentials: 1542105 Network -> mediatedNetwork: [name: InMobi adapterClassName: com.applovin.mediation.adapters.InMobiMediationAdapter sdkVersion: 10.1.2 adapterVersion: 10.1.2.1] ...adLoadState: 0 ...latencyMillis: -1 ...credentials: 1550734895971 Network -> mediatedNetwork: [name: LINE adapterClassName: com.applovin.mediation.adapters.LineMediationAdapter sdkVersion: 2.4.20220216 adapterVersion: 2022.2.16.3] ...adLoadState: 0 ...latencyMillis: -1 ...credentials: 849050 Network -> mediatedNetwork: [name: Pangle adapterClassName: com.applovin.mediation.adapters.ByteDanceMediationAdapter sdkVersion: 4.8.0.9 adapterVersion: 4.8.0.9.0] ...adLoadState: 0 ...latencyMillis: -1 ...credentials: 980040498 ``` -------------------------------- ### GET Response Example for Competitor Rules Source: https://support.applovin.com/en/max/ad-review/rules-management-api Example response from a GET request to /v1/rules/competitors. Shows an array of rule objects with fields including name, platform, package_names, rule_type, value, and is_active. Note that is_active is a string 'true' or 'false'. ```json [ { "name": "android title rule", "platform": "android", "package_names":["com.test.my_first_app","com.test.my_second_app"], "rule_type": "title", "value": ["solitaire", "block", "com.games.solitaire", "com.bestgames.Bricks"], "is_active": "true" }, { "name": "ios title rule", "platform": "ios", "rule_type": "title", "value": ["1449713068"], "is_active": "false" } ] ``` -------------------------------- ### Example Final URL for DSP Report Source: https://support.applovin.com/en/max/demand-partners/demand-side-platforms/dsp-reporting Example URL with required parameters: api_key, start, end, report_type, columns, sort_impressions, limit, and format. ```plaintext https://r.applovin.com/report?api_key=«api-key»&start=2017-05-01&end=2017-05-01&report_type=dsp_report&columns=platform,country,impressions,spend&sort_impressions=DESC&limit=100&format=csv ``` -------------------------------- ### GET /maxCohort Source: https://support.applovin.com/en/max/reporting-apis/cohort-api Retrieves user performance data based on install date, including ad revenue, IAP revenue, and install counts. Requires authentication via the api_key parameter. ```APIDOC ## [GET] /maxCohort ### Description Retrieves user performance data based on install date, including ad revenue, IAP revenue, and install counts. ### Method GET ### Endpoint https://r.applovin.com/maxCohort ### Parameters #### Query Parameters - **api_key** (string) - Required - Your Report Key. - **columns** (string) - Optional - Which columns to report (comma-separated). - **end** (string) - Optional - Last day you want included in the report, in `YYYY-MM-DD` format. Must be within the last 45 days. - **filter_«x»** (string) - Optional - Filter column `«x»` by a value. - **format** (string) - Optional - Response format: `csv` or `json`. - **limit** (integer) - Optional - Limit the results set to some fixed number of items. - **not_zero** (integer) - Optional - Set to `1` to filter results in which all numerical metrics have a value of 0. - **offset** (integer) - Optional - Skip the first offset items. Use with limit for pagination. - **sort_«x»** (string) - Optional - Sort the response by column `«x»` (ASC or DESC). - **start** (string) - Optional - First day you want included in the report, in `YYYY-MM-DD` format. Must be within the last 45 days. ### Response #### Success Response (200) Returns data in the requested format (CSV or JSON) with the selected columns. ``` -------------------------------- ### Java implementation of MaxAppOpenAd with lifecycle observer Source: https://support.applovin.com/en/max/android/ad-formats/app-open-ads Java example showing how to preload a MaxAppOpenAd in an Application class and show it on app foregrounding. Assumes ads show only on soft launch and does not include a splash/loading screen. The App Developer must handle the splash/loading screen. ```java public class MyApplication extends Application { private final ExampleAppOpenManager appOpenManager; @Override public void onCreate() { super.onCreate(); AppLovinSdk.initializeSdk( this, new AppLovinSdk.SdkInitializationListener() { @Override public void onSdkInitialized(final AppLovinSdkConfiguration configuration) { appOpenManager = new ExampleAppOpenManager( MyApplication.this ); } } ); } } public class ExampleAppOpenManager implements DefaultLifecycleObserver, MaxAdListener { private final MaxAppOpenAd appOpenAd; private final Context context; public ExampleAppOpenManager(final Context context) { ProcessLifecycleOwner.get().getLifecycle().addObserver( this ); this.context = context; appOpenAd = new MaxAppOpenAd( "«ad-unit-ID»", this ); appOpenAd.setListener( this ); appOpenAd.loadAd(); } private void showAdIfReady() { if ( appOpenAd == null || !AppLovinSdk.getInstance( context ).isInitialized() ) return; if ( appOpenAd.isReady() ) { appOpenAd.showAd( "«test-placement»" ); } else { appOpenAd.loadAd(); } } @Override public void onStart(@NonNull LifecycleOwner owner) { showAdIfReady(); } @Override public void onAdLoaded(final MaxAd ad) {} @Override public void onAdLoadFailed(final String adUnitId, final MaxError error) {} @Override public void onAdDisplayed(final MaxAd ad) {} @Override public void onAdClicked(final MaxAd ad) {} @Override public void onAdHidden(final MaxAd ad) { appOpenAd.loadAd(); } @Override public void onAdDisplayFailed(final MaxAd ad, final MaxError error) { appOpenAd.loadAd(); } } ``` -------------------------------- ### Enable MAX Terms and Privacy Policy Flow and Initialize SDK Source: https://support.applovin.com/en/max/unreal/overview/terms-and-privacy-policy-flow Set the terms and privacy policy flow properties before initializing the SDK. The Terms of Service URL is optional. Initialize the SDK after setting these properties. ```cpp UAppLovinMAX::SetTermsAndPrivacyPolicyFlowEnabled(true); UAppLovinMAX::SetPrivacyPolicyUrl(TEXT("«https://your-company-name.com/privacy/»")); // Terms of Service URL is optional UAppLovinMAX::SetTermsOfServiceUrl(TEXT("«https://your-company-name.com/terms/»")); UAppLovinMAX::Initialize(TEXT("«your-SDK-key»")); ``` -------------------------------- ### Install applovin_max dependency with flutter pub get Source: https://support.applovin.com/en/max/flutter/overview/integration Run this command if you added the dependency manually to pubspec.yaml. It installs the applovin_max package. If you used 'flutter pub add', this step is automatic. ```bash flutter pub get ``` -------------------------------- ### Kotlin implementation of MaxAppOpenAd with lifecycle observer Source: https://support.applovin.com/en/max/android/ad-formats/app-open-ads Kotlin example showing how to preload a MaxAppOpenAd in an Application class and show it on app foregrounding. Assumes ads show only on soft launch and does not include a splash/loading screen. The App Developer must handle the splash/loading screen. ```kotlin class MyApplication : Application() { private lateinit var appOpenManager: ExampleAppOpenManager override fun onCreate() { super.onCreate() AppLovinSdk.getInstance( this ).initializeSdk({ configuration: AppLovinSdkConfiguration -> appOpenManager = ExampleAppOpenManager(applicationContext) }) } } class ExampleAppOpenManager(applicationContext: Context?) : DefaultLifecycleObserver, MaxAdListener { private lateinit var appOpenAd: MaxAppOpenAd private lateinit var context: Context init { ProcessLifecycleOwner.get().lifecycle.addObserver(this) context = applicationContext appOpenAd = MaxAppOpenAd("«ad-unit-ID»", this) appOpenAd.setListener(this) appOpenAd.loadAd() } private fun showAdIfReady() { if (appOpenAd == null || !AppLovinSdk.getInstance(context).isInitialized) return if (appOpenAd.isReady) { appOpenAd.showAd("«test-placement»") } else { appOpenAd.loadAd() } } override fun onStart(owner: LifecycleOwner) { showAdIfReady() } override fun onAdLoaded(ad: MaxAd) {} override fun onAdLoadFailed(adUnitId: String, error: MaxError) {} override fun onAdDisplayed(ad: MaxAd) {} override fun onAdClicked(ad: MaxAd) {} override fun onAdHidden(ad: MaxAd) { appOpenAd.loadAd() } override fun onAdDisplayFailed(ad: MaxAd, error: MaxError) { appOpenAd.loadAd() } } ``` -------------------------------- ### GET /maxCohort/session Source: https://support.applovin.com/en/max/reporting-apis/cohort-api Retrieves session information based on install date. Requires authentication via the api_key parameter. ```APIDOC ## [GET] /maxCohort/session ### Description Retrieves session information based on install date. ### Method GET ### Endpoint https://r.applovin.com/maxCohort/session ### Parameters #### Query Parameters - **api_key** (string) - Required - Your Report Key. - **columns** (string) - Optional - Which columns to report (comma-separated). - **end** (string) - Optional - Last day you want included in the report, in `YYYY-MM-DD` format. Must be within the last 45 days. - **filter_«x»** (string) - Optional - Filter column `«x»` by a value. - **format** (string) - Optional - Response format: `csv` or `json`. - **limit** (integer) - Optional - Limit the results set to some fixed number of items. - **not_zero** (integer) - Optional - Set to `1` to filter results in which all numerical metrics have a value of 0. - **offset** (integer) - Optional - Skip the first offset items. Use with limit for pagination. - **sort_«x»** (string) - Optional - Sort the response by column `«x»` (ASC or DESC). - **start** (string) - Optional - First day you want included in the report, in `YYYY-MM-DD` format. Must be within the last 45 days. ### Response #### Success Response (200) Returns data in the requested format (CSV or JSON) with the selected columns. ``` -------------------------------- ### GET /maxCohort/imp Source: https://support.applovin.com/en/max/reporting-apis/cohort-api Retrieves ad impression information based on install date. Requires authentication via the api_key parameter. ```APIDOC ## [GET] /maxCohort/imp ### Description Retrieves ad impression information based on install date. ### Method GET ### Endpoint https://r.applovin.com/maxCohort/imp ### Parameters #### Query Parameters - **api_key** (string) - Required - Your Report Key. - **columns** (string) - Optional - Which columns to report (comma-separated). - **end** (string) - Optional - Last day you want included in the report, in `YYYY-MM-DD` format. Must be within the last 45 days. - **filter_«x»** (string) - Optional - Filter column `«x»` by a value. - **format** (string) - Optional - Response format: `csv` or `json`. - **limit** (integer) - Optional - Limit the results set to some fixed number of items. - **not_zero** (integer) - Optional - Set to `1` to filter results in which all numerical metrics have a value of 0. - **offset** (integer) - Optional - Skip the first offset items. Use with limit for pagination. - **sort_«x»** (string) - Optional - Sort the response by column `«x»` (ASC or DESC). - **start** (string) - Optional - First day you want included in the report, in `YYYY-MM-DD` format. Must be within the last 45 days. ### Response #### Success Response (200) Returns data in the requested format (CSV or JSON) with the selected columns. ``` -------------------------------- ### Initialize AppLovin SDK in Defold Source: https://support.applovin.com/en/max/defold/overview/integration Set a callback for SDK events and initialize the SDK on startup. The callback handles OnSdkInitializedEvent to start loading ads. Replace «your-SDK-key» with your key from the AppLovin dashboard. ```lua local function applovin_callback(self, name, params) if name == "OnSdkInitializedEvent" then -- AppLovin SDK is initialized, start loading ads ⋮ end function init(self) applovin.set_callback(applovin_callback) applovin.initialize("«your-SDK-key»") ⋮ end ``` -------------------------------- ### GET /ad_unit_experiment/«ad-unit-ID» Response Body Source: https://support.applovin.com/en/max/advanced-features/ad-unit-management-api Example response body for a GET request to the ad unit experiment endpoint. Shows the structure of the experiment object, including ad network settings, frequency capping settings, and bid floors. ```json { "id": "e74c3b7797b0ce7a", "experiment_name": "add_admob_inter_lines", "platform": "ios", "ad_format": "INTER", "package_name": "com.testapp.test", "disabled": false, "promote": false, "deprecate": false, "ad_network_settings": [ { "ADMOB_NETWORK": { "disabled": true, "ad_network_app_id": "ca-app-pub-3555987499620362~3024971981", "ad_network_ad_units": [] } } ], "frequency_capping_settings": [ { "type": "time", "time_capping_settings": { "day_limit": 10, "minute_frequency": 10 }, "session_capping_settings": { "session_limit": 0 }, "countries" : { "type": "INCLUDE", "values" : [ "ca", "us" ] } } ], "bid_floors": [ { "country_group_name": "t1 eng", "cpm": "10.00", "countries": { "type": "INCLUDE", "values": [ "au", "ca" ] } } ] } ``` -------------------------------- ### Load ads with MACollectionViewAdPlacer in viewDidLoad Source: https://support.applovin.com/en/max/ios/ad-formats/native-ads Configure the collection view with AppLovin delegate and data source, create the ad placer with a specific ad unit ID, set its delegate, and call loadAds to start loading ads. Also implement the required collection view data source methods using the al_ prefixed equivalents. ```objective-c - (void)viewDidLoad { [super viewDidLoad]; // Configure collection view self.collectionView.al_delegate = self; self.collectionView.al_dataSource = self; // Configure ad placer and load ads MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"]; self.adPlacer = [MACollectionViewAdPlacer placerWithCollectionView: self.collectionView settings: settings]; self.adPlacer.delegate = self; [self.adPlacer loadAds]; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return self.data.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { MyCollectionViewCell *cell = (MyCollectionViewCell *)[collectionView al_dequeueReusableCellWithIdentifier: @"YourCell" forIndexPath: indexPath]; cell.textLabel.text = self.data[indexPath.row]; return cell; } ``` ```swift override func viewDidLoad() { super.viewDidLoad() // Configure collection view collectionView.al_delegate = self collectionView.al_dataSource = self // Configure ad placer and load ads let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»") adPlacer = MACollectionViewAdPlacer(collectionView: collectionView, settings: settings) adPlacer.delegate = self adPlacer.loadAds() } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return data.count } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.al_dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! MyCollectionViewCell cell.textLabel.text = data[indexPath.row] return cell } ``` -------------------------------- ### Initialize AppLovin SDK and Adjust in Swift Source: https://support.applovin.com/en/max/ios/overview/terms-and-privacy-policy-flow Swift equivalent of the Objective-C example. Initialize the AppLovin SDK with a consent flow, set the user ID, and initialize Adjust inside the AppLovin initialization callback. Wait for the consent flow to finish before initializing third-party SDKs. ```swift import AppLovinSDK import Adjust @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { ⋮ // Create the initialization configuration let initConfig = ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in builder.mediationProvider = ALMediationProviderMAX } let settings = ALSdk.shared().settings settings.userIdentifier = "«user-ID»" Adjust.addSessionCallbackParameter("«your-user-ID-key»", value: "«user-ID»") // Initialize the SDK with the configuration ALSdk.shared().initialize(with: initConfig) { sdkConfig in // App transparency tracking authorization can be checked via `configuration.appTrackingTransparencyStatus` // Initialize other 3rd-party SDKs - do not initialize mediated advertising SDKs, MAX will do that for you automatically. Not following this step will result in noticeable integration issues // Initialize the Adjust SDK inside the AppLovin SDK's initialization callback let adjustConfig = ADJConfig(appToken: "«your-Adjust-app-token»", environment: ADJEnvironmentSandbox or ADJEnvironmentProduction) Adjust.appDidLaunch(adjustConfig) // Start loading ads } } } ``` -------------------------------- ### GET /ad_unit/«ad-unit-ID» Response body (JSON) Source: https://support.applovin.com/en/max/advanced-features/ad-unit-management-api Example response body for a GET request, showing ad unit details including ad network settings, frequency capping, bid floors, banner refresh settings, and segments. ```json { "id": "1234567890abcdef", "name": "My Inter Ad Unit", "platform": "ios", "package_name": "com.test.app", "ad_format": "INTER", "has_active_experiment": false, "disabled": false, "ad_network_settings": [ { "FACEBOOK_NETWORK": { "disabled": false, "ad_network_ad_units": [ { "ad_network_ad_unit_id": "8247030622430922_5618972399256249", "disabled": false } ] } }, { "ADMOB_NETWORK": { "disabled": false, "ad_network_app_id": "ca-app-pub-3555987499620362~3024971981", "ad_network_ad_units": [ { "ad_network_ad_unit_id": "ca-app-pub-3555987499620362/4382996128", "disabled": false, "cpm": "30.00", "countries": { "type": "INCLUDE", "values": [ "us", "ca", "gb", "au" ] } }, { "ad_network_ad_unit_id": "ca-app-pub-3555987499620362/5476585941", "disabled": false, "cpm": "20.00", "countries": { "type": "EXCLUDE", "values": [ "us", "ca", "gb", "au" ] } } ] } } ], "frequency_capping_settings": [ { "type": "time", "time_capping_settings": { "day_limit": 10, "minute_frequency": 10 }, "session_capping_settings": { "session_limit": 0 }, "countries" : { "type": "INCLUDE", "values" : [ "ca", "us" ] } } ], "bid_floors": [ { "country_group_name": "t1 eng", "cpm": "10.00", "countries": { "type": "INCLUDE", "values": [ "au", "ca", "gb", "nz", "us" ] } }, { "country_group_name": "eea", "cpm": "5.00", "countries": { "type": "INCLUDE", "values": [ "at", "pt", "ro", "se", "si", "sk" ] } } ], "banner_refresh_settings":{ "interval": 0 }, "segments":[ { "id": 347324, "name": "LAT iPads", "id_type": "no_id", "device_type": "tablets", "segment_keys": [ [ "+1:2" ] ] } ] } ``` -------------------------------- ### Objective-C - Create MAAdPlacerSettings with Placement Source: https://support.applovin.com/en/max/advanced-features/s2s-impression-level-api Creates MAAdPlacerSettings with an ad unit ID and sets a placement for native ad placer in Objective-C. ```APIDOC ## [CREATE] MAAdPlacerSettings ### Description Creates MAAdPlacerSettings with an ad unit ID and sets a placement for native ad placer in Objective-C. ### Method CREATE ### Endpoint MAAdPlacerSettings ### Parameters #### Request Body - **ad-unit-ID** (string) - Required - The ad unit identifier. - **placement** (string) - Required - The placement name to assign. ### Request Example ```objective-c MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"]; settings.placement = @"«placement»"; ``` ``` -------------------------------- ### Retrieve revenue precision from ad info Source: https://support.applovin.com/en/max/unity/overview/advanced-settings Get the revenue precision evaluation using adInfo.RevenuePrecision. Possible values include "publisher_defined", "exact", "estimated", "undefined", and "" (empty string for invalid revenue). ```csharp string revenuePrecision = adInfo.RevenuePrecision; ``` -------------------------------- ### Initialize MACollectionViewAdPlacer with collection view and settings Source: https://support.applovin.com/en/max/ios/ad-formats/native-ads Initialize the ad placer with your collection view and ad settings. Use the Objective-C or Swift version depending on your project language. ```objective-c self.adPlacer = [MACollectionViewAdPlacer placerWithCollectionView: self.collectionView settings: settings]; ``` ```swift adPlacer = MACollectionViewAdPlacer(collectionView: collectionView, settings: settings) ``` -------------------------------- ### Create MAAdPlacerSettings with ad unit identifier (Swift) Source: https://support.applovin.com/en/max/ios/ad-formats/native-ads Initializes ad placer settings with the ad unit identifier. Required before configuring ad positions and other settings. ```swift let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»") ``` -------------------------------- ### Install new pods with pod install --repo-update Source: https://support.applovin.com/en/max/cordova/preparing-mediated-networks Runs pod install with --repo-update to install or update CocoaPods dependencies, including the Amazon adapter and related SDKs. ```bash pod install --repo-update ``` -------------------------------- ### Check CocoaPods version Source: https://support.applovin.com/en/max/unreal/preparing-mediated-networks Use this command to verify your installed CocoaPods version. Ensure you have the latest version before proceeding with the installation script. ```bash pod --version ``` -------------------------------- ### Kotlin - Create MaxAdPlacerSettings with Placement Source: https://support.applovin.com/en/max/advanced-features/s2s-impression-level-api Creates MaxAdPlacerSettings with an ad unit ID and sets a placement for native ad placer in Kotlin. ```APIDOC ## [CREATE] MaxAdPlacerSettings ### Description Creates MaxAdPlacerSettings with an ad unit ID and sets a placement for native ad placer in Kotlin. ### Method CREATE ### Endpoint MaxAdPlacerSettings ### Parameters #### Request Body - **ad-unit-ID** (string) - Required - The ad unit identifier. - **placement** (string) - Required - The placement name to assign. ### Request Example ```kotlin val settings = MaxAdPlacerSettings( "«ad-unit-ID»" ) settings.placement = "«placement»" ``` ``` -------------------------------- ### Swift - Create MAAdPlacerSettings with Placement Source: https://support.applovin.com/en/max/advanced-features/s2s-impression-level-api Creates MAAdPlacerSettings with an ad unit ID and sets a placement for native ad placer in Swift. ```APIDOC ## [CREATE] MAAdPlacerSettings ### Description Creates MAAdPlacerSettings with an ad unit ID and sets a placement for native ad placer in Swift. ### Method CREATE ### Endpoint MAAdPlacerSettings ### Parameters #### Request Body - **ad-unit-ID** (string) - Required - The ad unit identifier. - **placement** (string) - Required - The placement name to assign. ### Request Example ```swift let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»") settings.placement = @"«placement»" ``` ``` -------------------------------- ### Start auto-refresh (Kotlin) Source: https://support.applovin.com/en/max/android/ad-formats/banner-and-mrec-ads Starts auto-refresh for an ad. Call this to resume auto-refresh after stopping it. ```Kotlin adView.startAutoRefresh() ``` -------------------------------- ### Start auto-refresh (Java) Source: https://support.applovin.com/en/max/android/ad-formats/banner-and-mrec-ads Starts auto-refresh for an ad. Call this to resume auto-refresh after stopping it. ```Java adView.startAutoRefresh(); ``` -------------------------------- ### Create MAAdPlacerSettings with ad unit identifier (Objective-C) Source: https://support.applovin.com/en/max/ios/ad-formats/native-ads Initializes ad placer settings with the ad unit identifier. Required before configuring ad positions and other settings. ```objective-c MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"]; ``` -------------------------------- ### Selective init with MaxSdk.InitializeSdk Source: https://support.applovin.com/en/max/unity/overview/advanced-settings Initializes the MAX SDK with only the specified ad units, so only networks configured for those ad units are initialized. If no ad units are specified, all ad units and networks are initialized. When using selective init, any ad units not explicitly specified are excluded from serving ads for the current session, and selective init has no effect when test mode is enabled. ```csharp MaxSdkCallbacks.OnSdkInitializedEvent += (MaxSdk.SdkConfiguration config) => { ⋮ }; MaxSdk.InitializeSdk(new[]{"«ad-unit-ID-1»", "«ad-unit-ID-2»"}); ``` -------------------------------- ### Start MREC Auto-Refresh with start_mrec_auto_refresh() Source: https://support.applovin.com/en/max/defold/ad-formats/banner-and-mrec-ads Starts auto-refresh for an MREC ad by calling applovin.start_mrec_auto_refresh() with the Ad Unit ID. ```lua applovin.start_mrec_auto_refresh(«ad-unit-ID») ``` -------------------------------- ### Start Banner Auto-Refresh with start_banner_auto_refresh() Source: https://support.applovin.com/en/max/defold/ad-formats/banner-and-mrec-ads Starts auto-refresh for a banner ad by calling applovin.start_banner_auto_refresh() with the Ad Unit ID. ```lua applovin.start_banner_auto_refresh(«ad-unit-ID») ``` -------------------------------- ### Initialize AppLovin MAX SDK with Kotlin Source: https://support.applovin.com/en/max/android/overview/integration Kotlin example showing the same initialization flow as the Java version, using Kotlin syntax for configuration, settings, and initialization callback. Replace placeholders like «SDK-key», «user-ID», «token-value», and URLs with actual values. ```kotlin // Create the initialization configuration val initConfig = AppLovinSdkInitializationConfiguration.builder("«SDK-key»") .setMediationProvider(AppLovinMediationProvider.MAX) .setSegmentCollection(MaxSegmentCollection.builder() .addSegment(MaxSegment(849, listOf(1, 3))) .build() ) .build() // Configure the SDK settings if needed before or after SDK initialization. val settings = AppLovinSdk.getInstance(this).settings settings.userIdentifier = "«user-ID»" settings.setExtraParameter("uid2_token", "«token-value»") settings.termsAndPrivacyPolicyFlowSettings.apply { isEnabled = true privacyPolicyUri = Uri.parse("«https://your-company-name.com/privacy-policy»") termsOfServiceUri = Uri.parse("«https://your-company-name.com/terms-of-service»") } // Initialize the SDK with the configuration AppLovinSdk.getInstance(this).initialize(initConfig) { sdkConfig -> // Start loading ads } ``` -------------------------------- ### Show GDPR flow to existing users with ALCMPService (Swift) Source: https://support.applovin.com/en/max/ios/overview/terms-and-privacy-policy-flow Swift equivalent of the Objective-C example. Uses `ALSdk.shared().cmpService` and calls `showCMPForExistingUser` with a completion handler that checks for an error. ```swift import AppLovinSDK class MyViewController: UIViewController { func loadAndShowCmpFlow() { let cmpService = ALSdk.shared().cmpService cmpService.showCMPForExistingUser { error in if (nil == error) { // The CMP alert was shown successfully. } } } } ``` -------------------------------- ### Start MREC Auto-Refresh (Programmatic) Source: https://support.applovin.com/en/max/flutter/ad-formats/banner-and-mrec-ads Starts auto-refresh for an MREC ad using the AppLovin MAX SDK. ```dart AppLovinMAX.startMRecAutoRefresh(«ad-unit-ID»); ``` -------------------------------- ### Enable MAX Terms and Privacy Policy Flow and Initialize SDK Source: https://support.applovin.com/en/max/defold/overview/terms-and-privacy-policy-flow Set required properties before SDK initialization to enable the consent flow for Android and iOS. The Terms of Service URL is optional. The SDK presents the flow during initialization and calls the completion callback after the user finishes. ```lua applovin.set_terms_and_privacy_policy_flow_enabled(true) applovin.set_privacy_policy_url("«https://your-company-name.com/privacy/»") -- Terms of Service URL is optional applovin.set_terms_of_service_url("«https://your-company-name.com/terms/»") applovin.initialize("«your-SDK-key»") ``` -------------------------------- ### Start Banner Auto-Refresh (Programmatic) Source: https://support.applovin.com/en/max/flutter/ad-formats/banner-and-mrec-ads Starts auto-refresh for a banner ad using the AppLovin MAX SDK. ```dart AppLovinMAX.startBannerAutoRefresh(«ad-unit-ID»); ``` -------------------------------- ### startAutoRefresh() - Start Auto-Refresh Source: https://support.applovin.com/en/max/ios/ad-formats/banner-and-mrec-ads Starts the auto-refresh for a banner or MREC ad. Call this to resume automatic refreshing after stopping it. ```APIDOC ## [METHOD] startAutoRefresh() ### Description Starts the auto-refresh for a banner or MREC ad. Use this to resume automatic refreshing after calling `stopAutoRefresh()`. ### Method Instance method ### Parameters None ### Code Example (Objective-C) ```objective-c [adView startAutoRefresh]; ``` ### Code Example (Swift) ```swift adView.startAutoRefresh() ``` ``` -------------------------------- ### Initialize AppLovin SDK and Adjust in Objective-C Source: https://support.applovin.com/en/max/ios/overview/terms-and-privacy-policy-flow Initialize the AppLovin SDK with a consent flow and set the user ID. Must wait for the consent flow to finish before initializing third-party SDKs; initialize Adjust inside the AppLovin initialization callback. Do not initialize mediated network SDKs here. ```objective-c #import #import @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ⋮ // Create the initialization configuration ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: @"«SDK-key»" builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) { builder.mediationProvider = ALMediationProviderMAX; }]; // Configure the SDK settings if needed before or after SDK initialization. ALSdkSettings *settings = [ALSdk shared].settings; settings.userIdentifier = @"«user-ID»"; [Adjust addSessionCallbackParameter: @"«your-user-ID-key»" value: @"«user-ID»"]; // Initialize the SDK with the configuration [[ALSdk shared] initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) { // You can check app transparency tracking authorization via configuration.appTrackingTransparencyStatus // Initialize other 3rd-party SDKs - do not initialize mediated advertising SDKs; MAX will automatically do that for you. Not following this step will result in noticeable integration issues // Initialize the Adjust SDK inside the AppLovin SDK's initialization callback ADJConfig *adjustConfig = [ADJConfig configWithAppToken: @"«your-Adjust-app-token»" environment: ADJEnvironmentSandbox or ADJEnvironmentProduction]; [Adjust appDidLaunch: adjustConfig]; // Start loading ads }]; } ``` -------------------------------- ### Start auto-refresh for banner/MREC (Objective-C) Source: https://support.applovin.com/en/max/ios/ad-formats/banner-and-mrec-ads Starts auto-refresh for a banner or MREC ad. Call this to resume auto-refresh after stopping it. ```objective-c [adView startAutoRefresh]; ``` -------------------------------- ### Start MREC Auto-Refresh with MaxSdk.StartMRecAutoRefresh Source: https://support.applovin.com/en/max/unity/ad-formats/banner-and-mrec-ads Starts auto-refresh for an MREC ad. Use this to resume automatic refresh after stopping it. Replace «ad-unit-ID» with your MREC ad unit ID. ```csharp MaxSdk.StartMRecAutoRefresh(«ad-unit-ID»); ``` -------------------------------- ### Initialize Amazon SDK Source: https://support.applovin.com/en/max/unity/amazon-publisher-services-integration-instructions Call this once before using any Amazon ads. The Amazon Publisher Services SDK requires initialization outside the MAX SDK. ```csharp Amazon.Initialize(amazonAppId); ``` -------------------------------- ### Initialize MATableViewAdPlacer with Table View and Settings (Objective-C) Source: https://support.applovin.com/en/max/ios/ad-formats/native-ads Creates an ad placer for a table view using the provided settings. Use this as the first step when configuring native ads in a table view. ```objective-c self.adPlacer = [MATableViewAdPlacer placerWithTableView: self.tableView settings: settings]; ``` -------------------------------- ### Start Banner Auto-Refresh with MaxSdk.StartBannerAutoRefresh Source: https://support.applovin.com/en/max/unity/ad-formats/banner-and-mrec-ads Starts auto-refresh for a banner ad. Use this to resume automatic refresh after stopping it. Replace «ad-unit-ID» with your banner ad unit ID. ```csharp MaxSdk.StartBannerAutoRefresh(«ad-unit-ID»); ```