Follow

Appbuilder Plugin: Getting Started v1.2

1. The AerServ Platform

Download Here

Overview:

Aerserv is a free mobile SSP and monetization platform that empowers mobile publishers with a superior technology platform, supercharges their ad revenue through mobile video, and supports them with unrivaled customer service for a triple-win.

Ad Types:

aerBanner (banner ad):

The traditional banner is the most widely used ad format on mobile devices. With multiple banner ad sizes, AerServ makes it easy to monetize your mobile app with banners.

aerWall (interstitial ad):

Our most popular and powerful ad unit. The aerWall interstitial combines multiple ad units into one to pack a powerful punch. Our Smart Optimizer system with optimize between static interstitials, rich media interstitials, video interstitials and more rolled up in one. Don't waste your time trafficking - let aerWall do the hard work and bring you industry leading CPMs!

2. Add AerServ Component 

2.1 Appbuilder CLI 

  • Add AerServ Plugin to your  Appbuilder project by executing the following in terminal:
  • $ Appbuilder Plugin add Aerserv
  or
  • $ Appbuilder Plugin fetch https://github.com/Aerserv-Github/phonegap
 
2.2 Appbuilder IDE
 
  • Go to AppBuilder in-browser client
  • Go to Project Navigator Properties  Plugins   Aerserv
  • Go to your JavaScript file where you want to load AerServ files, and invoke the function calls based on AerServ API documentation, e.g.:
or
  • Go to AppBuilder in-browser client
  • Go to Project Navigator Properties Custom Plugins Import
  • Navigate to above ZIP file and click Upload
  • Go to Project Navigator Plugins  , and remove __MACOSX and .DS_Store files if you find any.
  • Go to your JavaScript file where you want to load AerServ files, and invoke the function calls based on AerServ API documentation, e.g.:

2.3 Add Cordova CLI

  • cordova plugin add https://github.com/Aerserv-Github/phonegap

3. SDK Overview

new AerServSDK()
The AerServSDK class is how you statically interact with the AerServSDK

Banner Ad Position
(static) BANNER_BOTTOM - align banner to the bottom of the screen
(static) BANNER_TOP    - align banner to the top of the screen

Banner Ad Method 
(static) loadBanner(plc, width, height, position, onAdLoadedCallback, onAdFailedCallback,onAdShownCallback,onAdClickedCallback,onAdDismissedCallback,onVcReadyCallback,onVcRewardedCallback,keywords) - will load a banner that you can align to the top or bottom of the screen
(static) killBanner() - removes the banner from the view
Name Type Description
plc string the placement
width int the width of the placement
height int the height of the placement
position int the position of the placement. Either AerServSDK.BANNER_TOP or AerServSDK.BANNER_BOTTOM
onAdLoadedCallback function the callback function for when the ad is loaded
onAdFailedCallback function the callback function for when the ad has failed to load
onAdShownCallback function the callback function for when the ad has finished
onAdClickedCallback function the callback function for when the ad has been touched
onAdDismissedCallback function the callback function for when the ad has been dismissed
onVcReadyCallback function the callback function for when virtual currency is ready
onVcRewardedCallback function the callback function for when virtual currency is rewarded
keyWords string comma seperated string of keywords to filter ads with
(static) loadInterstitial(plc, onAdLoadedCallback, onAdFailedCallback, onAdShownCallback, onAdClickedCallback, onAdDismissedCallback, onPreloadReadyCallback, onVcReadyCallback, onVcRewardedCallback, keyWords, preload) - loads a full screen ad
Name Type Description
plc string the placement
onAdLoadedCallback function the callback function for when the ad is loaded
onAdFailedCallback function the callback function for when the ad has failed to load
onAdShownCallback function the callback function for when the ad has finished
onAdClickedCallback function the callback function for when the ad has been touched
onAdDismissedCallback function the callback function for when the ad has been dismissed
onPreloadReadyCallback function the callback function for when ad has been preloaded
onVcReadyCallback function the callback function for when virtual currency is ready
onVcRewardedCallback function the callback function for when virtual currency is rewarded
keyWords string comma seperated string of keywords to filter ads with
preload bool boolean to enable preloading functionality

