Google 모바일 광고 Unity 플러그인을 사용하면 Unity 개발자가 Java 또는 Objective-C 코드를 작성하지 않고도 Android 및 iOS 앱에 Google 모바일 광고를 게재할 수 있습니다. 이 플러그인에서는 Unity 프로젝트의 C# 스크립트에서 사용되는 광고를 요청하기 위한 C# 인터페이스를 제공합니다.
광고를 로드하기 전에 앱에서 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});
[null,null,["최종 업데이트: 2025-08-31(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, with Xcode 15.3 or higher for iOS deployment and a minimum Android API level of 21 for Android deployment.\u003c/p\u003e\n"],["\u003cp\u003eThe plugin can be installed via OpenUPM-CLI, OpenUPM, or by importing a \u003ccode\u003e.unitypackage\u003c/code\u003e from GitHub.\u003c/p\u003e\n"],["\u003cp\u003eBefore loading ads, initialize the Google Mobile Ads SDK by calling \u003ccode\u003eMobileAds.Initialize()\u003c/code\u003e at app launch.\u003c/p\u003e\n"],["\u003cp\u003eAdMob offers various ad formats including banner, interstitial, native, and rewarded, each with implementation guides provided.\u003c/p\u003e\n"]]],["The Google Mobile Ads Unity plugin allows Unity developers to integrate Google mobile ads into Android and iOS apps using C#. Installation requires Unity 2019.4+, specific Xcode/iOS and Android API levels, and the use of OpenUPM or direct GitHub import. Developers must remove old `.unitypackage` assets if migrating. The SDK needs to be initialized with `MobileAds.Initialize()`. Developers can set an Ad Manager app ID and choose from various ad formats such as Banner, Interstitial, Native, and Rewarded ads.\n"],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/quick-start \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/quick-start \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/quick-start \"View this page for the Unity platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/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\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 Ad Manager 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[Ad Manager app ID](//support.google.com/admanager/answer/1656921)\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](/ad-manager/mobile-ads-sdk/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](/ad-manager/mobile-ads-sdk/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](/ad-manager/mobile-ads-sdk/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](/ad-manager/mobile-ads-sdk/unity/rewarded)"]]