03. Unity-Plugin Guide

ONE AdMax for Unity-Plugin Guide

๊ฐœ๋ฐœ ๋ฒ„์ „

Unity

2022.3.11f1

Java SDK (Java 11)

ONE AdMax SDK v1.2.1

์ „์ œ์กฐ๊ฑด (Requirements)

  • Unity 2022.3.11f1 ์ด์ƒ ์‚ฌ์šฉ (Use Unity 2022.3.11f1 or higher.)

  • Android SDK version

    • Minimum API Level 16 ์ด์ƒ ์‚ฌ์šฉ (Minimum API Level 16 or higher.)

    • Target API Level 33 ์ด์ƒ ์‚ฌ์šฉ (Target API Level 33 or higher.)

Android API ๋ ˆ๋ฒจ์€ Project Settings > Player > Other Settings ์—์„œ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (Android API level can be set in Project Settings > Player > Other Settings.)

ONE AdMax for Unity ํ”Œ๋Ÿฌ๊ทธ์ธ ๋‹ค์šด๋กœ๋“œ(ONE AdMax for Unity Plugin Download)

ONE AdMax for Unity ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์‚ฌ์šฉํ•˜๋ฉด Unity ๊ฐœ๋ฐœ์ž๊ฐ€ ์›์Šคํ† ์–ด ๊ด‘๊ณ ๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (The ONE AdMax for Unity plugin allows Unity developers to serve ONE store advertising.)

Java ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ํ•„์š” ์—†์ด Android ์•ฑ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (You can use it in your Android app without having to write Java code.)

์ด ํ”Œ๋Ÿฌ๊ทธ์ธ์€ Unity์—์„œ ๊ด‘๊ณ ๋ฅผ ์š”์ฒญํ•˜๊ธฐ ์œ„ํ•œ C# ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. (It provides a C# interface for requesting ads in Unity.)

ํ”Œ๋Ÿฌ๊ทธ์ธ์šฉ Unity ํŒจํ‚ค์ง€๋Š” (๋งํฌ)์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (The Unity package for the plugin can be found at link.)

ONE AdMax for Unity ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ฐ€์ ธ์˜ค๊ธฐ(Importing ONE AdMax for Unity Plugin)

Unity ๋ฉ”๋‰ด ๋ฐ”์—์„œ Assets > Import Package > Custom Package๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. (From the Unity menu bar, navigate to Assets > Import Package > Custom Package.)

Assets/OneStoreCorpPlugins/com.oneadmax.global ํด๋”๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. (This creates the Assets/OneStoreCorpPlugins/com.oneadmax.global folder.)

