Supported platforms:

  • Android
  • iOS

The plugin features include:

  • Support for Banner Ads
  • Support for Interstitial Ads
  • Banner positions (top/bottom)
  • Banner ad events listeners
  • A sample project to demonstrate plugin integration

And the requirements are:

  • Cordova CLI
  • Zone id (click here to create one).
  • To deploy on Android:
  • To deploy on iOS:
    • Deployment target of iOS 6.0 or higher
    • Xcode 5.1 or higher

Quick Demo

# install cordova CLI
[sudo] npm install cordova -g
 
# install a small utility to run the Demo for you
[sudo] npm install plugin-verify -g
 
# run adcash demo
plugin-verify cordova-plugin-adcash

Integration

Note: cordova-plugin-adcash is available both in PlugReg.com and npmjs.com plugin registries.

  • To use it with Cordova CLI add:
     cordova plugin add cordova-plugin-adcash
     

    And configure to have the following:

    	# create a demo project
        cordova create test1 com.example.test1 Test1
        cd test1
        cordova platform add android
        cordova platform add ios
    
        # now add the plugin
        cordova plugin add cordova-plugin-adcash
    
        # now remove the default www content, copy the demo html file to www
        rm -r www;
        cp pluginscordova-plugin-adcashtest www;
    
    	# now build and run the demo in your device or emulator
        cordova prepare; 
        cordova run android; 
        cordova run ios;
        # or import into Xcode  Android Studio
     

  • For PhoneGap Build just configure the config.xml:

        <gap:plugin name="cordova-plugin-adcash" source="npm"/>
        

Ads

You can show Ads very easily following the specific steps.

Banner

To show a Banner Ad:

    // This will display smart banner at the bottom with the default options: 
    var AdcashSDK = cordova.plugins.AdcashSDK;
    AdcashSDK.createBanner({zoneId: 'ADD_YOUR_BANNER_ZONE_ID_HERE', 
                            position: AdcashSDK.AD_POSITION.BOTTOM, 
                            autoShow: true});

Interstitial

To show an Interstitial Ad:

    var AdcashSDK = cordova.plugins.AdcashSDK;
 
    // Prepare and load Ad resource in background, e.g. at begining of game level:
    AdcashSDK.prepareInterstitial({zoneId:'ADD_YOUR_INTERSTITIAL_ZONE_ID_HERE',
                                   autoShow:true} );
     
    // Alternatively, you can prepare the interstitial and show it manually later: 
    AdcashSDK.prepareInterstitial({zoneId:'ADD_YOUR_INTERSTITIAL_ZONE_ID_HERE',
                                   autoShow:false},
                                   function() {
                                        // Succeeded, we can now show the interstitial 
                                        AdcashSDK.showInterstitial();
                                    },
                                    function(error){
                                        // Failed to prepare interstitial 
                                    }

Conversion Tracking

If you are an advertiser, you might want to send us some information when your app has been opened so that we can track a successful conversion. Keep in mind that only the first time the app is opened is considered a successful conversion.

You can do this by calling reportAppOpen function:


...
onDeviceReady: function() {
	var AdcashSDK = cordova.plugins.AdcashSDK;
	AdcashSDK.reportAppOpen();
}

Javascript API Overview

// Those assist the use of a banner:
createBanner(zoneIdoptions, success, fail);
loadBanner(success, fail)
removeBanner(success, fail);
showBanner(success, fail);
hideBanner(success, fail);
    
// Those assist the use of an interstitial:
prepareInterstitial(zoneIdoptions, success, fail);
showInterstitial(success, fail);
    
// Those set the default value for other methods:
setOptions(options, success, fail);
conversion tracking
reportAppOpen(success, fail)

Use setOptions to set values for the following variables:

Variable Type Description
adSize enum Size of the banner (SEE: AdcashSDK.AD_SIZE for possible values)
position enum Position of the banner (SEE: AdcashSDK.AD_POSITION for possible values)
autoShow boolean Indicating whether the banner/interstitial should be shown automatically when loaded
zoneId string Use in options ONLY when passed to createBanner or prepareInterstitial, otherwise it will be ignored

Note: Take a look at AdcashSDK.js for full API usage.

Support

If you need any support or assistance you can contact us by sending email to mobile@adcash.com.