로딩중입니다
adPOPcorn DA: Unity iOS
4/29/2016 4:24:23 PM

adPOPcorn DA

adPOPcorn DA(Display Ad) is the monetized solution that involves 띠배너, front and end native ad, pop up.

Using a mediation feature with no additional fee, you can maximize profit.

For more information about the service, check the article below.

[about AdPOPcorn DA]

 

NOTE
  1. IGAW Integration must be set before integration adPOPcorn add-on. [IGAW General Integration: Unity iOS]
  2. IgaworksUnityPlugin_iOS~*.unitypackage file must to included in a Xcode project for adPOPcorn integration. [Install SDK: Unity iOS]



Banner Ad

Banner is very general type of DA ad that shows up on either top or bottom.


Create Instance

Call DAInitWithBannerViewSize API to create instance for banner ad exposure. Each parameter's description is located below.

  • size : Size of banner view
  • origin : Location of banner view
  • appKey : Issued IGAWorks app key
  • spotKey : Spotkey created at an AdPOPcorn DA management page
public class IgawDASampleScene : MonoBehaviour{

	private string BANNER_SPOTKEY = "bannerspotkey";

	void Start(){   
		AdPopcornDAPluginIOS.DAInitWithBannerViewSize(AdPopcornDAPluginIOS.DABannerViewSize320x50, 0.0f, 568.0f - 50.0f, “Issued app key”, "BANNER_SPOTKEY");
	}
}


Banner Size

adPopcorn DA banner currently only offers iPhone and iPod Touch size(W:320, H:50), and use DABannerViewSize320x50.


Ad Management

Call this API when you need to manage the banner ad.

// Close banner ad
AdPopcornDAPluginIOS.DACloseBannerView();


Mediation Refresh Period

Use DABannerViewSetAdRefreshRate API to set refresh period on each network’s ad when the mediation feature is used from 30 secs to 120secs.

If you don’t specify, the default value is 30 seconds.

AdPopcornDAPluginIOS.DABannerViewSetAdRefreshRate(37);


Delegate

Creates delegate for the occurring event from banner ad. These are the examples.

  • daBannerViewDidLoadAd : Banner Ad Load Succeed.
  • daBannerViewdidFailToReceiveAdWithError : Banner Ad Load Failed(Check the table below for error code).
  • daBannerViewWillLeaveApplication : Banner Ad Click.
public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		AdPopcornDAPluginIOS.AdPopcornDASetCallbackHandler("MySampleScene");

		// Add delegate handler
		AdPopcornDAPluginIOS.DABannerViewSetDelegate();

		// Add delegate 
		AdPopcornDAPluginIOS.daBannerViewDidLoadAd += HandleDABannerViewDidLoadAd;
		AdPopcornDAPluginIOS.daBannerViewDidFailToReceiveAdWithError += HandleDABannerViewDidFailToReceiveAdWithError;
		AdPopcornDAPluginIOS.daBannerViewWillLeaveApplication += HandleDABannerViewWillLeaveApplication;
	}

        // Materialize delegate
	public void HandleDABannerViewDidLoadAd()
	{
		Debug.Log ("IgaworksADSample HandleDABannerViewDidLoadAd");
	}
	public void HandleDABannerViewDidFailToReceiveAdWithError(string error)
	{
		Debug.Log ("IgaworksADSample HandleDABannerViewDidFailToReceiveAdWithError : " + error);
	}
	public void HandleDABannerViewWillLeaveApplication()
	{
		Debug.Log ("IgaworksADSample HandleDABannerViewWillLeaveApplication");
	}
}



Interstitial Ad

Interstitial ad covers the entire screen for ad. Check the following example for integration.


Create Instance

Create the instance for interstitial ad.

public class IgawDASampleScene : MonoBehaviour{

	private string INTERSTITIAL_SPOTKEY = "interstitialspotkey";

	void Start(){   
		AdPopcornDAPluginIOS.DAInterstitialAdInitWithKey(“Issued app Key”, "INTERSTITIAL_SPOTKEY");
	}
}

interstitial ad spotkey: Spotkey created at an adPOPcorn DA management page.


Ad Exposure

Use DAInterstitialAdPresentFromViewController API to expose the interstitial ad.

AdPopcornDAPluginIOS.DAInterstitialAdPresentFromViewController();


Delegate

