How to use the Vungle listener? Does it work?

I run it on the device and while it doesn’t print an error it behaves (the logic) like the isAdAvailable = nil :frowning:

so it’s not displaying any ad. Once I remove the isAdAvailable conditional - the ads are beeing displayed, so it should return true, when called. I don’t know what’s happening here.

That’s a bit weird. I had that problem too, but only in the Corona Simulator.

Once I ran it on a device (both Android and Apple) I had no issues…

SOLVED

OK, I guess there was some method-nesting issue (not sure why, though)

Now I require(“ads”) in all my modules and just call directly ads.isAdAvailable() and it works fine.

Anyway thanks!

can you use the vungle android key for your Nook app?

So far, the only issue I see with Vungle in “test mode” is that I cannot really test failures to deliver video (so I can switch to another ad network) I try turning off the campaign but for some reason the video test keep coming not matter what. Anyway to simulate or trigger a failure? Maybe making sure the test mode obey the setting of the campaign (on or off)

Thanks a lot for a great system!

Mo

EDIT:  I am SO sorry! I need new glasses:) I turned off Charboost instead of Vungle and was hoping for Vungle to stop delivering video ads. I had a Mo(ment) Sure enough when I disable Vungle, the video stopped showing! Not sure if disabling Vungle is enough to fully test video ads failure to show but for now I am satisfied.  Maybe when I am almost ready to release, I can switch to “live” to make absolutely sure that my app can react to a real life situation.

