Wade with admob
jota

Hi Gio,

 

Is it possible to use admob ads, such as interstitials ads or any other kind, with wade on android apps?

 

If so, can you give me some directions, please.

 

Thank you

All 6 Comments
Gio

Hi

 

Yes it's certainly possible, but the way these things work in most cases is not very canvas-friendly. As a general approach you may want to have a page that contains an iframe with your WADE app, and a div that contains your adverts.

 

If you don't like iframes, you can put your WADE app inside a div using wade.setWindowMode('container'). This will stop the app trying to take all the space that's available on the page.

 

You can freely change the css for all WADE canvases and its container div in the style.css file.

jota

Hi,

I managed to do it by inserting a DIV inside the container and its working in web browsers using adsense, something like that:

 

index.html:

<div id="container" style="border:0; width:800px; height:600px;">
    <div id="wade_main_div" width="800" height="600" tabindex="1">
    <div id="adss"> script for ads here </div>
</div>
</div>

style.css:

#adss {
    height: 98px; 
    width:100%;
    position: absolute;
    text-align: center;
    left: 0;
    bottom: 0;
}

Not so sure where and how to use wade.setWindowMode('container') ?

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Ii'm really interested in using AdMob on apps.  You just can't use adsense because it's against  adsense policies to use it on app's (also won't work the ads simply are not shown)

And for that, it seems that you have to use a apache cordova plugin (wich allows access to native device function such as the camera from JavaScript). 

So the big question here is: is it possible to use plugins within wade? and how?

best regards

 

 

Gio

Hi jota

What you did is perfectly fine, but won't the ad cover the game area in that case? It can be alright depending on your situtation, and in fact you can make sure that in the top 98px of your game there is nothing to see.

Alternatively, you can place the div for the ads outside the container, and call wade.setWindowMode('container') from your app's init function. This will stop the container from being resized trying to take up the whole window. Instead, it will resize the canvas(es) to fit the container. Both methods are fine, it's up to you.

To answer your question above, yes you can use your WADE game with Apache Cordova to build a mobile app with AdMob, in the same way that you can do it with any other html5 app. If you get the code using the Download Source button in the editor, you can use that with the instructions for building a Cordova app.

I would also note that mobile browsers are pretty good these days, in most cases you don't really need a special plug-in to access native device functions, you can often do it directly through an html5 interface.

jota

Hi

Yes, the ad will cover the game area, in that case i should reserve that space specifically for the ads :(

I'm trying to use wade.setWindowMode('container') in the init function as you said, but i can't figure out how, is there anything else that i've got to do?

But on both cases the ad is always visible, now imagine i want to display the ad only and every time the player completes a level of the game, how i can i do it?

About cordova plugin and adMob i still got to dig a bit more...

best regards

 

 

 

Gio

Most advert providers that support HTML5 (by the way, I would also have a look at leadbolt) will have an API that you can use from your game, without having to worry about creating divs and positioning elements yourself. In general, you include their script in your index.html file, then call something such as adMob.opener.openOverlay()

Each provider will have their own API with a guide, for example see here for AdMob.

jota

thanks for the tips ;)

Post a reply
Add Attachment
Submit Reply
Login to Reply