Ask here your questions to get help using GDevelop.
By xai1985
#54431 Hi, i don't know if too much users will know about it... I create the objects in gdevelop, 1 for banner and 1 for intersticial, try diferent thing, also put them into the stage directly, when i make a preview, i can't see them, that's normal or should i see them if it's working? I don't know that for sure, anyway i try to make them trhu XDK and also some problems with the admob plugin (as the configuration says in the wiki write (com.google.cordova.admob) you arrive to a plugin that gives you error when you try to build it (Error plugin "AdMob Plugin Pro" failed to install) i tried 3 times and the same error, then i find there are 3 admob plugins available,
1.- Admob ad (Basic) services (seems unable to use)
2.- Admob ad services (CLI4) (or not working or i'm making something wrong)
3.- Admob ad services (CLI5) (i read it's better to use for now CLI4 but i'll try tomorrow.
About the picture... it's ok to use the banners like this like a normal object? Or i'm making it wrong, of course i have the ID number in the objects.

Thanks a lot guys, it's driving me crazy this admob things... Seems quite hard to clear it :(
Attachments
admob_banners.jpg
admob_banners.jpg (190.58 KiB) Viewed 4588 times
Last edited by xai1985 on Tue 1 Dec 2015, 21:20, edited 1 time in total.
By xai1985
#54436 Since i though the conditions i use were wrong, i use new ones, i suppose them are corrects and should work, as you'll se in the picture, and then try with the "Admob ad services (CLI5)" since seems to be the most powerfull tool right now available in SDK since the admon plugin pro that says to use in the wiki from gdevelop always gave instal error no matter what, even with a template from SDK not just with my own proyect.
So, try to build with this plugin... and nothing shows up... :x
Attachments
admob_banners.jpg
admob_banners.jpg (310.54 KiB) Viewed 4565 times
By xai1985
#54438 I hope there is any way to solve this, because maybe is not posible to do it right now with the "cordova-plugin-admobpro" and should be with the normal version "cordova-plugin-admob" but the problem is that is no longer available (https://github.com/floatinghotpot/cordova-plugin-admob)... Hoper anybody gaves any solution for this :cry:
Attachments
problem_xdk.jpg
problem_xdk.jpg (196.04 KiB) Viewed 4565 times
By xai1985
#54492 After trying 1000 different things i see that must be any kind of error with the plugin in the progam xdk so it will always give you error while instalation when you try to build it. Fortunately this error doesn't exist if you download the plugin and instal it from your own computer (i'm talking in the intel xdk 2727 version (last one right now)) if you have one older you can try by xml but not recomended, so here is the plugin download: https://plugins.telerik.com/cordova/plugin/admob-pro
By xai1985
#54493 Still have 1 questio about this... Seems that my interstitial is not working yet... I though everything was ok with this configuration but seems that i'm wrong because is not showing... Any idea?
Attachments
ads.jpg
ads.jpg (159.25 KiB) Viewed 4510 times
By xai1985
#54494 I change the conditions for just:

Code: Select allCondition: At the begining of the scene - Action: Preload interstitial.
Condition: When the interstitial is ready to show - Action: Show the interstitial


And even that way it doesn't shows... I image there is any kind of mistakes because with this condition it must be shown forced no matter what.
The object is already in the scene since the begining but non showed... :cry:
By xai1985
#54647 Still nobody knows how to use/fix an interstitial, i report this as a bug and see if somebody can do/see/say something about it :(
By xai1985
#54974 HEEEEY!!!!

Hope this post is saved for the community!! IAN, VICTOR, LIZARD-13, anyone must save this one because seems that nobody knows how to use interstitial (or don't wanna help :cry: ).
I realized how to use the admob with the Gdevelop games so, i'm gonna write it here as complete as i can...

--1 THE ADMOB ACCOUNT--
You now you have to do a profile in google, and in admob, bla bla bla, and then, win money with your aplication (i have it in spanish so i don't know what says in english control panel of admob), well, so we choose to add one aplication manually and we choose the future name of our aplication, the platform (android or ios or windows phone) then we create the banner and the interstitial.

--2 THE BANNER IN OUR GAME--
The banner is in fact working with the own programation of the program gdevelop, you only need to use the admob objects like this:
1.- Create an admob object.
2.- Name it "banner1" for example.
3.- Write the banner android number id and the ios number id you have from your admob account, and select "Overlap game" and "Show banner on start up", and also choose if you like it at the top, or the bottom of your game.
4.- Put the object into the scene.
6.- With a condition "At the beginning of the scene" use the action "Hide banner ad of banner1".
7.- Whenever you wanna show it, use the condition "show banner". (you can use timers to set the time the banner is show combining it like: "if timer banner > 0.1s" -> show banner, "if timer banner >5s" -> hide banner.

--3 SHOW INTERSTITIAL--
There is any kind of bug or problem with the program, so we have to do it manually.

-3.1, programming interstitial inside of gdevelop-
We are gonna load the interstitial at the beginning of the scene, so we are gonna use the condition "at the beginning of the scene" and then, we gonna add a subevent, and we gonna choose add->javascript code, and we write or copy the next sentence:

if(AdMob) AdMob.prepareInterstitial( {adId:admobid.interstitial, autoShow:false} );

And now we are gonna use the condition to show it, so we decide when to show it, let's see when we finish the game, and it's a game where we kill/beat enemies, so we can do some condition like, "var enemies = 0" and then we gonna add a subevent, and we gonna choose add->javascript code, and we write or copy the next sentence:

if(AdMob) AdMob.showInterstitial();

That's all we need to write in our project, you have to do it in every scene you have and you wanna show the interstitial ad.

-3.2, ad a new file to our project-
We need to ad a .js file to our project to load somethings, so we create a .js file and write this:

Code: Select allvar admobid = {};
if( /(android)/i.test(navigator.userAgent) ) {
    admobid = { // for Android
       //banner: 'ca-app-pub-2903840155508808/6871334976',
        interstitial: 'ca-app-pub-2903840155508808/1121435375'
    };
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
    admobid = { // for iOS
        //banner: 'ca-app-pub-6869992474017983/4806197152',
        interstitial: 'ca-app-pub-2903840155508808/5551634972'
    };
} else {
    admobid = { // for Windows Phone
        banner: 'ca-app-pub-6869992474017983/8878394753',
        interstitial: 'ca-app-pub-6869992474017983/1355127956'
    };
}

if(( /(ipad|iphone|ipod|android|windows phone)/i.test(navigator.userAgent) )) {
    document.addEventListener('deviceready', initApp, false);
} else {
    initApp();
}


If you don't know how, create a .txt file, and change the .txt for .js and it'll be a .js file, the "//" in the file means a comment, let it in the banner to be sure it doesn't crash with the banner id we are using in the program gdevelop.
With this file, you just change the interstitial id for yours and that's it, i attachad the file anyway.

-3.3, one last modification in our programation-
The last part, when we have everything ready to use it into the Intel XDK, be sure to write inside of the file index.html from the folder www the next sentence:

Code: Select all<script type="text/javascript" src="admob.js"></script>


Be sure to put this file javascript in the root of the www folder, and also watch the name of this javascript, if it's admob.js, you use this sentence i just write above, if not you know that you only have to change the "src="admob.js" for the name you are using.

--4, last admob and playstore configuration--

Once you have create your play google account and correctly upload your game "it could take 5-6 hours to be shown in the playstore" then, probably in another 24 hours you'll be able to "link" your admob ads to your game by clicking "link your aplication" in your admob control panel, then just write the name of your aplication, and if it's shown, you'll be able to link it, and it'll begin to count the impresions and clicks and begin to make some money XD

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

With this info, you are able to use the banner and the interstitial of admob, is quite easy, so, what are you waiting for? Begin to create your crazy game and share it with all the community! :D
Attachments
(812 Bytes) Downloaded 84 times
By Nerdite
#62845 Thank you for this, I haven't tested it yet but I have been having issues loading banners and or interstitial. The game just stops loading at 100%

I'm going to spend some time and I'll let you know how it goes.
Sorry no one responded, it seems people are content to make games with no adverts!