Chartboost integration

@ingemar. THANK YOU! It makes a lot sense. Cheers. Mo

Hi everyone!

im trying to use a Charboost+Admob combo on android, but i see there is a problem with permissions. i tested both in my app with READ_PHONE_STATE included: admob worked perfectly while chartboost registred impressions and clicks but no downloads. Now i removed that permission, and if what you said before is correct, charboost should start showing downloads, right? (i gonna test it later). but what about admob? on the corona sdk reference page, it says that the READ_PHONE_STATE permission must be included, but it doesn’t specify for which ad provider (for example, it could only be needed for inmobi but not admob). Also, the official admob documentation (https://developers.google.com/mobile-ads-sdk/docs/#android) doesn’t require the READ_PHONE_STATE permission, so i guess it should work also without it? can anybody with android confirm this? i’m gonna update you later about my dicoveries.

I haven’t used that combination myself (yet), but if the official Admob docs don’t specify it as required, then I’d say that you should be safe…

I’m trying to find where the frame is so I can move it down to line it up with the ad properly as mentioned previously.  Where is this stored??

You upload your frames from the Chartboost Dashboard.

Select your app from the Apps page to start editing.

In the Editing window select the “Promote other apps section”. There you’ll find “browse” buttons where you can select your graphics for frames and close-buttons.

NOTE: The offset is a bug which will be fixed in a future update meaning that you’ll need to adjust your frames again once the fix is in place.

Ahh thats great!  Thanks for the help, my client just sent me the id numbers hence the confusion!  Thanks again :slight_smile:

Hi  guys,

As you know, I have been working on integrating Chartboost, Vungle (video ads) and Revmob on the same app (my old Space Command!) Anyway, i am wondering if any of you guys would like to help me test the ads showing logic of the app before I send it to Apple for review.

Here the link to join this beta testing of the ads logic:

http://tflig.ht/I17cpp

There are two ads showing logic in the works. One for the app start/resume and one for the end of each game.

1- The first time the app launch, there is no ad showing.  Once you play one game then a Chartboost ad should be shown at every app resume/start. If Chartboost is not available then Revmob should be seen.

2- Once the game is over, you should see:

A video ad (Vungle)  IF vungle is not available then Chartboost ad will be shown. IF Chartboost is not available then the app is suppose to show you a Revmob ad (full screen) Finally if Revmob is not available then nothing happens and you can play the game again. I put Revmob at the end because it has basically 100% fill rate.

You will also noticed that i am using a native wheel to indicate something happening before each ad showing. This was done to keep the player from starting a game before an ad is finish showing for instance. That wheel should go away if the ad is showing (or not with some delay)

I am also making the ad show after EACH game. in the final version I am only showing an ad after 3 game plays. This only for you to test the ad showing without having to play 3 games!

I am really interested in the ads showing logic described above.  Please let me know if the app crashes or hang at any time.

THANK YOU!

Mo

@Edvard Arutyunyan, @Ingemar: THANK YOU so much for taking the time to join the testflight to test the vungle/charboost/revmob integration. I really appreciate!

I build a version with your profiles and send it to you guys. Please let me if any have issues.

Thanks again :slight_smile:

Mo

I’ve found a few issues. I’m preparing a separate email with my results.

Thanks ingemar! I got the report. I need to look at that Facebook issue. Too late right now but I will look into tomorrow after work. Thanks so much for taking the time to test and report the issue. Cheers. Mo

@ingemar: Thanks so much. I think i found the issue that you raise in your testing. It seems that we now need to add an extra line code in the builds.settings like"

FacebookAppID = “1234567890” where 1234567890 is the facebook ID of course. It used to be that we only needed the line:

“fb1234567890”

Once I added the FacebookAppID, the app actually launched the Facebook app (installed) and then came back to my app. I then saw that it was actually posting to my Facebook page. It was not posting before I added that line. Not long sure it was broken but I am so happy you were able to spot that! You seem to have some great eagle eyes :slight_smile:

Anyway here the link for more info. I hope it will help someone else.

http://www.coronalabs.com/blog/2013/07/30/understanding-facebook-authentication/

THANK YOU!

Mo

I’m glad that you were able to get it to work!

In my previous job I used to test code from my team before releasing to production. Even though it’s been a while, I’m still used to finding stuff that doesn’t behave properly :slight_smile:

Hello Ingemar! Could you please explain how did you fix the ad background cover issue?

Thanks is advance!

No problem!

Below you’ll find my Chartboost code from my ad network module.

First, my config.lua is set up to use letterbox with a single width/height specified:

-- config.lua local dFPS = require("dynamicFPS"); application = { content = { width = 320, height = 480, scale = "letterbox", fps = tonumber(dFPS.currentFPS()); antialias = false, xalign = "center", yalign = "center", imageSuffix = { ["@2x"] = 1.4, ["@2x~ipad"] = 3.4 } } }

(NOTE: The code below is tightly integrated with my own frameworks, so it’s not possible to just copy/paste the code into your own projects, however the logic is straightforward, so you should be able to cherry-pick)

For Chartboost, I have two local variables that control the additional overlays (overlay1, overlay2), and two functions that control the creation/removal (createOverlays, removeOverlays).

I also have a local variable which is important in this context called ‘screen’. It holds the current screen coordinates and is defined as follows in my framework:

local deviceScreen = { left = display.screenOriginX, top = display.screenOriginY, right = display.contentWidth - display.screenOriginX, bottom = display.contentHeight - display.screenOriginY } deviceScreen.width = deviceScreen.right - deviceScreen.left; deviceScreen.height = deviceScreen.bottom - deviceScreen.top;

The overlays are controlled through the Chartboost delegates. The delegates to watch are shouldDisplayInterstitial, didDismissInterstitial and didFailToLoadInterstitial. The code below mimics the Chartboost fade-in/out timing exactly.

-- ------------------------------------------------------------------------ -- ChartBoost -- ------------------------------------------------------------------------ local CHARTBOOST\_APPID = { Apple = {ID = "a", SIG = "aa"}, Google = {ID = "b", SIG = "bb"}, Amazon = {ID = "c", SIG = "cc"} } local chartboost = nil; -- Chartboost handle local overlay1 = nil; -- temporary overlays for chartboost background local overlay2 = nil; local removeOverlays = function() local destroyOverlay = function(object) object:removeEventListener("touch", object); object:removeEventListener("tap", object); object:removeSelf(); end if (overlay1) then destroyOverlay(overlay1) end; if (overlay2) then destroyOverlay(overlay2) end; overlay1 = nil; overlay2 = nil; end local createOverlays = function() local configOverlay = function(object) function object:touch(event) return true; end function object:tap(event) return true; end object:setFillColor(0, 160); object:addEventListener("touch", object); object:addEventListener("tap", object); object:toFront(); transition.from(object, {time=600, alpha=0}); end removeOverlays(); -- remove old overlays in case they are still there if (screen.left \< 0) then overlay1 = display.newRect(screen.left, screen.top, math.abs(screen.left), screen.height); overlay2 = display.newRect(screen.right+screen.left, screen.top, math.abs(screen.left), screen.height); end if (screen.top \< 0) then overlay1 = display.newRect(screen.left, screen.top, screen.width, math.abs(screen.top)); overlay2 = display.newRect(screen.left, screen.bottom+screen.top, screen.width, math.abs(screen.top)); end if (overlay1) then configOverlay(overlay1) end; if (overlay2) then configOverlay(overlay2) end; end local chartboostDelegate = { shouldRequestInterstitial = function(location) return true; end, shouldRequestInterstitialsInFirstSession = function() return true; end, shouldDisplayInterstitial = function(location) if (flags.canShowAds()) then createOverlays(); flags.pauseGame(); flags.cancelAllTouches(); M.isActive = true; return true; else return false; --ignore ad end end, didDismissInterstitial = function(location) timer.performWithDelay(600, removeOverlays); M.isActive = false; return; end, didCloseInterstitial = function(location) M.isActive = false; return; end, didFailToLoadInterstitial = function(location) M.isActive = false; removeOverlays(); if (revmobFallback == "popup") then M.showRevmobPopup(); else M.showRevmobFullscreen(); end return; end, didClickInterstitial = function(location) M.adTapped = true; M.isActive = false; return; end } local chartboostInit = function() chartboost = require("ChartboostSDK.chartboost"); flags.bundleid = "com.company.myapp"; chartboost.create{ appId = CHARTBOOST\_APPID[directives.STORE].ID, appSignature = CHARTBOOST\_APPID[directives.STORE].SIG, delegate = chartboostDelegate, appVersion = settings.version, appBundle = flags.bundleid }; M.showChartboostFullscreen = function(fallback) revmobFallback = fallback; if (not M.isActive) then chartboost.showInterstitial(); else print("chartboost: ad is active"); end end end M.startChartboostSession = function() chartboost.startSession(); end -- ------------------------------------------------------------------------

Hope this helps…

Whoa! Thank you! I got your logic! 

I download the chartboost lua code from https://github.com/ChartBoost/corona-sdk . 

local cb = require “ChartboostSDK.chartboost” --chartboost.lua

local cbdata = require “ChartboostSDK.chartboostdata”  --chartboostdata.lua

These two files are corrupted(It showing different symbles), Where can get correct files, can any one help me.

Thanks…

I think its encrypted, it should still work.  Mine is the same and works just fine.

Ya, It’s working… Thank you…

@kripa1415

Both files are obfuscated to prevent tampering.

They will work perfectly fine in your code though…

Did they submit a new version to github with the above bugs fixed ?