Game Development Reference
In-Depth Information
Using advertising
We've just looked at in-app purchases as being one way of generating an income
from your games, but another way is to make use of one of the many advertising
solutions available. Just like those clickable adverts that are a common part of most
websites, we can give over a little part of our game's screen display to adverts that
will then provide another potential income stream.
The following sections explore some of the options available to us.
Implementing iAd support for iOS devices
As you are probably aware, Apple has its own advertising solution purely for iOS,
called iAd . Again this requires use of an Objective-C API, so the Marmalade SDK
provides a C wrapper for it called s3eIOSIAD .
This is a very simple API that allows you to request an advertisement from the iAd
servers. If an advert is available you have control over when to show it, so the advert
only needs to be visible at certain points in your game if you so wish.
Documentation on this API can be found at Marmalade API Reference | S3E API
Documentation | S3E: iOS Only | S3E iOS iAd , and example code exists in the
Marmalade installation directory at examples\s3e\s3eIOSIAd .
Using other advertising solutions
Since iAd can only be used on iOS platforms, we are forced to consider other possible
solutions when targeting other platforms (although most of these other solutions can
still be used on iOS as it happens!).
Marmalade does not provide support for any other advertising systems directly,
but other developers have taken up the challenge here and have made their own
solutions available for use on the Marmalade Code Community pages.
At the time of writing there are a couple of useful projects called s3eAdWhirl and
s3eAdNinja that at least provide support for Android. These solutions are quite
clever in that they actually target multiple sources of mobile advertising in order to
ensure that an advert is shown in your application as often as possible to maximize
your revenue.
The IwGameAds module is another open-source community project that shows how
to integrate with multiple ad services and works across more platforms than you
can shake a very large stick at. The full source code and documentation for it can be
found at the following web address:
http://www.drmop.com/index.php/iwgameads-sdk/
 
Search WWH ::




Custom Search