{"id":30194167,"url":"https://github.com/alp-kurt/max-ad-implementation-unity","last_synced_at":"2026-02-15T02:02:25.047Z","repository":{"id":309436459,"uuid":"1035898756","full_name":"alp-kurt/max-ad-implementation-unity","owner":"alp-kurt","description":"A clean, well-structured Unity project demonstrating how to integrate and manage AppLovin MAX ads (Banners, Interstitials, and Rewarded Ads) using C# controllers and a central service. Includes event logging for all ad types, toggleable UI, and known-issues documentation. Designed as a client-ready example with maintainable code, easy configuration","archived":false,"fork":false,"pushed_at":"2025-09-19T03:17:00.000Z","size":1035,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T18:44:58.656Z","etag":null,"topics":["applovin","applovin-max","sdk-integration","unity","unity-ads","unity-ads-tutorial","unity-android"],"latest_commit_sha":null,"homepage":"","language":"ShaderLab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alp-kurt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-11T09:01:48.000Z","updated_at":"2025-09-19T03:16:56.000Z","dependencies_parsed_at":"2025-10-05T18:35:41.927Z","dependency_job_id":null,"html_url":"https://github.com/alp-kurt/max-ad-implementation-unity","commit_stats":null,"previous_names":["alp-kurt/max-ad-implementation-unity"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/alp-kurt/max-ad-implementation-unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp-kurt%2Fmax-ad-implementation-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp-kurt%2Fmax-ad-implementation-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp-kurt%2Fmax-ad-implementation-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp-kurt%2Fmax-ad-implementation-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alp-kurt","download_url":"https://codeload.github.com/alp-kurt/max-ad-implementation-unity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alp-kurt%2Fmax-ad-implementation-unity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29465397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T01:01:38.065Z","status":"online","status_checked_at":"2026-02-15T02:00:07.449Z","response_time":118,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applovin","applovin-max","sdk-integration","unity","unity-ads","unity-ads-tutorial","unity-android"],"created_at":"2025-08-13T02:51:56.211Z","updated_at":"2026-02-15T02:02:25.025Z","avatar_url":"https://github.com/alp-kurt.png","language":"ShaderLab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AppLovin MAX Unity Demo\n\nA Unity sample project demonstrating a clean, maintainable integration of **AppLovin MAX** for showing ads:\n- Multiple Banner, Interstitial, and Rewarded placements\n- ScriptableObject profile to configure everything in the Inspector (no code edits)\n- Tiny, single-purpose controllers (per ad type) with safe callback unsubscribe\n- A button helper that triggers ads by label\n\n![AppLovin MAX Unity Demo Screenshot in Unity Editor](images/applovin-demo-app.png)\n\n[Test the app on your own (APK Build 1.2.2)](https://drive.google.com/file/d/1OzIHEC8nNAk1F-vSLpD3YsqLrOG33_F7/view?usp=sharing)\n\n[Watch the app in action (Video Recording)](https://drive.google.com/file/d/1BYvfu6HTYCzlI3IkeQhTREfwakFt5mkN/view?usp=sharing)\n\nThe project implements **all listener and delegate methods** for each ad type — even if only for logging — so you can clearly see the lifecycle of ads and how to hook into them.\n\nThis project and documentation can be extended upon request. New features like Zenject and Reactive demonstration, automated android version or similar useful implementations can be added.\n\n---\n\n## Features\n\n### Ad Types Implemented\n- **Banner** – Toggle on/off, positioned via settings.\n- **Interstitial** – Fullscreen ad between content.\n- **Rewarded A \u0026 Rewarded B** – Two separate reward scenarios for testing.\n\n### Listener Coverage\n\nAll relevant MAX callbacks are implemented and logged:\n\n- **SDK**\n  - `OnSdkInitializedEvent`\n- **Banner**\n  - `OnAdLoadedEvent`\n  - `OnAdLoadFailedEvent`\n  - `OnAdClickedEvent`\n  - `OnAdExpandedEvent`\n  - `OnAdCollapsedEvent`\n  - `OnAdRevenuePaidEvent`\n- **Interstitial**\n  - `OnAdLoadedEvent`\n  - `OnAdLoadFailedEvent`\n  - `OnAdDisplayedEvent`\n  - `OnAdDisplayFailedEvent`\n  - `OnAdClickedEvent`\n  - `OnAdHiddenEvent`\n  - `OnAdRevenuePaidEvent`\n- **Rewarded**\n  - `OnAdLoadedEvent`\n  - `OnAdLoadFailedEvent`\n  - `OnAdDisplayedEvent`\n  - `OnAdDisplayFailedEvent`\n  - `OnAdClickedEvent`\n  - `OnAdHiddenEvent`\n  - `OnAdReceivedRewardEvent`\n  - `OnAdRevenuePaidEvent`\n\n---\n\n## Quick Start\n\n1. Create a Profile\n\n    Right-click in Project: Create → Ads → MAX Ads Profile\n\n2. Add items to:\n\n    * Banners: set label, adUnitId, anchor, background, startHidden\n\n    * Interstitials: set label, adUnitId, preloadOnStart\n\n    * Rewardeds: set label, adUnitId, preloadOnStart, optional rewardKey (e.g., coins, revive) and fallbackAmount\n\n    The profile validates duplicates and empty fields in OnValidate (warnings in Console).\n\n3. Drop a Bootstrap Prefab in Your First Scene\n\n    * Create an empty GameObject called MaxAdsBootstrap\n\n* Add:\n\n    * MaxSdkBootstrap (SDK init; optional verbose logging and test GAID)\n\n    * MaxAds (assign your MaxAdsProfile)\n\n    Both components are designed to live across scenes (via DontDestroyOnLoad [Singleton] in scripts).\n\n4. Add Buttons (Optional)\n\n    Add a Button and attach MaxAdsButton\n\n    * Set Action (e.g., ShowRewarded), Label (must match a profile label), and (optionally) drag a reference to your MaxAds (or let it auto-find).\n    * **This script is helpful for you to check how to call the desired ads in an event driven way.**\n\n\nThat’s it—press Play and use the buttons. Logs will show lifecycle events.\n\n---\n\n## Public API Structure and Script Descriptions\n\n* Banners\n    \n        MaxAds.ShowBanner(\"Home_Banner_1\");\n        MaxAds.HideBanner(\"Home_Banner_1\");\n        MaxAds.ToggleBanner(\"Home_Banner_1\");\n\n* Interstitials\n        \n        MaxAds.ShowInterstitial(\"LevelEnd_Interstitial\");\n        MaxAds.PreloadInterstitial(\"LevelEnd_Interstitial\");\n\n* Rewardeds\n        \n        MaxAds.ShowRewarded(\"Revive_Rewarded\");\n        MaxAds.PreloadRewarded(\"Revive_Rewarded\");\n\n### Reward Routing (Optional, Built-In)\n\nMaxAds listens to each RewardedAds controller’s OnRewardGranted event and calls a tiny router:\n\nIf rewardKey == \"coins\" → ResourceA.ReceiveReward(fallbackAmount)\n\nIf rewardKey == \"revive\" → ResourceB.ReceiveReward(fallbackAmount)\n\n---\n\n## Controllers (What They Do)\n\n* BannerAds\n\n    Creates banner with AdViewConfiguration (anchor / background), safe unsubscribe of callbacks\n\n    * Show, \n    * Hide, \n    * Toggle, \n\n* InterstitialAds\n\n    * Initialize, \n    * Preload, \n    * Show\n\n**Exponential backoff retry on load failures (1→64s)**\n\n**Re-preloads after Hidden / DisplayFailed**\n\n* RewardedAds\n\n**Same lifecycle as Interstitials**\n\n* Raises OnRewardGranted(label) on OnAdReceivedReward\n\nAll controllers use named handlers for MAX callbacks and unsubscribe in OnDestroy, preventing event buildup after script reloads.\n\n---\n\n## How It Works\n\n1. **[Initialization](Assets/Scripts/Max/MaxSdkBootstrap.cs)**\n   - `MaxSdkBootstrap` runs at startup.\n\n2. **[Ad Service](Assets/Scripts/Max/MaxAds.cs)**\n   - `MaxAds` creates and initializes controllers for \n        - Banner, \n        - Interstitial, \n        - Rewarded A, and Rewarded B.\n   - Exposes simple methods: \n        - `ToggleBanner()`, \n        - `ShowInterstitial()`, \n        - `ShowRewardedA()`, \n        - `ShowRewardedB()`.\n\n3. **Controllers**\n   - Each ad type has its own controller: \n        - [BannerAdController](Assets/Scripts/Max/BannerAds.cs), \n        - [InterstitialAdController](Assets/Scripts/Max/InterstitialAds.cs), \n        - [RewardedAdController](Assets/Scripts/Max/RewardedAds.cs).\n   - Subscribes to **all** MAX events and logs them.\n   - Includes retry logic for failed loads (Interstitial \u0026 Rewarded).\n   - Banner appearance and placement is configurable via [MaxAdProfile](Assets/Scripts/Max/MaxAdsProfile.cs).\n\n4. **Rewards**\n   - [ResourcesController](Assets/Scripts/Resources/ResourcesController.cs) listens to `OnAdReceivedRewardEvent`.\n   - Matches ad unit IDs to **ResourceA** or **ResourceB**.\n   - Grants rewards (with fallback amounts if `reward.Amount` is 0).\n   - [ResourceLabel](Assets/Scripts/UI/ResourceLabel.cs) updates UI automatically when resource values change.\n\n5. **UI Binding**\n   - [AdButtonsBinder](Assets/Scripts/UI/AdButtonsBinder.cs) connects Unity UI Buttons to ad service methods once `MaxAdsService` is ready.\n   - [MediationButton](Assets/Scripts/UI/MediationButton.cs) opens the Mediation Debugger.\n\n---\n\n## Debugging Tools\n\n- **Mediation Debugger** – Use the “Open Mediation Debugger” button to inspect network setup.\n- **Verbose Logging** – Toggle in `MaxInitializer` to see detailed logs.\n- **Event Logs** – All ad lifecycle events are logged with `[Banner]`, `[Interstitial]`, `[Rewarded]` tags.\n\n---\n\n## Known Issues\n\nThere is no guard to protect the current Ad Service implementation from pausing/unfocusing the app. There may occur unwanted issues accordingly.\n\n---\n\n## Automated Versioning\n\nThis repo includes automated versioning and continuous integration setup, so commit on main branch triggers version bumping without the need for manual actions.\n\n* Automated Versioning – Uses semantic-release to bump version numbers, generate changelogs, and tag releases based on commit history.\n\n- Why it matters – Ensures that demo builds shared with clients are always reproducible, versioned, and match the code in the repo.\n\n## License\n\nThis sample is for demonstration purposes.\n\n**Logo / Branding Notice:**  \nThe application icon and any sample branding used in this demo **do not belong to me**. They are included **solely to improve UX and presentation** for demonstration purposes. All trademarks, service marks, and logos remain the property of their respective owners. No affiliation or endorsement is implied. If you are a rights holder and would like any asset removed, please contact me and I will take it down immediately.\n\n## Author \u0026 Asset Attribution\n\n**Developer:** Alp Kurt, Berlin, Germany\n\nkrtalp@gmail.com  \n\nIf you have questions about this demo or the implementation details, feel free to reach out.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falp-kurt%2Fmax-ad-implementation-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falp-kurt%2Fmax-ad-implementation-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falp-kurt%2Fmax-ad-implementation-unity/lists"}