Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Ads plugin data confusion. - Gideros Forum

Ads plugin data confusion.

koeosstudiokoeosstudio Member
edited September 28 in Plugins
First time implementing ads and I am totally confused on the admobs plugin. Can anybody explain how it works for admob?
Here's the situation I want to add admob ads using the plugin:
1. What is application ID in the plugin? Is it something like this "ca-app-pub-6171539406152167~4146545266"? Should I copy it from my admob and just paste it in the application id area?
2. What is the admob client key? Is it like this? "ca-app-pub-6171539406152167/8057870501"?
3. Does admob banner key the same as the admob client key? If admob banner key and admb client key is not the same, where should I get the banner key?
4. If I use the admob:setKey() function, does it change the app id, client key , or banner key??

I am totally confused, please help. Thanks a lot.

Comments

  • I have searched the forum and I found this code below:

    require "ads"
    admob=Ads.new("admob")
    admob:setKey("ca-app-pub-3940256099942544/1033173712")
    admob:loadAd("banner", "ca-app-pub-3940256099942544/6300978111")

    admob:addEventListener(Event.AD_RECEIVED , function (event)
    print(event.type, "ad received")
    if event.type=="banner" then admob:showAd("banner") admob:setAlignment("center","bottom") end
    end)

    The banner key and the setKey value is not the same. It just worsened my confusion. XD
  • 1- client key
    2 -banner key t

    image.png
    1457 x 505 - 114K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • 3-application ID
    image
    111.PNG
    742 x 383 - 32K
    111.PNG 31.7K
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • @oleg Is this correct?

    admob:setKey("My app id")
    admob:loadAd("My ad unit id")

    I left the plugin blank and defined the admob properties in the code instead. Would that be okay?
  • I found this code where the app ID is place in the admob:setKey() function.
    Ads = Core.class(Sprite)

    function Ads:init()

    -- ads
    self.ADMOB_APP_ID = "ca-app-pub-3940256099942544~3347511713"
    self.ADMOB_UNIT_ID = "ca-app-pub-3940256099942544/6300978111"

    -- admob (setup for simple banner adverts)
    if DEBUGGING then
    self.ADMOB = {} -- create fake object for testing in windows player
    self.ADMOB.loadAd = function() end
    self.ADMOB.showAd = function() end
    else
    require 'ads' --create real object for on device
    self.ADMOB = Ads.new('admob')
    self.ADMOB:setKey(self.ADMOB_APP_ID)
    self.ADMOB:addEventListener(Event.AD_RECEIVED, function() -- show ad
    self.ADMOB:showAd('banner')
    self.ADMOB:setAlignment('center', 'bottom')
    end)
    self.ADMOB:addEventListener(Event.AD_FAILED, function(e) end)
    self.ADMOB:addEventListener(Event.AD_ACTION_BEGIN, function() end)
    self.ADMOB:addEventListener(Event.AD_ACTION_END, function() end)
    self.ADMOB:addEventListener(Event.AD_DISMISSED, function() end)
    end

    -- LISTENERS
    self:addEventListener("enterBegin", self.onTransitionInBegin, self)
    self:addEventListener("enterEnd", self.onTransitionInEnd, self)
    self:addEventListener("exitBegin", self.onTransitionOutBegin, self)
    self:addEventListener("exitEnd", self.onTransitionOutEnd, self)

    end

    -- EVENT LISTENERS
    function Ads:onTransitionInBegin()
    end

    function Ads:onTransitionInEnd()
    self.ADMOB:loadAd("banner", self.ADMOB_UNIT_ID)
    end

    function Ads:onTransitionOutBegin()
    -- self.ADMOB:hideAd()
    end

    function Ads:onTransitionOutEnd()
    end
  • See an example here:
    C:\Program Files (x86)\Gideros\All Plugins\ads\examples\GiderosProject

    Be sure to include testing mode:(So that admob doesn't ban you)
    ads:enableTesting()
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • MoKaLuxMoKaLux Member
    edited September 28
    please check the wiki:
    https://wiki.giderosmobile.com/index.php/Ads
    the first example.
    Please note: you need to add "Ads" and "Gaming" to your project Plugins

    Likes: SinisterSoft

    +1 -1 (+1 / -0 ) Share on Facebook

  • Likes: oleg, talis

    +1 -1 (+2 / -0 ) Share on Facebook
  • Thanks! I have successfully integrated the ads. My game is live now on google play.

    Likes: hgy29, MoKaLux

    +1 -1 (+2 / -0 ) Share on Facebook
Sign In or Register to comment.