Cordova application add video ads tutorial

The preparation for coding

Before reading this tutorial, please read the getting started with cordova tutorial to learn how to download management library, how to install AD management library

Add advertising related Js code

1.Set the parameters of the various advertising platform
Platform parameters in json format as follow
		"isTesting":true,//Whether the test mode
		"rateModel":1,//Advertising platform collation, 0 means is the priority weights, 
different platform scale display ads, 1 is the priority order, the platform to display ads in sequence
//admob  platform  ,key1 banner ID,key2full  screen id
		{"class":"AmazonAdapter","priority":20,"key1":"xxx"},//amazon platform  ,key1 appkey
//chartboost platform  ,key1 appID,key2 signature
		{"class":"InmobiAdapter","priority":50,"key1":"xxx"},//inmobi platform  ,key1 appid
		{"class":"IadAdapter","priority":50,"key1":"877393773"},//iad platform  ,androidautomatically be ignored
// ince the sale of advertising, cross promotion needs	
		{"class":"BaiduAdapter","priority":50,"key1":"appsid","key2":"appsec"},//baidu platform 
    {"class":"GDTAdapter","priority":50,"key1":"appid","key2":"banner id","param":"full id"},//wide point platform 
    {"class":"AdcolonyAdapter","priority":50,"key1":"appid","key2":"full id","param":"video id"},//adcolony platform 
//mmedia platform  ,key1 banner ID,key2full  screen id
2. initialization Keymob
Initialization Keymob library management is the prerequisite to call other advertising functions, initialization Keymob using json config file as follow
3.Load the video advertising
4.Check whether the video advertising is loaded successfully
    keymob.isVideoReady(function (isReady) {
            if (isReady) {
               alert("Video is load success,you can show it now");
5.Show video advertising
6. Show video advertising
Check whether ad is load successfully is a good practice
   	keymob.isVideoReady(function (isReady) {
            if (isReady) {

Processing for each platform

After add the code, in accordance with the previous tutorial, processing for android and ios

More tutorial of add ad in app   qq group 310513042   home