|
Embedding Ads in LiveCode
This lesson describes how to set up in-app advertising in LiveCode applications. The advertising content is provided by Inneractive. Screen captures and sample code are provided. IntroductionMany applications use advertising as a means to increase the revenue stream. LiveCode provides the functionality for easy integration of advertising content in a LiveCode application. The following steps outline the process of adding advertising content to a LiveCode application. Registering with the Advertising Content Provider (LiveCode Login)The advertising content provided to the application is supplied by our ad partner Inneractive. In order to receive the advertising content, you have to first register with Inneractive. The following link: http://runrev.com/store/account/inneractive/ takes you to LiveCode login page where you log in with your LiveCode login information. Registering with the Advertising Content Provider (Inneractive Login)Once you have logged into the LiveCode account you are taken to the login screen for Inneractive. If you already have an account with Inneractive, use your login information here to proceed. If you do not have login information, then register with Inneractive by selecting the "Join Us" link at the top right hand corner of the login dialog. This opens a new dialog window in which you provide your "Name" and "e-mail address". This sets up the account with Inneractive for you. You are then sent a confirmation e-mail and a subsequent e-mail with the relevant registration information, including a password. Generating an Advertising KeyOnce you have an account with Inneractive, you need to create a key for the application that is to display advertising content. Writing the LiveCode ApplicationThe next sections of this lesson describe how to set up the application for advertising content. Registering the LiveCode ApplicationThe LiveCode application has to be registered with Inneractive, using the advertising key that Inneractive provided you with. This key is registered with your LiveCode application using the following syntax: mobileAdRegister "YOUR-AD-KEY" Creating an AdvertOnce your ad key has been registered, it is possible to create a region in your application that can be used to display adverts. The command mobileAdCreate allows you to specify the name of the advert that is retained throughout the lifetime of the advert, the size of the advert to display, the placement of the advert on your application screen and metadata that is used to control how often the add is to appear and what kind of ad is to be displayed: local tDetails Deleting an AdvertAds can be deleted at any time using to command mobileAdDelete. This command takes the name of the advert as a parameter. mobileAdDelete "myAd1" Ad VisibilityThe visibility of ads can be controlled by setting a boolean switch: mobileAdGetTopVisible ("myAd1") // Returns a boolean, indicating if the ad is visible or not Returning a list of Active AdsA list of all the currently active ads can be acquired by using the function: mobileAds() This returns a return-delimited list of the ad names. Building a Test ApplicationIt is easy to build a test application with advertising content. You can build a stack that displays adverts by copying and pasting code from this lesson:
You are done. We cannot guarantee that you will get cool adverts like the one displayed in the image of this section, but you should now be able to display advert content on your device. Further ReadingTo understand the complete feature set and functionality that is available, refer to the LiveCode dictionary. This covers ad specific messages and further ad placement information that is not discussed in this lesson.
|
|