iOS Tutorials: Displaying banner ads & interstitial ads on your app

OVERVIEW

One of the most popular platform for in-app advertisement is undoubtedly Google Admob. There are several way to earn money from your app, one of them is give a small portion of space on your app to Google to display their advertisement tracking the clicks and help generate some income for you. There are many different ways you could showcase the advertisements on the apps. Some of the most common ones are through banners on many different sizes, interstitial or  rewarded video. We will be covering only banner and interstitial at this point.

HOW MUCH WILL I EARN?

Google Admob implements cost per click (CPC). You need clicks on the ads to be able to earn money. You don’t earn money from impression meaning people viewing the ads will not earn you any money unless the click it.

Now that will lead us to the though of, why should I then implement advertisement in the apps. I copied some of the case studies from Google AdMob to give you a rough idea of how much you will earn and how much work you have to put in. For more case studies, you could check it out here

App creator Szymon Kimaszewski’s first app, Blood Pressure, has over 26,000 reviews and over 1 million installs. As of 2013, he was earning $700 to $850 USD per month through this app and AdMob. He now has six apps on the Google Play store. All are available for free, some monetized with AdMob ads and with in-app purchases.

App creator Rich Woods thought it would be fun to create a simple, free slot machine game app in his spare time. With no upfront investment, only 300,000 downloads, and AdMob, he was earning $100 a day, one month after launching it. He now has several slot machine apps in the app store.

Or the most common practice is to implement an in app purchase requiring the user to pay a certain amount of money to remove the ads. Depending on how much you set the price, Apple usually takes a 30% cut of that. For example, if it cost $0.99 to remove the ads, you will be earning roughy about $0.70. While $1.99 will earn you $1.40 and the higher the price is, the higher you will earn. Of course you don’t want it to be too expensive.

BUILD IT

Create your project and give an appropriate name

Import Software Development Kit (SDK) using Cocoapods. If you have not done Cocoapods before, you could check out my tutorial here on how to set it up for the first time and use it. Also, you will have to set up your own account at Google AdMob. Once you are done, add an app or click on this link. Your screen should look like below:

Click Create Ad Unit > Create Banner and you’ll see App ID and Ad Unit ID.

Drag View from the Object Library and name it’s class to GADBannerView and create an outlet out of it.

By implementing the code above, this is how it looks like:

 

To implement interstitial, you will only have to add few more codes. We will definitely have to implement the protocol

Then we are going to create a variable

Next, we are going to create a method that contains all the information about the interstitial

Here, I implement a button in which clicked upon will trigger the interstitial ads.

For everything to work perfectly well, we will have to let the code runs in viewDiDLoad:

The result will be like the following:

The code is uploaded on GitHub

  • Article By :
    Founder of DaddyCoding. Studied Computer Science, Information System and Information Technology at BYU-Hawaii. Currently spending most of my time researching and learning on helping to expose making iOS apps.

Random Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*