javascript - how to use Postmedia digital cordova plugin (DFP) -
I want to use DFP (for double click plus) for my Android app, I already have The scripts and markup are below:
& lt; Script type = 'text / javascript' & gt; (Function () {var useSSL = 'https:' == document.location.protocol; var src = (useSSL? 'Https:': 'http:') + '//www.googletagservices.com/tag/js/ Gpt.js'; document.write ('& lt; scr' + 'ipt src = "' + src + '" & gt; & lt; / scr' + 'ipt & gt;');}) (); & Lt; / Script & gt; & Lt; Script type = 'text / javascript' & gt; Googletag.defineSlot ('/ ***** / **** _ APP_1024x66', [1024, 66], 'div-gpt-ad- ******** - 0'). AddService (googletag.pubads) ()); . Googletag.pubads () enableSyncRendering (); . Googletag.pubads () enableSingleRequest (); Googletag.enableServices (); & Lt; / Script & gt; Document body & lt; Div id = 'div-gpt-ad-********** style =' width: 1024px; Height: 66px; '& Gt; & Lt; Script type = 'text / javascript' & gt; Googletag.display ('div-GPT-ad - *********'); & Lt; / Script & gt; & Lt; / Div>) However, this does not appear on mobile (Android Project). This is the reason I would like to use DFP plugin (postmedia), but I do not know how to use it? For example the plugin would not be good enough for example, I already had the code (above) to put in my app, but I want to know how I can integrate that plugin with my code . Note: We have the plugin:
createBannerAd: function (option, success callback, failure callback) {var defaults = {'adUnitId': 1404187116182-0, 'adSize': (250, 150), 'tags': Undefined, 'Network ID': 4271715, 'Background Color': "#fff"}; What if we want a bunch of ads and of course we have a bunch of code generated by Google and FDP? Do we need to create a service? what else? I really appreciate a head of any reaction, I'm using Cordova 2.8.1 / Angie JS
Here's how we use it
var successrerebannerView = function () {//console.log("addBanner Success"); DFPPlugin.requestAd ({'isTesting': wrong}, success, error); }; Var Success = Work () {//console.log("requestAd Success "); }; Var error = function (message) {//console.log("request ad fail "+ message); }; Var option = {'adUnitId': '/ xxx / xxxx', // replace / xxx / xxxx with your adslot 'adSize': 'banner', 'tag': {}, 'background color': '# FFFFFF '}; DFPPlugin.createBannerAd (option, success processBank view, error);
Comments
Post a Comment