Creates delegate for the occurring event from full-size ad. These are the examples.

  • daInterstitialAdDidLoad : interstitial Ad Load Succeed.
  • daInterstitialAdDidFailToReceiveAdWithError : interstitial Ad Load Failed(Check the table below for error code).
  • daInterstitialAdWillLeaveApplication : interstitial Ad Click.
  • daInterstitialAdWillOpen : Call Before  interstitial Ad Opens.
  • daInterstitialAdDidOpen : Call After  interstitial Ad Opens.
  • daInterstitialAdWillClose : Call Before  interstitial Ad Closes.
  • daInterstitialAdDidClose :  Call After  interstitial Ad Closes
public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		AdPopcornDAPluginIOS.AdPopcornDASetCallbackHandler("MySampleScene");

		// Add delegate handler
		AdPopcornDAPluginIOS.DAInterstitialAdSetDelegate();

		// Add delegate
		AdPopcornDAPluginIOS.daInterstitialAdDidLoad += HandleDAInterstitialAdDidLoad;
		AdPopcornDAPluginIOS.daInterstitialAdDidFailToReceiveAdWithError += HandleDAInterstitialAdDidFailToReceiveAdWithError;
		AdPopcornDAPluginIOS.daInterstitialAdWillLeaveApplication += HandleDAInterstitialAdWillLeaveApplication;
		AdPopcornDAPluginIOS.daInterstitialAdWillOpen += HandleDAInterstitialAdWillOpen;
		AdPopcornDAPluginIOS.daInterstitialAdDidOpen += HandleDAInterstitialAdDidOpen;
		AdPopcornDAPluginIOS.daInterstitialAdWillClose += HandleDAInterstitialAdWillClose;
		AdPopcornDAPluginIOS.daInterstitialAdDidClose += HandleDAInterstitialAdDidClose;
	}

        // Materialize delegate
	public void HandleDAInterstitialAdDidLoad()
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdDidLoad");
	}
	public void HandleDAInterstitialAdDidFailToReceiveAdWithError(string error)
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdDidFailToReceiveAdWithError : " + error);
	}
	public void HandleDAInterstitialAdWillLeaveApplication()
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdWillLeaveApplication");
	}
	public void HandleDAInterstitialAdWillOpen()
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdWillOpen");
	}
	public void HandleDAInterstitialAdDidOpen()
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdDidOpen");
	}
	public void HandleDAInterstitialAdWillClose()
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdWillClose");
	}
	public void HandleDAInterstitialAdDidClose()
	{
		Debug.Log ("IgaworksADSample HandleDAInterstitialAdDidClose");
	}
}

+ Pop-up ad spotkey: Spotkey created at an adPOPcorn DA management page.


Ad Exposure

Call DAPopupAdPresentFromViewController API to expose the Pop-up ad.

AdPopcornDAPluginIOS.DAPopupAdPresentFromViewController();


Pop-up Window Size

adPOPcorn DA Pop-up Ad currently supports iPhone, iPod Touch sizes.

  • Portrait : 240*360 (w*h)
  • Landscape : 320*213 (w*h)


Delegate

Creates delegate for the occurring event from pop-up ad. These are the examples.

  • daPopupAdDidLoad : Pop-up Ad Load Succeed.
  • daPopupAdDidFailToReceiveAdWithError : Pop-up Ad Load Failed(Check the table below for error code).
  • daPopupAdWillLeaveApplication : Pop-up Ad Click.
  • daPopupAdWillOpen : Call Before Pop-up Ad Opens.
  • daPopupAdDidOpen : Call After Pop-up Ad Opens.
  • daPopupAdWillClose : Call Before Pop-up Ad Closes.
  • daPopupAdDidClose : Call After Pop-up Ad Closes.