EDM4U(External Dependency Manager for Unity)๊ฐ€ ํ•„์ˆ˜๋กœ ๊ฐ™์ด ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค. ๋งŒ์•ฝ, ์ด๋ฏธ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด Import Package ๋‹จ๊ณ„์—์„œ ExternalDependencyManager ๋ฅผ ์ฒดํฌํ•ด์ง€ ํ•˜๊ณ  ์ ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. (EDM4U (External Dependency Manager for Unity is distributed during this process. If already in use, deselect ExternalDependencyManager during the Import Package step.)

์™ธ๋ถ€ ์ข…์†์„ฑ ํฌํ•จ(Including External Dependencies)

ํ”„๋กœ์ ํŠธ์— ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ ๋ฐ ์ข…์†์„ฑ์ด ํฌํ•จ๋˜๋„๋ก ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. (To include the repository and dependencies in your project, follow these steps:)

Project Settings > Player > Publishing Settings > Build

์•„๋ž˜์˜ ๋‘ ๊ฐ€์ง€๋ฅผ ์ฒดํฌํ•ฉ๋‹ˆ๋‹ค. (Check the two items below:)

  • Custom Main Manifest

  • Custom Main Gradle Template

  • Custom Gradle Settings Template

Assets > External Dependency Manager > Android Resolver > Force Resolve ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. (Select Assets > External Dependency Manager > Android Resolver > Force Resolve.)

settingsTemple.gradle ํŒŒ์ผ์— Maven Repository ์ฃผ์†Œ๊ฐ€ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.

mainTemplete.gradle ํŒŒ์ผ์— Maven Module ์ด ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.

ONEAdMax for Unity ํ”Œ๋Ÿฌ๊ทธ์ธ ์ข…์†์„ฑ์€ ๋‹ค์Œ์— ๋‚˜์—ด๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. (Dependencies for the ONE AdMax for Unity plugin are listed in)

Assets/OneStoreCorpPlugins/com.oneadmax.global/Editor/ONEAdMaxDependencies.xml

๋งค์ฒด ํ‚ค๋ฐœ๊ธ‰ ๋ฐ ์ ์šฉํ•˜๊ธฐ(Issuing and Applying a Media Key)

๋งค์ฒด ํ‚ค ๋ฐœ๊ธ‰ ๋ฐ›๋Š” ๋ฐฉ๋ฒ•(How to Issue a Media Key)

๋งค์ฒดํ‚ค๋ฅผ ๋ฐœ๊ธ‰ ๋ฐ›์•˜๋‹ค๋ฉด AndroidManifest.xml์— <meta-data />๋ฅผ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. (Once you have received your media key, you must configure it within your AndroidManifest.xml using the tag.)

<manifest>
    ...
    <application>
        ...
        <activity android:name="com.unity3d.player.UnityPlayerActivity">
            ...
        </activity>

        <meta-data android:name="com.oneadmax.global.appkey" android:value="your app key"/>
    </application>
</manifest>

(!) ์•„๋ž˜ ๋‚ด์šฉ ํ™•์ธํ•ด ์ฃผ์„ธ์š”. (Important: Please check the information below:)

  • ๋งค์ฒดํ‚ค๋ฅผ AndroidManifest.xml ์— ๋„ฃ์—ˆ๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”. (Ensure the media key is correctly placed within the AndroidManifest.xml.)

  • ๋งค์ฒดํ‚ค๋Š” Unity Plugin ๊ณผ ์ƒ๊ด€์—†์ด Java SDK ์—์„œ ์ฝ๋Š” ๊ฐ’์ด๊ธฐ ๋•Œ๋ฌธ์— ํ•ด๋‹น meta-data ์˜ ์œ„์น˜๊ฐ€ application element ๋‚ด๋ถ€์— ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. (Since the media key is read by the Java SDK regardless of the Unity Plugin, it must be located inside the application element.)

SDK์— ์ ์šฉ๋œ ์‚ฌํ•ญ๋“ค(Matters applied to SDK)

Permission

<manifest>
    ...
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    ...
</manifest>

SDK ์ดˆ๊ธฐํ™”(SDK Initialize)

๊ด‘๊ณ ๋ฅผ ๋กœ๋“œํ•˜๊ธฐ ์ „์— ์•ฑ์ด ONEAdMax๋ฅผ ์ดˆ๊ธฐํ™”ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ONEAdMaxClient.Initialize() ์ดˆ๊ธฐํ™”๋Š” ์ตœ์ดˆ ํ•œ ๋ฒˆ๋งŒ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. (The app must Initialize ONE AdMax before loading ads. Reset with ONEAdMaxClient.Initialize() should occur only once.)

๋‹ค์Œ์€ ONEAdMaxClient ๋ฅผ ์ดˆ๊ธฐํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. (Hereโ€™s how to reset ONE AdMaxClient.)

...
using ONEAdMax;
...
public class ONEAdMaxDemo : MonoBehaviour
{
    private static bool _isInitialized = false;
    
    void Start()
    {
        if (!_isInitialized)
        {
            // Initialize the ONEAdMax SDK.
            ONEAdMaxClient.Initialize(() =>
            {
                // This callback is called once the ONEAdMax SDK is initialized.
                _isInitialized = true
            });
        }
    }
}

Log Settings

๊ฐœ๋ฐœ์„ ์œ„ํ•ด ONEAdMax์˜ ์ž์„ธํ•œ ๋กœ๊ทธ๋ฅผ ๋…ธ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (๊ธฐ๋ณธ๊ฐ’: false) (For development, you can expose detailed logs from ONE AdMax (default: false).)

ONEAdMaxClient.SetLogEnable(true);

GDPR Settings

EU์˜ GDPR (General Data protection Regulation) ๋ฒ•์•ˆ์— ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ์•„๋ž˜ API๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. GDPR ๋™์˜๊ฐ€ ํ•„์š”ํ•œ ์œ ์ €์— ํ•œ ํ•ด ์•„๋ž˜ API๋ฅผ ํ˜ธ์ถœํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. (๊ธฐ๋ณธ๊ฐ’: true) (To comply with the EUโ€™s GDPR (General Data Protection Regulation), add the following API. Call this API only for users who require GDPR consent.(default: true))

ONEAdMaxClient.GdprConsentAvailable(true);

COPPA Settings

COPPA(Children's Online Privacy Protection Rule)๋ฒ•์•ˆ์— ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ์•„๋ž˜ API๋ฅผ ์ถ”๊ฐ€ ํ•ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๋””๋ฐ”์ด์Šค์—์„œ๋Š” ๋ชจ๋“  ๊ด‘๊ณ  ํƒ€์ž…์˜ ๊ด‘๊ณ  ์š”์ฒญ์— ๋Œ€ํ•ด No ad ์ฒ˜๋ฆฌ ๋ฉ๋‹ˆ๋‹ค. (๊ธฐ๋ณธ๊ฐ’: false) (To comply with the Children's Online Privacy Protection Rule (COPPA), we've added the following API. This API will ensure that no ads are served on devices where this setting is enabled. (Default: false))

ONEAdMaxClient.tagForChildDirectedTreatment(true);

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ข…๋ฃŒ(Closing Application)

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ข…๋ฃŒ๋  ๋•Œ ๋ฉ”๋ชจ๋ฆฌ์— ํ• ๋‹น๋œ ๋ฆฌ์†Œ์Šค(View, Memory)๋ฅผ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. (Delete allocated resources (View, Memory) when the application closes.)

void OnApplicationQuit()
{
    ONEAdMaxClient.Destroy();
}

๋ฏธ๋””์—์ด์…˜ ์„ค์ •(๋งํฌ) (Mediation Settings)

๊ด‘๊ณ  ํ˜•์‹ ์„ ํƒํ•˜๊ธฐ(Choosing an Ad Format)

์ด์ œ ๊ด‘๊ณ ๋ฅผ ๊ตฌํ˜„ํ•  ์ค€๋น„๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ONE AdMax ๋Š” ๋‹ค์–‘ํ•œ ๊ด‘๊ณ  ํ˜•์‹์„ ์ œ๊ณตํ•˜๋ฏ€๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๊ด‘๊ณ  ํ˜•์‹์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (Now you are ready to implement ads. ONE AdMax provides various ad types that you can choose from.)

๋ณด์ƒํ˜• ๋น„๋””์˜ค ๊ด‘๊ณ (Reward Video Ads)

๋ณด์ƒ์„ ์ œ๊ณตํ•˜๋Š” ๋น„๋””์˜ค ๊ด‘๊ณ ์ž…๋‹ˆ๋‹ค. ๋น„๋””์˜ค ๊ด‘๊ณ  ์ข…๋ฃŒ ์‹œ Complete event callback์œผ๋กœ ๊ด‘๊ณ  ์ฐธ์—ฌ ์™„๋ฃŒ ์ •๋ณด๋ฅผ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. (These are reward video ads. When the video ad closes, information about the completion of ad participation is sent through Complete event callback.)

3-1. Reward Video ADs for Unity(Implementing Reward Video Ads)

์ „๋ฉด ๊ด‘๊ณ (Interstitial Ads)

์ „๋ฉด ๊ด‘๊ณ ๋Š” ์•ฑ์˜ ํ™”๋ฉด ์ „์ฒด๋ฅผ ๋ฎ๋Š” ๊ด‘๊ณ ์ž…๋‹ˆ๋‹ค. ์™„๋ฃŒ๋˜์—ˆ๊ฑฐ๋‚˜ ์œ ์ €์— ์˜ํ•ด ์ค‘๋‹จ ๋˜์—ˆ์„ ๊ฒฝ์šฐ ์•ฑ์˜ ํ™”๋ฉด์œผ๋กœ ์ „ํ™˜๋ฉ๋‹ˆ๋‹ค. (Interstitial ads are a form of advertising that covers the entire screen. When advertisement is completed or stopped by the user, the screen will return to the app.)

3-2. Interstitial ADs for Unity(Implementing Interstitial Ads)

๋ฐฐ๋„ˆ ๊ด‘๊ณ ๋Š” ์•ฑ์˜ ์ผ๋ถ€๋ฅผ ์ฐจ์ง€ํ•˜๋Š” ์ง์‚ฌ๊ฐํ˜• ๊ด‘๊ณ ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์œ„์น˜๋ฅผ ์„ค์ •ํ•˜๊ณ  ์‹œ๊ฐ„์„ ์„ค์ •ํ•˜์—ฌ ์ž๋™์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (Banner ads expose rectangular ads that take up a portion of your app. You can set your location and set the time to automatically refresh.)

3-3. Banner ADs for Unity(Implementing Banner Ads)

์ „๋ฉด ๋น„๋””์˜ค ๊ด‘๊ณ (Interstitial Video Ads)

์ „๋ฉด ๊ด‘๊ณ ์™€ ๋™์ผํ•˜์ง€๋งŒ ์ด๋ฏธ์ง€๊ฐ€ ์•„๋‹Œ ์˜์ƒ์ด ๋…ธ์ถœ๋ฉ๋‹ˆ๋‹ค. ์˜์ƒ์„ ๋กœ๋“œํ•˜๋Š” ๊ณผ์ •์ด ์ „๋ฉด ๊ด‘๊ณ  ๋ณด๋‹ค ์˜ค๋ž˜ ์†Œ์š”๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (It is the same as an interstitial ad, but a video is exposed instead of an image. The video loading process may take longer than an interstitial ad.)

3-4. Interstitial Video ADs (Non Reward)(Implementing Interstitial Video Ads)

Last updated