I am sure many people here will be interested to hear that I just got chartboost running on one of my Android apps today (not on Enterprise).
If anyone wants to download and check that it’s working ok I wouldn’t say no…
https://play.google.com/store/apps/details?id=com.megafaunasoft.crystalcavernsfree
The chartboost code is beta and has some limitations but it seems to be working well so far (I’ve seen a couple of hours of impressions so far but no money:) ).
Here’s a step-by-step for a very basic integration. It shows an ad every four minutes max, which seems about right.
-
Download the new chartboost lua code from https://github.com/ChartBoost/corona-sdk
-
Copy the ChartboostSDK directory into your base directory
-
Add the following code to your main.lua (I just copied this from chartboost’s main.lua)
local cbdata = require “ChartboostSDK.chartboostdata” local cb = require “ChartboostSDK.chartboost” local appId = <GET_FROM_CHARTBOOST.COM> local appSignature = <GET_FROM_CHARTBOOST.COM> local appBundle = “com.megafaunasoft.crystalcavernsfree” local appVersion = “1.0” local CHARTBOOST_INTERVAL = 240 local chartboost_clock local 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 } cb.create{appId = appId, appSignature = appSignature, delegate = delegate, appVersion = appVersion, appBundle = appBundle} cb.startSession() function chartboost_cache_ad() cb.cacheInterstitial() end chartboost_cache_ad() function chartboost_show_ad() if cb.hasCachedInterstitial() then msg = “Chartboost: Loading Interstitial From Cache” end print(msg) cb.showInterstitial() return true end function timed_chartboost_show_ad() print(“timed_chartboost_show_ad”) if chartboost_clock == nil or os.clock() > chartboost_clock + CHARTBOOST_INTERVAL then chartboost_clock = os.clock() chartboost_show_ad() end end
-
Add this to an enterScene event…:
timed_chartboost_show_ad()
UPDATE: there is a bug where a change in orientation while the ad is showing will cause a blocking error. I’ve listed the bug on github. It seems like it should be easy to resolve. I would not advise using the module until it’s fixed.