Again, SORRY:(

@Sagarpawaskar: I am trying to use your module but I for some reason I am having problem with chartboost. for some reason it is not finding cb (nil) i am sure is because is the way i initialize the ad networks (for me Vungle, chartboost and Revmob. I am doing this in main.lua but I believe you are doing it on the game menu module. It is making me crazy! I really want to use a modular way so I do not crowed the main.lua Would you mind sharing your ad networks initialization code? Of course hide your  ad networks! That will show me maybe where my issue lies. I am still not yet clear on the use of external module using M table so I am missing something.

THANK YOU for any pointers :slight_smile:

Mo

ps: I can see also that @ingmar has all the init code inside the adnetworks.lua? But not all functions are added to the M table?

@Mo

I noticed that chartboost ads do not re-appear if the user closes the interstitial. So I intialize chartboost in the module itself.

local M = {} -- you can add the below code in a separate function too, but i prefer not to. M.ads = require "ads" M.provider = "vungle" M.appIdVungle = "VUNGLE\_ID" M.cbdata = require "ChartboostSDK.chartboostdata" M.cb = require "ChartboostSDK.chartboost" M.appId = "CHARTBOOST\_ID" M.appSignature = "APP\_SIG" M.appBundle = "BUNDLE" M.appVersion = "VERSION" --ADD YOUR REVMOB CODE HERE----- --M.tapfortap = require "plugin.tapfortap" --M.tapfortap.initialize("TFP\_ID") ------------------------------------------------------------ M.delegate = { shouldRequestInterstitial = function(location) print("Chartboost: shouldRequestInterstitial " .. location .. "?"); return true end, shouldDisplayInterstitial = function(location) print("Chartboost: shouldDisplayInterstitial " .. location .. "?"); return true end, didCacheInterstitial = function(location) print("Chartboost: didCacheInterstitial " .. location); return end, didFailToLoadInterstitial = function(location) print("Chartboost: didFailToLoadInterstitial " .. location); return end, didDismissInterstitial = function(location) print("Chartboost: didDismissInterstitial " .. location); return end, didCloseInterstitial = function(location) print("Chartboost: didCloseInterstitial " .. location); return end, didClickInterstitial = function(location) print("Chartboost: didClickInterstitial " .. location); return end, didShowInterstitial = function(location) print("Chartboost: didShowInterstitial " .. location); return end, shouldDisplayLoadingViewForMoreApps = function() return true end, shouldRequestMoreApps = function() print("Chartboost: shouldRequestMoreApps"); return true end, shouldDisplayMoreApps = function() print("Chartboost: shouldDisplayMoreApps"); return true end, didCacheMoreApps = function() print("Chartboost: didCacheMoreApps"); return end, didFailToLoadMoreApps = function() print("Chartboost: didFailToLoadMoreApps"); return end, didDismissMoreApps = function() print("Chartboost: didDismissMoreApps"); return end, didCloseMoreApps = function() print("Chartboost: didCloseMoreApps"); return end, didClickMoreApps = function() print("Chartboost: didClickMoreApps"); return end, didShowMoreApps = function() print("Chartboost: didShowMoreApps"); return end, shouldRequestInterstitialsInFirstSession = function() return true end } M.cb.create{appId = M.appId, appSignature = M.appSignature, delegate = M.delegate, appVersion = M.appVersion, appBundle = M.appBundle} M.cb.startSession() function M.caching\_Ads() M.cb.cacheInterstitial() M.cb.cacheMoreApps() end M.caching\_Ads() function M.vungle\_init() M.ads.init( M.provider, M.appIdVungle, M.functionAdListener ) end function M.tfp\_prepare\_ad() M.tapfortap.prepareInterstitial() end function M.isVungleAvailable() if (type(M.ads.isAdAvailable) == "function") then return M.ads.isAdAvailable(); end return false; end function M.show\_vungle\_ad() if M.isVungleAvailable() then M.ads.show( "interstitial", { isBackButtonEnabled = true } ) else M.chartboost\_show\_ad() end return true end function M.functionAdListener() if event.type == "adStart" and event.isError then print("Vungle Error") end end function M.chartboost\_show\_more\_ad() if M.cb.hasCachedMoreApps() then local msg = "Chartboost: Loading More Apps From Cache" end print(msg) M.cb.showMoreApps() return true end function M.chartboost\_show\_ad() if M.cb.hasCachedInterstitial() then local msg = "Chartboost: Loading Interstitial From Cache" print(msg) M.cb.showInterstitial() else M.tapfortap.showInterstitial() end return true end return M

To init in main just do this

local myads = require(“myAds”)
myads.vungle_init()

Just use a separate function for all the init data and call it in main. I don’t think you should have any prob with that.

You can add everything in M table, this is more efficient in terms of memory management. I also noticed that chartboost has a small memory leak.

I hope that helps resolve your issue:)

@Sagarpawaskar: You are the best! I will try it and get back to you.

Thank you so much for the taking the time!

Mo

@Mo, do you have texture memory issues with revmob? The reason m not using it, the texture memory rises to 20 mb when I include revmob sdk in my app, have you recently encountered anything like this?

I will check on that! I will check the current app code that is out and my new incoming app. It has been a while since I check for memory issues.

I will try to get back to you as soon as possible.

Mo

Thank you!!

You are welcome :slight_smile:

Humm…Is build server down? I am getting a “Null” when try to build?

Mo

EDIT: Stupid me, I tried another app and it is building fine. It seems that my current app has some issue. Sorry about the false alert :frowning:

@Sagarpawaskar: Something come up and now it is getting very late. i am sorry, I promised to look into the revmob issue (memory) tomorrow and get back to you! I hope it is ok.

Mo

@Mo sure no problem. I’m not in a hurry.

I’m not having an issue with the build server.

@Mo, I’ve got the revmob thing to work now. Got rid of tapfortap…

TFP: 3400 impressions, 72 taps and $0. Crazy… and tech support seems to be too busy to respond on time.

@sagarpawaskar

Are those numbers for TapForTap or Revmob?

Revmob has been performing under par for the past few months for me with eCPMs between $0.2 and $0.8… ;(

@ingemar its for tapfortap.

I know revmob ecpm is down recently. I’d still have their ads; tapfortap ads aren’t appealing.

That’s good to know.

How is their tap-exchange? Did you see any significant increase in installs of your own apps?

@ingemar

I know this is going off topic…

… but yeah -> RevMob has been tanking for me too. $1.02 eCPM over the last 6 months but $0.49 eCPM for the last month. I hope Vungle and Chartboost can do the biz.

I seem to recall Otter Studios getting around $50-$70 per day on 40000 or so daily impressions with RevMob (if my memory serves me correctly). Would be interested to know what their eCPM is these days… (and those of other developers but that’s another thread!)

Eiswuxe (a fellow Corona developer) does exceptional numbers with RevMob but that’s an exceptional case.

Best,

Martin.

PS Almost forgot. To make matters worse, I’ve disabled gambling, religion and dating and yet RevMob keep serving up the useless William Hill app. Bring in AdColony, Heyzap and PlayHaven and “The Circle Is Now Complete” as Darth would say!

PPS Fair play to Corona on the Monetization front - things have certainly improved a lot :slight_smile: