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
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
2 -banner key t
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
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?
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
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()
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
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, plicatibu
Likes: oleg, talis
Likes: hgy29, MoKaLux