Chartboost Plugin released!

Good to know, thanks.

We don’t have any control over frames, but could you post the screenshot of your issue all the same?

Thanks.

@everyone else, we have fixed the double events people reported, which, ironically, was a Chartboost issue we had to work around.

A few other fixes also. We are just running through a host of tests and will push an update shortly after. Which will hopefully be the final update to fix these initial issues.

Thanks

Update:

Ok, so we have pushed v1.2a up now. Should be available to you guys in about ~1.5 hours from the time of this post. We have also made the callback events more distinguishable. For instance, if an interstitial fails to load, rather than just getting an event phase of ‘failed’ you get a proper message back like so:

local function listener( event )     local phase = event.phase; -- == 'load';     local result = event.result; -- == 'failed'; end

We believe this is a better approach, as it is clearer what exactly went wrong, rather than a generic ‘failed’ message which doesn’t tell you what failed.

Notes:

  1. Before letting us know how the plugin works for you, please establish that you are running the latest version ( v1.2a ) by executing this function:

    local chartboost = require( ‘chartboost’ ); print( “Chartboost plugin version is:”, chartboost.getPluginVersion() );

  2. Please make sure you have added your iOS device to the Chartboost portal, otherwise ads may not show: https://dashboard.chartboost.com/companies/test-devices

  3. Please make sure you have set up a publishing campaign for your app, or ads may not show. https://dashboard.chartboost.com/campaigns/publishing

  4. Post up the code you are using for Chartboost. This shouldn’t be needed, but it never hurts to ensure that everything is 100% correct.

We have tested v1.2a on various devices and had 100% success in showing and caching both interstitials and moreApp screens.

From this point on, we need anyone who is experiencing problems to post up screenshots of their chartboost app settings, publishing campaign and device list screens, from the Chartboost dashboard. Please blank out any sensitive details you do not wish to show on the screenshots before posting.

Changelog:

  • Fixed issue where Chartboost would report cache/failed events multiple times.

  • Fixed issue where plugin was forcing caching.

  • Added function chartboost.startSession(). This function must be called on every system “applicationResume” event.

Thanks

PS: We will be documenting all of these changes once we get everyone sorted out.

Cheers

A better way would be to let me know if the ad is cached, before I display it, otherwise resume the game

like in the other sdk

ChartboostPlugin.hasCachedInterstitial()

I’m not getting the didShow event (like in 1.1), only willShow(not sure if this assumes it’s going to work)

Did you try the latest version since? (v1.2a) ?

Edit:
We can offer a function to let you know if a specific ad is cached if you would like. Seems like a missing feature.

Thanks

I am using v1.2a and everything seems to be working fine for me.  I am testing on a real iPhone 5.

When I call .init(), I get an event that fires with name == “license” and status == “valid”.

When I call .cache(), I get an event with name == “chartboost” and phase == “cached”.

When I call .show(“interstitial”) I get two events that fire, both with name == “chartboost”. The first has phase == “willDisplay” and the second has either phase == “closed” (user closed by clicking X) or phase == “clicked” (user clicked the ad).  I don’t know exactly what the event looks like if an ad does not show, because since v1.2, the ads work every time for me.

Thanks Gremlin for the fixes and updates!

I’ve implemented the plugin (v1.2a) and everything is working as expected.

I am getting the error 
 

bad argument #1 to 'startSession' (string expected, got no value)

whenever I call startSession in my app’s onResume… 
Do I have to pass any parameter to the function?

[quote=“Satheesh,post:47,topic:326148”]

I am getting the error

bad argument #1 to 'startSession' (string expected, got no value)

whenever I call startSession in my app’s onResume…
Do I have to pass any parameter to the function? [/quote]

We will check this out. Your using our Chartboost plugin right? Not the Lua one from Chartboost?

Thanks

Yeah yeah… I am using the plugin 

cb = require( "plugin.chartboost" )

Apparently the startSession function requires 2 arguments. 
When my app starts, I don’t call this function and the ads load perfectly. 
But during onResume,  when I call this function(as you’d mentioned above) this error occirs…

If I give 

cb.startSession(" "," ")

just for testing it,the errors are gone, but the ads do not load anymore. 
I always get “failed”

[quote=“Satheesh,post:49,topic:326148”]

Yeah yeah… I am using the plugin

cb = require( "plugin.chartboost" )

Apparently the startSession function requires 2 arguments.
When my app starts, I don’t call this function and the ads load perfectly.
But during onResume, when I call this function(as you’d mentioned above) this error occirs…

If I give

cb.startSession(" "," ")

just for testing it,the errors are gone, but the ads do not load anymore.
I always get “failed” [/quote]

My memory is a little hazy as I’ve been working on an unrelated project ever since, but i believe the two arguments are ( appid, appSecret), the same Chartboost app args as you pass to chartboost.init()

I’ll confirm this and get this documented tomorrow.

My apologies for the lack of documentation for the new functions i added, completely slipped my mind.

Thanks

Yeah, you must specify the Chartboost app-id and and app-sig in the call to cb.startSession().

This was a change that Chartboost made in their newest version 4.4 SDK (and the plugin uses the latest version).

So the call should be something like:

