Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Admob integration, what's my app id?
Started by yanuar Oct 12 2013 06:33 PM

28 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 935 posts
  • Corona SDK

I'm having a problem with admob. I can display an advert just fine, but it never triggers the listener function defined in ads.init.  

I've been using Vungle, and that has worked fine so I don't think there is anything inherently wrong in my code.

local function adListener(e)
		print("adListener")

		print("<<<event data")
		for k, v in pairs(e) do
			print(k, v)
		end
		print("event data>>>")

		if e.isError then
			if ads:getCurrentProvider() == "admob" then
				print("admob ad error")
			end
		elseif e.type == "adStart" then
	    	
	    elseif e.type == "adEnd" then
			if ads:getCurrentProvider() == "admob" then
				print("admob success")
			end
	    else
	        if ads:getCurrentProvider() == "admob" then
				print("admob other", e.type)
			end
	    end

	    if ads:getCurrentProvider() == "admob" then
	    	ads.load("interstitial")
	    end
end

ads.init( "admob", unique.adMobID, adListener )
ads:setCurrentProvider( "admob" )
ads.load("interstitial")

--called later on in code
ads.show( "interstitial" )

Has this happened to anyone else?

 

Edit: Tested on an android build, built with Corona SDK 2014.2325 (not Enterprise).



[TOPIC: post.html]
#27

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,675 posts
  • Enterprise

If you call ad.load() the listener is called when the load process completes.  There will be no listener trigger for ad.show().  Think of it this way, if you just call show() it calls load() and then show() under the hood.  The listener goes with the load() part of the call.

 

Rob



[TOPIC: post.html]
#28

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 935 posts
  • Corona SDK

That's...disappointing.

 

So if I want my analytics to show me when a user has successfully viewed an ad, I can't do it unless I don't preload the advert which means the user has to wait 3-5 seconds for it to appear? Or if I want to incentivise ad views, I also can't preload the advert?



[TOPIC: post.html]
#29

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 935 posts
  • Corona SDK

Also, admob supports video interstitials. Do we know if these would work using the current plugin?  

I've tried setting my ad type in the admob console to use "video" only, but I get an error saying "Ad request successful, but no ad returned due to lack of ad inventory". I assume this is simply an issue of the fill rate not being 100%.

 

Another thing that would be useful is if the data returned to the listener could contain whether the ad received was a text, image or video ad.

Is that something that could be possible, or is that kind of data simply not returned by admob themselves? 




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]