๊ด๊ณ ๋ฅผ ๋ก๋ํ๊ธฐ ์ ์ ์ฑ์ด ONEAdMax๋ฅผ ์ด๊ธฐํ ํด์ผํฉ๋๋ค.
ONEAdMaxClient.Initialize() ์ด๊ธฐํ๋ ์ต์ด ํ ๋ฒ๋ง ์ํํด์ผ ํฉ๋๋ค.
(Before loading ads, the app must reset ONE AdMax. The resetting with ONEAdMaxClient.Initialize() should be performed only once.)
๋ค์์ ONEAdMaxClient ๋ฅผ ์ด๊ธฐํ ํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
(The following is the procedure for resetting ONE AdMax Client:)
...usingONEAdMax;...publicclassONEAdMaxDemo:MonoBehaviour{privatestaticbool _isInitialized =false;voidStart() {if (!_isInitialized) { // Initialize the ONEAdMax SDK.ONEAdMaxClient.Initialize(() => { // This callback is called once the ONEAdMax SDK is initialized. _isInitialized =true }); } }}
์ ์ ์๋ณ๊ฐ ์ ๋ ฅ(User Identifier Entry)
์ ์ ์๋ณ๊ฐ์ ๋ณด์ํ ๋น๋์ค ์์ฒญ ์๋ฃ ์ ์๋ฃ ์ ์ ๋ฅผ ์๋ณํ๊ธฐ ์ํด ์ฌ์ฉ๋๋ ๊ฐ์ ๋๋ค.
(The user identifier is utilized to identify the user who completes watching a reward video ad.)
1๋ช ์ ์ ์ ๋ 1๊ฐ์ ๊ณ ์ ํ ์ ์ ์๋ณ๊ฐ์ ๊ฐ์ ธ์ผํ๋ฉฐ, ๊ฐ๋ณ์ ์ธ ๊ฐ์ ์ฌ์ฉํด์๋ ์๋ฉ๋๋ค.
(Each user must have a unique user identifier, and it should not be a variable value.)
๊ฐ์ธ์ ๋ณด( ์ด๋ฉ์ผ, ์ด๋ฆ, ์ ํ๋ฒํธ, ์๋ณ๊ฐ๋ฅํ ์ ์ ์์ด๋ ๋ฑ )์ด ํฌํจ๋์ด์๋ ์๋ฉ๋๋ค.
(It must not include personal information (e.g. email, name, phone number, identifiable user ID, etc.))
ํ๊ธ, ํน์๋ฌธ์, ๊ณต๋ฐฑ ๋ฑ์ด ํฌํจ๋ ๊ฒฝ์ฐ์๋ ๋ฐ๋์ URL ์ธ์ฝ๋ฉ ์ฒ๋ฆฌ๋ฅผ ํ์ฌ ์ฌ์ฉํ์ฌ์ผ ํฉ๋๋ค.
(If it includes Korean characters, special characters, or spaces, URL encoding is mandatory.)
์ ์ ๊ฐ ๊ด๊ณ ์ ์ง์ ํ๊ธฐ ์ ์ ์ค์ ๋์ด์ผ ํฉ๋๋ค.
(It needs to be set before the user enters the ad.)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ์์ (Reward Video Ad Example)
์๋ ์ํ ์ฝ๋๋ ๋ณด์ํ ๋น๋์ค ๊ด๊ณ ์ฌ์ฉ ๋ฐฉ๋ฒ์ ๋ํด ์์ธํ ์ค๋ช ํฉ๋๋ค.
OAMRewardVideo ์ธ์คํด์ค๋ฅผ ์์ฑํ๊ณ , ์ด๋ฒคํธ๋ฅผ ์ฒ๋ฆฌํ์ฌ ๊ธฐ๋ฅ์ ํ์ฅํ ์ ์์ต๋๋ค.
(The sample code below elaborates on the usage of reward video ads. You can create an OAMRewardVideo instance and extend its functionality by handling events.)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ์ธ์คํด์ค ์์ฑํ๊ธฐ(Creating a Reward Video Ad Instance)
์๋๋ ๋ณด์ํ ๋น๋์ค ๊ด๊ณ ์ ์ธ์คํด์ค๋ฅผ ์์ฑํ๊ธฐ ์ํ ์์ ์ ๋๋ค.
(The following is an example of how to create an instance for reward video ads:)
publicclassRewardVideoAdController:MonoBehaviour{OAMRewardVideo _rewardVideoAd /// <summary> /// Creates the ad. /// </summary>publicvoidCreateRewardVideoAd() {Debug.Log("Creating Reward video ad.");if (_rewardVideoAd !=null) {Debug.LogWarning("Already have a Reward video ad.");return; } _rewardVideoAd =newOAMRewardVideo(); }}
๊ด๊ณ ์ ๋ํ ๋คํธ์ํฌ ์ค์ผ์ฅด ํ์์์์ ์ค์ ํฉ๋๋ค. (๊ธฐ๋ณธ๊ฐ: 5์ด)
๊ด๊ณ ๋ก๋ฉ ์ ๊ฐ ๋คํธ์ํฌ ๋ณ๋ก ํ์์์ ์๊ฐ์ ์ฃผ์ด ํด๋น ์๊ฐ ์์ ๊ด๊ณ ๋ฅผ ๋ฐ์ง ๋ชปํ ๊ฒฝ์ฐ, ๋ค์ ๋คํธ์ํฌ๋ก ๋์ด๊ฐ๊ฒ ๋ฉ๋๋ค.
(Set the network schedule timeout for ads (Default: 5 seconds). This timeout dictates the time each network has to deliver an ad before moving to the next network during ad loading.)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ์ ์ด๋ฒคํธ ์ฒญ์ทจํ๊ธฐ (์ ํ์ฌํญ)(Listening to Reward Video Ad Events (Optional))
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ๋ฅผ ๋ถ๋ฌ์ฌ ๋ ๋ฐ์ํ๋ ์ด๋ฒคํธ์ ๋ํ ๋ฆฌ์ค๋๋ฅผ ์ค์ ํฉ๋๋ค.
(Set a listener for events that occur while loading reward video ads.)
/// <summary>/// Register to events the reward video ad may raise./// </summary>privatevoidRegisterEvents(OAMRewardVideo ad){ // Raised when an ad is loaded into the reward video ad.ad.OnLoaded+= () => {Debug.Log("Reward video ad loaded."); }; // Raised when an ad fails to load into the reward video ad.ad.OnLoadFailed+= (OAMError error) => {Debug.LogError("Reward video ad failed to load an ad with error : "+ error); }; // Raised when an ad opened full screen content.ad.OnOpened+= () => {Debug.Log("Reward video ad has been opened."); }; // Raised when the ad failed to open full screen content.ad.OnOpenFailed+= (OAMError error) => {Debug.LogError("Reward video ad failed to open an ad with error : "+ error); }; // Raised when the ad closed full screen content.ad.OnClosed+= () => {Debug.LogError("Reward video ad is closed."); }; // Raised when the ad completed full screen content.ad.OnCompleted+= (int adNetworkNo,bool compledted) => {Debug.Log("Reward video ad completed : "+"adNetworkNo="+ adNetworkNo +", compledted="+ compledted); }; // Raised when a click is recorded for an ad. on completed ์์ completed ๊ฐ true ์ผ ๋๋ง ๋ฆฌ์๋ ์ง๊ธad.OnClicked+= () => {Debug.Log("Reward video ad was clicked."); };}
// These ad units are configured to always serve test ads. privatereadonlystring _placementId ="string your placement ID";_rewardVideoAd.Create(_placementId);
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ๋ก๋ ํ๊ธฐ(Loading Reward Video Ads)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ Load() API๋ฅผ ํธ์ถํ์ฌ ์๋ฒ์ ๊ด๊ณ ๋ฅผ ์์ฒญํฉ๋๋ค.
(Request ads from the server by calling the reward video ads Load() API.)
/// <summary>/// Loads the ad./// </summary>publicvoidLoad(){if (_rewardVideoAd ==null) {Debug.LogWarning("The reward video ad is null.");return; }_rewardVideoAd.Load();}
๊ด๊ณ ํธ์ถ์ ๋ํ ๊ฒฐ๊ณผ๋ก ๊ด๊ณ ์์ ์ ์คํจํ ๊ฒฝ์ฐ Load()๋ฅผ ์ฌํธ์ถ ํ๋ฉด ์๋ฉ๋๋ค. ๊ณผ๋ํ ๊ด๊ณ ์์ฒญ์ ์ฐจ๋จ ์ฌ์ ๊ฐ ๋ฉ๋๋ค.
(If you fail to receive ad, do not recall Load() as excessive ad requests may lead to blocks.)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ๋ ธ์ถํ๊ธฐ(Exposing Reward Video Ad)
๋ก๋๊ฐ ์๋ฃ๋๋ฉด ๊ด๊ณ ๋ฅผ ๋ ธ์ถ์ ์ํ๋ ์์ ์ Show() API๋ฅผ ํธ์ถํ์ฌ ํ๋ฉด์ ๋ ธ์ถ ์ํต๋๋ค.
(Once loaded, call the Show() API when you want to expose the ad on the screen.)
/// <summary>/// Shows the ad./// </summary>publicvoidShow(){if (_rewardVideoAd !=null&&_rewardVideoAd.IsLoaded()) {Debug.Log("Showing reward video ad.");_rewardVideoAd.Show(); }else {Debug.LogError("The reward video ad hasn't loaded yet."); }}
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ๋ฉ๋ชจ๋ฆฌ ํด์งํ๊ธฐ(Deleting Memory of Reward Video Ads)
๋ณด์ํ ๊ด๊ณ ์ ์ธ์คํด์ค ๋ด์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ํด์ง ํฉ๋๋ค.
(Delete the memory within the instance of the reward ad.)
/// <summary>/// Destroys the ad./// </summary>publicvoidDestroy(){if (_rewardVideoAd !=null) {Debug.Log("Destroying reward video ad.");_rewardVideoAd.Destroy(); _rewardVideoAd =null; }}
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ๋ก๋ ์ฌ๋ถ ์ฒดํฌํ๊ธฐ(Checking if Reward Video Ads are Loaded)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ ์ ๋ก๋ ์ฌ๋ถ๋ฅผ ์ฒดํฌํฉ๋๋ค. (return ture | false)
(Check the loading status of reward video ads (return true | false).)
_rewardVideoAd.IsLoaded();
์ดํ๋ฆฌ์ผ์ด์ ์ ๋ผ์ดํ์ฌ์ดํด ํ์ฅํ๊ธฐ(Extending the Application's Lifecycle)
๋ฐฐ๋ ๊ด๊ณ ๊ฐ ๋ ธ์ถ๋๊ณ ์๋ ์ดํ๋ฆฌ์ผ์ด์ ์ onPause / onResume์ฌ๋ถ๋ฅผ ์ฒดํฌํ๊ธฐ ์ํด ๊ตฌํํด์ผ ํฉ๋๋ค.
(Implement checks for the onPause / onResume states of applications exposeing banner ads.)
publicclassRewardVideoAdController:MonoBehaviour{voidOnApplicationPause(bool pauseStatus) { // You should call events for pause and resume in the application lifecycle._rewardVideoAd?.OnPause(pauseStatus); }}
์ฃผ์์ฌํญ
์ฒ๋ฆฌํ์ง ์์์ ๊ฒฝ์ฐ third-party mediation์ ์ฌ์ฉ์์ ๋ฆฌํฌํธ ์์น๊ฐ ๋๋ฝ๋๋ ๊ฒฝ์ฐ๊ฐ ๋ฐ์ํฉ๋๋ค.
(Failure to do so may result in missing report metrics when using third-party mediation.)
๋ณด์ํ ๋น๋์ค ๊ด๊ณ CS ํ์ด์ง ํธ์ถ(Calling the Reward Video Ads CS Page)
๋ณด์ํ ๋น๋์ค ๊ด๋ จ CS ์ ์ ํ์ด์ง๋ฅผ ๋ ธ์ถ ์ํค๊ธฐ ์ํด์๋ ์๋ API๋ฅผ ํธ์ถํ์ฌ ์ค๋๋ค.
(To expose the reward video-related CS reception page, call the specified API below.)
ONE AdMax๋ง ์ฐ๋ํ๋ ๊ฒ๋ ๋ฌด๋ฐฉํ๋ ์์ ์ ์ธ Fill-rate ๋ฅผ ์ํด AppLovin, Unityads ๋ฑ์ ์ถ๊ฐ ์ฐ๋์ ๊ถ์ฅ ํฉ๋๋ค.
(Integrating solely with ONE AdMax is acceptable, but for a stable fill rate, additional integration with platforms like AppLovin and Unityads is recommended.)