Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Curious about the Ads Interface plugin (Workflow, how-to) - Specifically Admob — Gideros Forum

Curious about the Ads Interface plugin (Workflow, how-to) - Specifically Admob

newbie2018newbie2018 Member
edited February 2018 in Plugins
First, I did read a number of forum posts here and have finally been able to show some ads using Gideros plugins :)

But I have some questions about how you guys normally use it? (correct me if I am wrong. Hope you don't mind I ask in one post)
Statement 1: 'requires 'ads' only works in device, not desktop player'
- At the moment, I have to comment + exclude the the file containing any 'ads-related' line during debugging. Only at the final stage (exporting APK to device), then only I remove the comment or include those ads-related file. Is that the way you normally do?

Statement 2: ClientKey and Ads Key are optional at the UI

Since we are able to specify in the code, so there is no need to specify in the UI right? Or if I fill in here, I could skip that at the code?

Problem 3: What are all these "Installation Android" guide for?

Sorry I have no idea what is this for? So far I am able to show the ads in Lua, at which stage would I need this?

Statement 4: I only need to call 'LoadAds' once right?
As observed, the interstitial ads only require one time calling of 'LoadAds', after the ads is displayed and dismissed, it would be automatically 'Loaded' subsequently, such that, I just need to call 'ShowAds' later on.
noneed.PNG
551 x 358 - 16K
installation.PNG
1465 x 567 - 79K
Tagged:

Comments

  • olegoleg Member
    Accepted Answer

    that's all it takes


    image.png
    720 x 459 - 56K

    Likes: newbie2018

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+1 / -0 )Share on Facebook
  • newbie2018newbie2018 Member
    edited February 2018
    @oleg Thanks for your fast response again. The thing is, in my case, it does work even though I didn't fill in the keys...
    P.S.: Sorry I may be a little bit long-winded... I would test this myself..
  • olegoleg Member
    edited February 2018
    @newbie2018
    admob will not pay you
    if you do not specify the keys
    For each game, the admob creates a separate key

    Likes: newbie2018

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    Accepted Answer
    @newbie2018, with the whole "ads not available in windows player" issue. That kind of bugs me sometimes too ;)

    My current solution is to have the following code where I use admob.
    DEBUGGING = true
     
    -- ADMOB
    if DEBUGGING then
      admob = {}
      admob.loadAd = function() end
      admob.showAd = function() end
    else
      require "ads"
      admob = Ads.new("admob")
      admob:setKey(ADMOB_APP_ID)
      admob:addEventListener(Event.AD_RECEIVED, function()
        admob:showAd("banner")
        admob:setAlignment("center", "bottom")
      end)
      admob:addEventListener(Event.AD_FAILED, function(e) end)
      admob:addEventListener(Event.AD_ACTION_BEGIN, function() end)
      admob:addEventListener(Event.AD_ACTION_END, function() end)
      admob:addEventListener(Event.AD_DISMISSED, function() end)
    end
    So if DEBUGGING is set to true I just use blank shell functions for admob and if it is false then the actual code is used. This seems to work fine for me, maybe you could use a similar method.

    The document you refer to is ancient and at some point in the near future it will be removed. Sorry for the confusion this causes :)

    Likes: newbie2018

    +1 -1 (+1 / -0 )Share on Facebook
  • piepie Member
    Accepted Answer
    IMHO there is a better approach:
    You can use debug mode (as from antix's post) to trigger demo ads, while you check if you need to load them at all with getdeviceinfo().
    See here from Mr.Sinistersoft: http://giderosmobile.com/forum/discussion/comment/44776/#Comment_44776 :)

    Likes: oleg, newbie2018

    +1 -1 (+2 / -0 )Share on Facebook
  • newbie2018newbie2018 Member
    edited February 2018
    @antix and @pie
    Really appreciate your answers! I didn't realize it could written that way. Gideros/Lua is really flexible :)

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • @SinisterSoft's solution has lots more code to tell which device type the thing is running on, mine just decides to use the fake or real code based an a single bool ;)

    @SinisterSoft's code is better for other cases however :)
  • @antix no problem :) Yours do help me
  • olegoleg Member
    edited February 2018
    @antix
    --easier to put in init.lua
     
     banner @ |admob:showAd("banner")|
    -- banner @ |print(""DEBUGGING )|
     
     
    --------------
    --And there where the advertisement is simply put
    banner
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • @oleg that will work but if you run that code in a player that does not have the admob plugin built in it will throw an error right?
  • olegoleg Member
    edited February 2018
    @antix Just comment on the required line during the debugging
     --banner @ |admob:showAd("banner")|
    banner @ |print("DEBUGGING" )|
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • olegoleg Member
    edited February 2018
    to disable all rows admob
    admob @ |--|
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
Sign In or Register to comment.