Time for action – Adding iAds

One of the low hanging fruit for generating revenue from your application is introducing an advertising model to your existing game. You can easily display an ad in the main menu or in the loading screen of your application and not adversely impact the user experience of your customers, yet generate a reasonable amount of revenue.

As Unity itself doesn't provide functionality for adding iAds to an application, we will illustrate how to acquire this functionality using the Prime31 plugin. While it is certainly possible to also implement custom plugins, this is outside the scope of the book. More importantly, it is a better use of our time to build the application:

  1. Visit the website http://www.prime31.com and download the iAds plugin:
    Time for action – Adding iAds

    While the plugin itself isn't free, you should make more than the cost of the plugin in ads to justify its purchase.

  2. Import the purchased unitypackage by importing a custom package through the Assets | Import Package | Custom Package menu command:
    Time for action – Adding iAds
  3. Select the unitypackage on your machine so that Unity can begin importing its assets:
    Time for action – Adding iAds
  4. Unity will now begin importing the plugin and display a dialog confirming that you wish to import all of the assets from the package into the project:
    Time for action – Adding iAds

    Make sure you have all of the items selected and press the Import button. When the import process is completed you should have two new nodes in the Hierarchy view:

    Time for action – Adding iAds
  5. The iAds system comes with a ready-to-use Prefab for displaying ads, so let's drag that into our scene.
    Time for action – Adding iAds

    Now that this is added, our application is ready to display ads.

  6. Open the application in iTunes Connect and select the Set Up iAd Network:
    Time for action – Adding iAds
  7. Enable the iAd advertising network for your application by selecting the Enable iAds button:
    Time for action – Adding iAds

    Note

    Be sure to set your primary audience appropriately. This will ensure that you are delivering advertisements appropriately for your target audience.

What just happened?

We have just added the iAd network to our application. When running our game, we will now see an iAd advertisement appear in the main scene of our application – purely driven by Apple's demographics and advertising engine. As people interact with the ads in our game you will get a check from Apple.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.172.195