Google 모바일 광고 Unity 플러그인을 사용하면 Unity 개발자가 Java 또는 Objective-C 코드를 작성하지 않고도 Android 및 iOS 앱에 Google 모바일 광고를 게재할 수 있습니다. 이 플러그인에서는 Unity 프로젝트의 C# 스크립트에서 사용되는 광고를 요청하기 위한 C# 인터페이스를 제공합니다.
Unity 메뉴 옵션 Assets(확장 소재) > Import package(패키지 가져오기) > Custom Package(맞춤 패키지)를 선택하고 모든 항목을 가져와서 .unitypackage 파일을 가져옵니다.
외부 종속 항목 포함
Google 모바일 광고 Unity 플러그인은 Unity Play 서비스 리졸버 라이브러리와 함께 배포됩니다. 이 라이브러리는 Android 전용 라이브러리(예: AAR) 또는 iOS CocoaPods에 대한 액세스 권한이 필요한 Unity 플러그인에서 사용하기 위한 것입니다. 이 라이브러리는 Unity 플러그인에 종속 항목을 선언하는 기능을 제공합니다. 그러면 종속 항목이 자동으로 결정되어 Unity 프로젝트에 복사됩니다.
다음 단계에 따라 프로젝트에 모든 종속 항목이 포함되도록 하세요.
Android
Project Settings(프로젝트 설정) > Player(플레이어) > Android > Publishing Settings(게시 설정) > Build(빌드)로 이동한 후 다음을 선택합니다.
광고를 로드하기 전에 앱에서 MobileAds.Initialize()를 호출하여 Google 모바일 광고 SDK를 초기화합니다. 이 작업은 앱 실행 시 한 번만 처리하면 됩니다.
다음은 MobileAds.Initialize() 호출 방법의 예입니다.
MobileAds.Initialize((InitializationStatusinitstatus)=>
{if(initstatus==null){Debug.LogError("Google Mobile Ads initialization failed.");return;}Debug.Log("Google Mobile Ads initialization complete.");// Google Mobile Ads events are raised off the Unity Main thread. If you need to// access UnityEngine objects after initialization,// use MobileAdsEventExecutor.ExecuteInUpdate(). For more information, see:// https://developers.google.com/admob/unity/global-settings#raise_ad_events_on_the_unity_main_thread});
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-28(UTC)"],[[["\u003cp\u003eThe Google Mobile Ads Unity plugin allows Unity developers to integrate Google mobile ads into Android and iOS apps without writing Java or Objective-C.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers must use Unity 2019.4 or higher, along with specific Xcode and Android requirements for iOS and Android deployments, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe plugin can be imported using OpenUPM-CLI, OpenUPM, or GitHub, with instructions for each method provided.\u003c/p\u003e\n"],["\u003cp\u003eBefore loading ads, initialize the Google Mobile Ads SDK by calling \u003ccode\u003eMobileAds.Initialize()\u003c/code\u003e once at app launch, and select from various ad formats like Banner, Interstitial, Native, Rewarded, Rewarded Interstitial, and App Open.\u003c/p\u003e\n"],["\u003cp\u003eThe plugin utilizes the Unity Play Services Resolver library for dependency management, which requires specific steps for Android and iOS to ensure all dependencies are included.\u003c/p\u003e\n"]]],["The Google Mobile Ads Unity plugin enables Unity developers to integrate Google mobile ads into Android and iOS apps using C#. Key actions include: setting up prerequisites (Unity version, API levels, Xcode, CocoaPods), installing the plugin via OpenUPM or GitHub, and removing old `.unitypackage` assets. You will need to include external dependencies, and resolve Android dependencies. The next step is to enter your AdMob app ID in settings, initialize the SDK with `MobileAds.Initialize()`, then select and implement an ad format (banner, interstitial, native, rewarded, rewarded interstitial, app open).\n"],null,["Select platform: [Android](/admob/android/quick-start \"View this page for the Android platform docs.\") [iOS](/admob/ios/quick-start \"View this page for the iOS platform docs.\") [Unity](/admob/unity/quick-start \"View this page for the Unity platform docs.\") [Flutter](/admob/flutter/quick-start \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nThe Google Mobile Ads Unity plugin lets Unity developers serve Google mobile ads\non Android and iOS apps without having to write Java or Objective-C code. The\nplugin provides a C# interface for requesting ads that is used by C# scripts in\nyour Unity project.\n\nThis guide is intended for publishers who want to monetize a Unity app.\n\nPrerequisites\n\n- Use Unity Editor 2019.4 or higher\n- To deploy to iOS\n - Xcode 16.0 or higher\n - Target iOS 12.0 or higher\n - [CocoaPods](//guides.cocoapods.org/using/getting-started.html)\n- To deploy to Android\n - Minimum Android API level of 23 or higher\n - Target Android API level 34 or higher\n\n\u003c!-- --\u003e\n\n- Recommended: [Create an AdMob\n account](//support.google.com/admob/answer/2784575) and [register an\n Android or iOS app](//support.google.com/admob/answer/2773509)\n\nAndroid API level is set in **Project Settings \\\u003e Player \\\u003e\nAndroid \\\u003e Other Settings \\\u003e Other Settings**.\n\nImport the Mobile Ads for Unity plugin \n\nOpenUPM-CLI\n\nIf you have the [OpenUPM CLI](//github.com/openupm/openupm-cli#installation)\ninstalled, you can install the OpenUPM registry with the following\ncommand: \n\n openupm add com.google.ads.mobile\n\n\nRemove `.unitypackage` plugin assets\n\nIf you are migrating from using a `.unitypackage` to using OpenUPM, you\nmust manually uninstall the assets from the old location. Remove the\nfollowing directories that were imported from the `.unitypackage`:\n\n- Assets/ExternalDependencyManager\n- Assets/GoogleMobileAds\n- Assets/Plugins/Android/googlemobileads-unity.aar\n- Assets/Plugins/Android/GoogleMobileAdsPlugin\n- Assets/Plugins/iOS/GADUAdNetworkExtras\n- Assets/Plugins/iOS/unity-plugin-library.a \u003cbr /\u003e\n\nOpenUPM\n\n1. Open the [package manager settings](//docs.unity3d.com/Manual/class-PackageManager.html) by selecting the Unity menu option **Edit \\\u003e Project Settings \\\u003e Package Manager**.\n2. Add OpenUPM as a scoped registry to the Package Manager window:\n\n Name: OpenUPM\n URL: https://package.openupm.com\n Scopes: com.google\n\n3. Open the [package manager menu](//docs.unity3d.com/Manual/upm-ui-install.html) by selecting the Unity\n menu option **Window \\\u003e Package Manager**.\n\n4. Set the manager scope drop-down to select **My Registries**.\n\n5. Select the **Google Mobile Ads for Unity** package from the package list\n and press **Install**.\n\n\nRemove `.unitypackage` plugin assets\n\nIf you are migrating from using a `.unitypackage` to using OpenUPM, you\nmust manually uninstall the assets from the old location. Remove the\nfollowing directories that were imported from the `.unitypackage`:\n\n- Assets/ExternalDependencyManager\n- Assets/GoogleMobileAds\n- Assets/Plugins/Android/googlemobileads-unity.aar\n- Assets/Plugins/Android/GoogleMobileAdsPlugin\n- Assets/Plugins/iOS/GADUAdNetworkExtras\n- Assets/Plugins/iOS/unity-plugin-library.a \u003cbr /\u003e\n\nImport from GitHub\n\n1. Download the latest [`.unitypackage`](//github.com/googleads/googleads-mobile-unity/releases/latest) release from GitHub.\n2. Import the `.unitypackage` file by selecting the Unity menu option **Assets \\\u003e Import package \\\u003e Custom Package** and importing all items.\n\nSet your AdMob app ID\n\nIn the Unity editor, select **Assets \\\u003e Google Mobile Ads \\\u003e Settings**\nfrom the menu.\n\nEnter your Android and iOS\n\n[AdMob app ID](//support.google.com/admob/answer/6232340)\n\nin each field.\n\nInitialize the SDK\n\nBefore loading ads, have your app initialize the Google Mobile Ads SDK by\ncalling `MobileAds.Initialize()`. This needs to be done only once, ideally at\napp launch.\n| **Warning:** Ads can be preloaded by the Google Mobile Ads SDK or mediation partner SDKs upon calling `MobileAds.Initialize()`. If you need to obtain consent from users in the European Economic Area (EEA), set any request-specific flags, such as `tagForChildDirectedTreatment` or `tag_for_under_age_of_consent`, or otherwise take action before loading ads. Verify you do this before initializing the Google Mobile Ads SDK.\n\nHere's an example of how to call `MobileAds.Initialize()`: \n\n MobileAds.Initialize((InitializationStatus initstatus) =\u003e\n {\n if (initstatus == null)\n {\n Debug.LogError(\"Google Mobile Ads initialization failed.\");\n return;\n }\n\n Debug.Log(\"Google Mobile Ads initialization complete.\");\n\n // Google Mobile Ads events are raised off the Unity Main thread. If you need to\n // access UnityEngine objects after initialization,\n // use MobileAdsEventExecutor.ExecuteInUpdate(). For more information, see:\n // https://developers.google.com/admob/unity/global-settings#raise_ad_events_on_the_unity_main_thread\n }); \n https://github.com/googleads/googleads-mobile-unity/blob/0f0ef22a4a4b1894951539831f9e3947ff634a75/samples/HelloWorld/Assets/Scripts/GoogleMobileAdsController.cs#L105-L134\n\nIf you're using mediation, wait until the callback occurs before loading ads to\nverify that all mediation adapters are initialized.\n\nSelect an ad format\n\nThe Google Mobile Ads SDK is now included in your Unity app when deploying to\neither the Android or iOS platform. You're now ready to implement an ad. AdMob\noffers a number of different ad formats, so you can choose the one that makes\nfor the best user experience.\n\nBanner\n\nBanner ad units display rectangular ads that occupy a portion of an app's\nlayout. They can refresh automatically after a set period of time. This means\nusers view a new ad at regular intervals, even if they stay on the same\nscreen in your app. They're also the simplest ad format to implement. \n\n[Implement banner ads](/admob/unity/banner)\n\nInterstitial\n\nInterstitial ad units show full-page ads in your app. Place them at natural\nbreaks and transitions in your app's interface, such as after level completion\nin a gaming app. \n\n[Implement interstitial ads](/admob/unity/interstitial)\n\nNative\n\nNative ads are ads where you can customize the way assets such as headlines and\ncalls to action are presented in your apps. By styling the ad yourself, you can\ncreate a natural, unobtrusive ad presentations that can add to a rich user\nexperience. \n\n[Implement native ads](/admob/unity/native)\n\nRewarded\n\nRewarded ad units enable users to play games, take surveys, or watch videos to\nearn in-app rewards, such as coins, extra lives, or points. You can set\ndifferent rewards for different ad units, and specify the reward values and\nitems the user received. \n\n[Implement rewarded ads](/admob/unity/rewarded)\n\nRewarded interstitial\n\nRewarded interstitial is a new type of incentivized ad format that lets you\noffer rewards, such as coins or extra lives, for ads that appear automatically\nduring natural app transitions.\n\nUnlike rewarded ads, users aren't required to opt in to view a rewarded\ninterstitial.\n\nInstead of the opt-in prompt in rewarded ads, rewarded interstitials require an\nintro screen that announces the reward and gives users a chance to opt out if\nthey want to do so. \n\n[Implement rewarded interstitial ads](/admob/unity/rewarded-interstitial)\n\nApp open\n\nApp open is an ad format that appears when users open or switch back to your\napp. The ad overlays the loading screen. \n\n[Implement app open ads](/admob/unity/app-open)"]]