public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		AdPopcornDAPluginIOS.AdPopcornDASetCallbackHandler("MySampleScene");

		// Add delegate handler
		AdPopcornDAPluginIOS.DAPopupAdSetDelegate();

		// Add delegate
		AdPopcornDAPluginIOS.daPopupAdDidLoad += HandleDAPopupAdDidLoad;
		AdPopcornDAPluginIOS.daPopupAdDidFailToReceiveAdWithError += HandleDAPopupAdDidFailToReceiveAdWithError;
		AdPopcornDAPluginIOS.daPopupAdWillLeaveApplication += HandleDAPopupAdWillLeaveApplication;
		AdPopcornDAPluginIOS.daPopupAdWillOpen += HandleDAPopupAdWillOpen;
		AdPopcornDAPluginIOS.daPopupAdDidOpen += HandleDAPopupAdDidOpen;
		AdPopcornDAPluginIOS.daPopupAdWillClose += HandleDAPopupAdWillClose;
		AdPopcornDAPluginIOS.daPopupAdDidClose += HandleDAPopupAdDidClose;
	}

        // Materialize delegate
	public void HandleDAPopupAdDidLoad()
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdDidLoad");
	}
	public void HandleDAPopupAdDidFailToReceiveAdWithError(string error)
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdDidFailToReceiveAdWithError : " + error);
	}
	public void HandleDAPopupAdWillLeaveApplication()
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdWillLeaveApplication");
	}

	public void HandleDAPopupAdWillOpen()
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdWillOpen");
	}

	public void HandleDAPopupAdDidOpen()
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdDidOpen");
	}

	public void HandleDAPopupAdWillClose()
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdWillClose");
	}

	public void HandleDAPopupAdDidClose()
	{
		Debug.Log ("IgaworksADSample HandleDAPopupAdDidClose");
	}
}


Native Ad

Native Ad uses Jason type ad information from adPOPcorn DA server to expose the ad in any type you want.


Create Instance

Create instance to expose the native ad.

public class IgawDASampleScene : MonoBehaviour{

	private string NATIVE_SPOTKEY = "nativespotkey";

	void Start(){   
		AdPopcornDAPluginIOS.DANativeAdInitWithKey("Issued appkey", "NATIVE_SPOTKEY");
	}
}

+ Native ad spotkey: Spotkey created at an AdPOPcorn DA management page.


Ad Load

Call DANativeAdLoadAd API to load the native ad information. The loaded information will be transferred to DANativeAdDelegate.

AdPopcornDAPluginIOS.DANativeAdLoadAd ();


Delegate(Verify Ad Information)

Offers delegate for calling DANativeAdLoadAd API. Add DANativeAdDelegate to use delegate.

Offers delete for ad information and its failure event.

  • daNativeAdDidFinishLoading : Native ad load succeed. Returns the native ad information.
  • daNativeAdDidFailWithError : Native ad load failed(Check the table below for error code).
public class MySampleScene : MonoBehaviour {

	// Use this for initialization
	void Start () {
		AdPopcornDAPluginIOS.AdPopcornDASetCallbackHandler("MySampleScene");

		// Add delegate handler
		AdPopcornDAPluginIOS.DANativeAdSetDelegate();


		// Add delegate 
		AdPopcornDAPluginIOS.daNativeAdDidFailWithError += HandleDANativeAdDidFailWithError;
		AdPopcornDAPluginIOS.daNativeAdDidFinishLoading += HandleDANativeAdDidFinishLoading;
	}

        // Materialize delegate
	public void HandleDANativeAdDidFailWithError(string error)
	{
		Debug.Log ("IgaworksADSample HandleDANativeAdDidFailWithError : " + error);
	}

	public void HandleDANativeAdDidFinishLoading(string nativeAdvertisingResultJson)
	{
		Debug.Log ("IgaworksADSample HandleDANativeAdDidFinishLoading : " + nativeAdvertisingResultJson);
	}
}


Ad impression Tracking

Use DANativeAdCallImpression API to track native ad impression. Must send impressionURL with API to parameter.

// private string IMPRESSION_URL = “impressionurl”;
AdPopcornDAPluginIOS.DANativeAdCallImpression(IMPRESSION_URL);

IMPRESSION_URL : Campaign impression tracking URL included in native ad information.


Ad Click Tracking

Call DANativeAdClick API to track native ad click and gather information about users.Must send redirectURL with API to parameter.

// private string REDIRECT_URL = "redirecturl”;
AdPopcornDAPluginIOS.DANativeAdClick(REDIRECT_URL);

+ REDIRECT_URL : Campaign User Landing URL included in native ad information.



DA Response Error Code Definition

This list shows the definition of each error code coming to each type of ad event listener.

CodeMessageDescription
200ExceptionGeneral error
1000Invalid ParameterWrong parameter
9999Unknown Server ErrorUnknown server error
2000Invalid Media KeyWrong app key
2030Invalid Spot KeyWrong spot key
2100Empty CampaignNo ad campaign
2200Invalid Third Party NameFailed to load third party network information
3200Native Spot Does Not InitializedNative setting reset error
5000Server TimeoutServer time out
5001Load Ad FailedFailed to load specific network's ad
5002No AdFailed to load every network ad