cb.startSession(“5322a830f8abababababababab”, “4d439a8f8a92f1f691dededededededededededede”)

It would’ve been nice for you to specify that to us beforehand. I bought the plugin and I have an app that released today with it installed.

Does this mean I’m not getting credit for my ads on Application Resume because I only included chartboost.startSession() without the app-id and app-sig?

Obviously, I am not happy to hear this.

@ChunkyApps

I think it depends on which version of the plugin you’re using.

If you use the first version, I believe that you’re OK. However if you use version 1.2a you should use the new syntax.

Not sure how this affects tracking, but you should’ve gotten error messages in your log while testing if you omitted those parameters to startSession().

We apologize from the bottom of our hearts. As Ingemar has said, during your testing you should have seen errors from the startSession() function if the appId and appSignature parameters were omitted).

We have updated our documentation to add a reference to the startSession() function here: http://gremlininteractive.com/corona-plugins-documentation/chartboost_plugin_corona_docs/

Naturally we realize that this doesn’t help you in the short term. Please contact us via email and we can do something for you to compensate for the inconvenience.

Thanks

Note (To all): We will also be updating our documentation to explain the events a bit better (they are now documented at least, that was an omission), and are also starting on the Android version next week. Our eta (provided no acts of god, illness etc) is to release at the end of next week.

 …and are also starting on the Android version next week.

Yay!  :wink:

I got around to fixing all my issues and released my app with this plugin in it, I would still like a .isCachedAdAvailable or have show return a bool or have a callback or something.  I want users to trigger ads if they hit continue and to be able to respond if they don’t.  Otherwise I have to have users hit continue twice. I don’t like ads that popup at random, I prefer to have them triggered by actions as it’s a better user experience. With hundreds of players daily I can’t afford to have a bad ad experience.

I never implemented the  chartboost.startSession( yourAppID, yourAppSignature ); on resume events, but continued to get ads (although I’m not sure if I’m being credited)   The online docs show chartboost.cache( appId, appSignature ) as an example, I guess there’s a mistake there. I will add it to see if anything changes

It’s important to keep caching ads if you fail, (if you go to airplane mode and come back for example)  but the whole thing is now working from what I can tell

Here is how I worked around it, I really shouldn’t have had to do this if I had some indication of wether ads were available or not

local function chartboostListener( event )       print("CHARTBOOST EVENT")        -- Print the events key/pair values        for k,v in pairs( event ) do            print( "CB  " .. k ..  " : " ..  v )        end        if event.name == "license" and event.status == "valid" then           if(chartboostPlugin.getPluginVersion) then             chartboostPlugin.cache()             UIAds.chartBoostLive = true             print("CHARTBOOST LIVE version " .. tostring(chartboostPlugin.getPluginVersion()) )           end        end        if(event.type == "interstitial" and UIAds.interstialFailCallback ~= nil  ) then                    if(UIAds.chartBoostPluginFailTimer and (event.phase == "cached" or event.phase == "willDisplay") ) then             print("CB showed the ad, Cancel interstial timer")             timer.cancel(UIAds.chartBoostPluginFailTimer)             UIAds.chartBoostPluginFailTimer = nil           end                     if(event.phase =="failed" or event.phase == "closed") then              print("callback fail or closed")                          if(UIAds.chartBoostPluginFailTimer  ) then               print("CB failed, Cancel interstial timer")               timer.cancel(UIAds.chartBoostPluginFailTimer)               UIAds.chartBoostPluginFailTimer = nil             end                       UIAds.interstialFailCallback()             UIAds.interstialFailCallback = nil             if(event.phase == "closed") then               lastInterstitialWas = "chartboost"             end           end        end    end local function showChartBoostInterstitial(callbackToContinueAfterAd) if( chartboostPlugin and UIAds.chartBoostLive == true) then       print("CHARTBOOST SHOW ATTEMPT")       UIAds.interstialFailCallback = callbackToContinueAfterAd       -- timer to continue game because we did not show an ad       UIAds.chartBoostPluginFailTimer = timer.performWithDelay(900,function()         print("trigger CB fail timer")         if(UIAds.interstialFailCallback) then           print("call CB fail")           if(chartboostPlugin) then            chartboostPlugin.cache()           end           UIAds.interstialFailCallback()           UIAds.interstialFailCallback = nil         end       end)             chartboostPlugin.show( 'interstitial' )             return true     end return false end

Before you make the Android version please add something to indicate there is no  cached ad available, if it hasn’t already been added

It’s already possible to determine if an ad is cached.

After you call cache() you’ll get a callback with the following properties when an ad is successfully cached:

event.name = “chartboost”

event.type = “interstitial”

event.phase = “cached”

If you don’t get this callback you don’t have a cached ad.

Are you sure this event is only triggered on a successfully cached ad? If so I wasn’t aware and will make life a lot easier, thanks.

Hopefully cached ads stay intact after a suspend/resume. Will give it a shot

I’m sure. That’s the behavior I’ve seen on my devices.

As a safeguard I reset my cache-logic and call cache() after a suspend/resume also because you never know for how long the app has been suspended (it could’ve been days).

I sent you an email. Thank you very much.