Jump to content

How do I put cocoonjs ads into my pandajs game?


airpower58
 Share

Recommended Posts

Hello

 

I have been trying everything to put ads in my pandajs game but I am struggling to do so. The cocoonjs website is not clear on what code exactly I need to put into my game.

 

I just want banner ads on the bottom of the screen

 

Could someone please help me!

 

thanks

Link to comment
Share on other sites

Yea, their web is a chaos in terms of site navigation. And not pretty clear about how make stuffs work.

 

Here there is an article about Ads:

 

http://support.ludei.com/hc/en-us/articles/200978237-Ads

 

Javascript API DOC:

 

http://doc.ludei.com/

 

I also suggest you download the launcher examples and search inside the code:

 

https://cocoonjsservice.ludei.com/cocoonjslaunchersvr/demo-list/

Link to comment
Share on other sites

Config your MoPub account as described here:

 

https://www.scirra.com/tutorials/1024/mopub-integrate-admob-in-your-cocoonjs-games

 

Put these Code to your main.js:

if(CocoonJS && CocoonJS.nativeExtensionObjectAvailable && CocoonJS.Ad) {CocoonJS.Ad.onBannerReady.addEventListener(function(width,height) {CocoonJS.Ad.setBannerLayout(CocoonJS.Ad.BannerLayout.BOTTOM_CENTER);CocoonJS.Ad.showBanner(); });CocoonJS.Ad.preloadBanner(); }

Now it should work  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...