4. Using AerServ Component 


//Load Interstitial Ad Method function loadInterstitial() { var plc = document.getElementById('plc').value; clearStatus(); updateStatus("Loading PLC: " + plc); window.AerServSDK.loadInterstitial(plc, function(){ updateStatus("Ad loaded"); }, function(message){ updateStatus("Ad failed: " + message); }, function(){ updateStatus("Ad shown"); }, function(){ updateStatus("Ad clicked"); }, function(){ updateStatus("Ad dismissed"); }, function() { updateStatus("Preload ready"); }, function(name, amount) { updateStatus("VC ready, name=" + name + ", amount=" + amount); }, function(name, amount) { updateStatus("VC rewarded, name=" + name + ", amount=" + amount); }, "foo1,foo2", false); } //Using Preload Event callback to preload interstitial ad to show on a later time function preloadInterstitial() { var plc = document.getElementById('plc').value; clearStatus(); updateStatus("Loading PLC: " + plc); window.AerServSDK.loadInterstitial(plc, function(){ updateStatus("Ad loaded"); }, function(message){ updateStatus("Ad failed: " + message); }, function(){ updateStatus("Ad shown"); }, function(){ updateStatus("Ad clicked"); }, function(){ updateStatus("Ad dismissed"); }, function() { updateStatus("Preload ready"); }, function(name, amount) { updateStatus("VC ready, name=" + name + ", amount=" + amount); }, function(name, amount) { updateStatus("VC rewarded, name=" + name + ", amount=" + amount); }, "foo1,foo2", true); } //Show Interstitial Method when using Preload Event callbacks function showInterstitial() { window.AerServSDK.showInterstitial(); } //Load Banner Ad Method function loadBanner() { var plc = document.getElementById('plc').value; clearStatus(); updateStatus("Loading PLC: " + plc); window.AerServSDK.loadBanner(plc, 325, 50, AerServSDK.BANNER_BOTTOM, function(){ updateStatus("Ad loaded"); }, function(message){ updateStatus("Ad failed: " + message); }, function(){ updateStatus("Ad shown"); }, function(){ updateStatus("Ad clicked"); }, function(){ updateStatus("Ad dismissed"); }, function(name, amount){ updateStatus("VC ready, name=" + name + ", amount=" + amount); }, function(name, amount){ updateStatus("VC rewarded, name=" + name + ", amount=" + amount); }, "foo1,foo2"); } //Kill Banner Ad method function killBanner() { window.AerServSDK.killBanner();

5. Build the Sample App

Download Appbuilder Sample App

  1. Click Create project.
  2. Select AppBuilder Hybrid project.
  3. Select Choose Blank project template and select a template from the list.

  4. Next, clean up your project from the sample files. In the Project Navigator, select all files and folders except cordova.js, Plugins, Properties and App_Resources, right-click, select Delete and confirm.

  5. AppBuilder in-browser client: Drag and drop the ZIP archive " AerServ Sample Project.zip to import to the drop files here to upload text box. Click Upload.

  6. AerServ Appbuilder Sample Project will only display ad in device mode.   

 

Download Cordova Sample App
Execute the following in the sample-app directory
$ unzip sample-app.zip
$ cd sample-app
$ cordova platform add android
$ cordova platform add ios
$ cordova plugin add https://github.com/Aerserv-Github/phonegap  
$ cordova build android
$ cordova run android 
$ cordova run android --device
$ cordova build ios
$ cordova run ios
$ cordova run ios --device

Test PLC
aerWall - PLC #1000741
aerBanner (300x250) - PLC #1001286
aerBanner (320x50) - PLC #1024876

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk