GithubHelp home page GithubHelp logo

dohoang1102 / admanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dev2dev/admanager

0.0 1.0 0.0 66 KB

iPhone - allows developers to easily target pre-iOS4 and iOS4 devices with Admob ads and iAds

Home Page: http://www.danielbyon.com/dbadmanager

admanager's Introduction

DBAdManager
Created By: Daniel Byon
http://www.danielbyon.com


This is a simple class that allows for supporting banner advertisements from Admob and iAd on iOS 4 and legacy iOS version devices. Currently, it only supports Admob ad sizes 320x48 and iAd ad sizes 320x50, so it is mostly meant for UITableViews and placement at the bottom of a static page.


You can use the class in this way:

// Within a view controller class, placing the ad in a UITableView
// This code assumes there is a "DBManager *manager" instance variable
- (void)viewDidLoad {
	manager = [[DBAdManager alloc] initWithController:self adMobPublisherID:@"your publisher id"];
	[super viewDidLoad];
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
	return [manager heightOfAd];
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
	return [manager adForDisplay];
}


This can also be used to connect to a UIView IBOutlet, just use the [UIView addSubview:] method
- (void)viewDidLoad {
	manager = [[DBAdManager alloc] initWithController:self adMobPublisherID:@"your publisher id"];
	[adView addSubview:[manager adForDisplay]]; // "adView" is a UIView IBOutlet
	[super viewDidLoad];
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.