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.
NOTE
- IGAW Integration must be set before integration AdPOPcorn add-on. [IGAW General Integration: iOS]
- AdPopcornDA.framework file must to included in a Xcode project for AdPOPcorn integration. [Install SDK: iOS]
Banner Ad
Banner is very general type of DA ad that shows up on either top or bottom.
View Setting
Add the view to expose banner ad. Follow the below example to add at the ViewController you want to expose the ad.
Create DABannerView Instance
Edit ViewController.m to import DABannerView.h, DAAdSize.h and create DABannerView instance.
#import <AdPopcornDA/DABannerView.h>
#import <AdPopcornDA/DAAdSize.h>
@interface DABannerViewController () <DABannerViewDelegate>
{
DABannerView *_bannerView;
}
@end
Materialize DABannerView instance you created.
Call initWithBAnnerViewSize: origin: appKey: spotKey: viewController: API to create instance and add it to ViewController. Here are the descriptions for each parameter.
- size : Size of banner view, Use it with DAAdSize.h as reference.
- origin : Position of banner view, input using CGPoint type.
- appKey : Issued IGAWorks appKey.
- spotKey : Banner spotKey.
- viewController : ViewController that will expose banner ad.
@implementation DABannerViewController
- (void)viewDidLoad {
[super viewDidLoad];
_bannerView = [[DABannerView alloc] initWithBannerViewSize:DABannerViewSize320x50 origin:CGPointMake(0.0f, self.view.frame.size.height - [DAAdSize adSize:DABannerViewSize320x50].height) appKey:@"발급받은앱키" spotKey:@"배너스팟키" viewController:self];
[self.view addSubview:_bannerView];
}
Banner Size
AdPopcorn DA banner currently only offers iPhone and iPod Touch size(W:320, H:50), and use DABannerViewSize320x50 inside of DABannerView.h.
Mediation Refreshing Period
Use adRefreshRate 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.
//adRefreshRate = (NSInteger)seconds
_bannerView.adRefreshRate = 35;
Delegate
Creates delegate for the occurring event from banner ad. To use delegate, you need to add DABannerViewDelegate.
Set delegate at _bannerView instance.
- DABannerViewDidLoadAd : Banner Ad Load Succeed.
- DABannerView: didFailToReceiveAdWithError : Banner Ad Load Failed(Check the table below for error code).
- DABannerViewWillLeaveApplication : Banner Ad Click
#import "DABannerViewController.h"
@interface DABannerViewController () <DABannerViewDelegate>
@end
@implementation DABannerViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Set banner delegate
_bannerView.delegate = self;
}
// Meterailize banner delegate
- (void)DABannerViewDidLoadAd:(DABannerView *)bannerView
{
NSLog(@"BannerAd Loading Success");
}
- (void)DABannerView:(DABannerView *)bannerView didFailToReceiveAdWithError:(DAError *)error
{
NSLog(@"BannerAd Laoding Failed, ErrorCode : %@", error);
}
- (void)DABannerViewWillLeaveApplication:(DABannerView *)bannerView
{
NSLog(@"BannerAd Clicked");
}
@end
+ _bannerView: DABannerView instance created at ViewController.h and .m.
Interstitial Ad
Full-side ad covers the entire screen for ad. Check the following example for integration.
Create Instance
Import DAInterstitialAd.h at ViewController.m you want to expose the add and set instance value.
#import <AdPopcornDA/DAInterstitialAd.h>
@interface DAInterstitialADViewController () <DAInterstitialAdDelegate>
{
DAInterstitialAd *_interstitialAd;
}
@end
Edit ViewController.m to make the instance operational.
@implementation DAInterstitialADViewController
- (void)viewDidLoad {
[super viewDidLoad];
_interstitialAd = [[DAInterstitialAd alloc] initWithKey:@"Issued App Key" spotKey:@"Interstitial ad Spot key" viewController:self];
}
+ Issued app key: the app key issued as you register the app at IGAWorks.
+ Interstitial ad spotkey: Spotkey created at an AdPOPcorn DA management page.
Ad Exposure
Call presentFromViewController API to expose the interstitial ad.
[_interstitialAd presentFromViewController:self];
+ _interstitialAd : DAInterstitialAd instance created at ViewController.h and .m file.
Delegate
Creates delegate for the occurring event from interstitial ad. To use delegate, you need to add DAInterstitialAdViewDelegate.
Set delegate at _daInterstitialAd instance delegate and make it operational.
- DAInterstitialAdDidLoad : Interstitial Ad Load Succeed.
- DAInterstitialAd: didFailToReceiveAdWithError : Interstitial Ad Load Failed(Check the table below for error code).
- DAInterstitialAdWillLeaveApplication : Interstitial Ad Click.
#import "DAInterstitialADViewController.h"
@interface DAInterstitialADViewController() <DAInterstitialAdViewDelegate>
@end
@implementation DAInterstitialADViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Set interstitial delegate
_daInterstitialAd.delegate = self;
}
//Materialize interstitial delegate
-(void)DAInterstitialAdDidLoad:(DAInterstitialAd *)interstitialAd
{
NSLog(@"InterstitialAd Loading Success");
}
-(void)DAInterstitialAd:(DAInterstitialAd *)interstitialAd didFailToReceiveAdWithError:(DAError *)error
{
NSLog(@"InterstitialAd Laoding Failed, ErrorCode : %@", error);
}
-(void)DAInterstitialAdWillLeaveApplication:(DAInterstitialAd *)interstitialAd
{
NSLog(@"InterstitialAd Clicked");
}
@end
+ _daInterstitialAd: DAInterstitialAd instance created at ViewController.h and .m.
Pop-up Ad
Pop-up ad is the format using partial screen with visible background.
Create Instance
Import DAPopupAd.h at ViewController.m you want to expose the add and set instance value.
#import <AdPopcornDA/DAPopupAd.h>
@interface DAPopupAdViewController() <DAPopupAdDelegate>
{
DAPopupAd * _daPopupAd;
}
@end
Edit ViewController.m to make the instance operational.
@implementation DAPopupAdViewController
- (void)viewDidLoad {
[super viewDidLoad];
_daPopupAd = [[DAPopupAd alloc]initWithKey:@"Issued app key" spotKey:@"Pop-up ad spotkey"];
}
+ Issued app key: the app key issued as you register the app at IGAWorks.
+ Pop-up ad spotkey: Spotkey created at an AdPOPcorn DA management page.
Ad Exposure
Call presentFromViewController API to expose the Pop-up ad.
[_daPopupAd presentFromViewController:self];
+ _daPopupAd : DAPopupAd instance created at ViewController.h and .m.
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 interstitial ad. To use delegate, you need to add DAPopupAdDelegate.
Set delegate at _daPopupAd instance and make it operational.
- DAPopupAdDidLoad : Pop-up Ad Load Succeed.
- DAPopupAd: didFailToReceiveAdWithError : Pop-up Ad Load Failed(Check the table below for error code).
- DAPopupAdWillLeaveApplication : Pop-up Ad Click.
- willOpenDAPopupAd : Call Before Pop-up Ad Opens.
- didOpenDAPopupAd : Call After Pop-up Ad Opens.
- willCloseDAPopupAd : Call Before Pop-up Ad Closes.
- didCloseDAPopupAd : Call After Pop-up Ad Closes.
#import "DAPopupAdViewController.h"
@interface DAPopupAdViewController() <DAPopupAdDelegate>
@end
@implementation DAPopupAdViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Set popup delegate
_daPopupAd.delegate = self;
}
//Materialize popup delegate
-(void)DAPopupAdDidLoad:(DAPopupAd *)popupAd
{
NSLog(@"PopupAd Loading Success");
}
-(void)DAPopupAd:(DAPopupAd *)popupAd didFailToReceiveAdWithError:(DAError *)error
{
NSLog(@"PopupAd Laoding Failed, ErrorCode : %@", error);
}
-(void)DAPopupAdWillLeaveApplication:(DAPopupAd *)popupAd
{
NSLog(@"PopupAd Loading Success");
}
- (void)willOpenDAPopupAd
{
NSLog(@"- (void)willOpenDAPopupAd");
}
- (void)didOpenDAPopupAd
{
NSLog(@"- (void)didOpenDAPopupAd");
}
- (void)willCloseDAPopupAd
{
NSLog(@"- (void)willCloseDAPopupAd");
}
- (void)didCloseDAPopupAd
{
NSLog(@"- (void)didCloseDAPopupAd");
}
@end
+ _daPopupAd : DAPopupAd instance created at ViewVontroller.h and .m.
Native Ad
Native Ad uses Jason type ad information from AdPOPcorn DA server to expose the ad in any type you want.
Create Instance
Import DANativeAd.h at ViewController.m you want to expose the add and set instance value.
#import <AdPopcornDA/DANativeAd.h>
@interface DANativeAdViewController() <DANativeAdDelegate>
{
DANativeAd * _daNativeAd;
}
@end
Edit ViewController.m to make the instance operational.
@implementation DANativeAdViewController
- (void)viewDidLoad {
[super viewDidLoad];
_daNativeAd = [[DANativeAd alloc]initWithKey:@"Issued app key" spotKey:@"Native ad spotkey"];
}
+ Issued app key: the app key issued as you register the app at IGAWorks.
+ Native ad spotkey: Spotkey created at an AdPOPcorn DA management page.
Ad Load
Call loadAd API to load the native ad information. It transfers to DANativeAdDelegate.
[_daNativeAd loadAd];
+ _daNativeAd : DANativeAd instance created at ViewController.h and .m.
Delegate(Verify Ad Information)
Offers delegate for calling loadAd. Add DANativeAdDelegate to use delegate.
Offers delete for ad information and its failure event.
- DANativeAdDidFinishLoading : Native ad load succeed. Returns the native ad information.
- DANativeAd: didFailWithError : Native ad load failed(Check the table below for error code).
#import "DANativeAdViewController.h"
@interface DANativeAdViewController() <DANativeAdDelegate>
@end
@implementation DANativeAdViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Set native ad delegate
_daNativeAd.delegate = self;
}
//Meterialize native ad delegate
-(void)DANativeAdDidFinishLoading:(DANativeAd *)nativeAd
{
//nativeAd : Native ad Json text string array
//ex) nativeAd.nativeAdvertisingResult.campaignListArray
}
-(void)DANativeAd:(DANativeAd *)nativeAd didFailWithError:(DAError *)error
{
NSLog(@"NativeAd Laoding Failed, ErrorCode : %@", error);
}
@end
+ _daNativeAd : DANativeAd instance created at ViewController.h and .m.
Ad Exposure Tracking
Use callImpression API to track native ad exposure. Must send impressionURL with API to parameter.
[_daNativeAd callImpressionURL:campaign.impressionURL];
+ _daNativeAd: DANativeAd instance created at ViewController.h and .m.
+ campaign.impressionURL : Campaign impression tracking URL included in native ad information.
Ad Click Tracking
Call click API to track native ad click and gather information about users.Must send redirectURL with API to parameter.
[_daNativeAd click:campaign.redirectURL];
+ _daNativeAd: DANativeAd instance created at ViewController.h and .m.
+ campaign.redirectURL : 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.
Code | Message | Description |
200 | Exception | General error |
1000 | Invalid Parameter | Wrong parameter |
9999 | Unknown Server Error | Unknown server error |
2000 | Invalid Media Key | Wrong app key |
2030 | Invalid Spot Key | Wrong spot key |
2100 | Empty Campaign | No ad campaign |
2200 | Invalid Third Party Name | Failed to load third party network information |
3200 | Native Spot Does Not Initialized | Native setting reset error |
5000 | Server Timeout | Server time out |
5001 | Load Ad Failed | Failed to load specific network's ad |
5002 | No Ad | Failed to load every network ad |
DA Mediation
To use mediation feature, read the following article to proceed.