Chartboost plugin - game crashes when trying to serve an ad

I just see it again with “invalid” license callback.

I am actually pretty sure my device network is fine during the startup, because all images I am downloading (via network request) /showing at the same time are displayed without problem. 

P.S. my app is like an RSS-reader so it happens to download images from the network during startup too. Would it be possible that too many network requests are using at the same time?

I recommend calling the init function again if you get a response of networkError or invalid at whatever interval’s suits, calling it again if you don’t get a valid response is a nice failsafe. It would also be a good idea to do as you suggested, in case of network status changes between suspending the app and resuming of course also.

Edit: We will double check to ensure there is nothing wrong at our end however.

(1) Could you specify the event types & names I should use to call init() again? I know (name==“license” and status==“invalid”) for invalid, but how about the network error?

(2) What if init() is called twice accidentally? Would it cause any error (even crash) for the app? Can I safely assume that if I get callback error from init(), I can always call init() again without worrying causing any problem?

I tested your invalid license case and managed to reproduce it. I have made some server side changes and can no longer reproduce the invalid license state. Can you see if it’s better for you now also?

To answer your questions:

  1. See the docs here: http://gremlininteractive.com/corona-plugins-documentation/chartboost_plugin_corona_docs/

They list the events that are returned relating to the license callback.

  1. Yes, there should be no problem with that.

Thanks

I kind of remember sending my app for approval few days aog had the plugin version 1.3 Do I need to recall it?

Thanks.

Mo 

Completely up to you Mo. The changes in this new version are all licensing related, the build you made via v1.3 will still work as expected (that build didn’t have any of the issues listed in this thread, they were new issues relating to the licensing changes)

Thanks

I tested your invalid license case and managed to reproduce it. I have made some server side changes and can no longer reproduce the invalid license state. Can you see if it’s better for you now also?

 

  1. See the docs here: http://gremlininteractive.com/corona-plugins-documentation/chartboost_plugin_corona_docs/

They list the events that are returned relating to the license callback.

 

  1. Yes, there should be no problem with that.

So far I didn’t see invalid license again. 

Now I call my chartboost init again like this:

if (event.name == "license") then if (event.status == "invalid" or event.status == "networkError") then \_myChartboostInit() end end

And I also call my chartboost init when application resume if Chartboost flag is not set as ready.

If you see anything inappropriate, please let me know. I have submitted it to App Store and have my fingers crossed. I like my last result with Chartboost, the revenue is higher than I expected, but I only tested a few days before I found the startup problem for some users. Hopefully this version will fix it. I will let you know.

Looks fine Joe.

Best of luck with the submission, let me know how you get on!

Cool, i will let it go and see what happens.

Thank you. i appreciate the fast response.

Mo

My app that uses the latest Chartboost plugin was published yesterday, and I have started to get user complaints that the app gets stuck again. 

Now I am considering to remove Chartboost from my app again.

I just find it weird how people have been using the plugin for months with no issues reported like this. And those users have hundreds of thousands of daily players. By this, i’m not trying to deny that it happens, just saying I wonder if there is a function call chain that is perhaps unique to the way most people are using perhaps, where it fails under a certain order of execution perhaps?

But if you can’t reproduce it locally, then that throws that theory out the window too i guess.

Is this only on Android or iOS also? Your waiting for the license callback to give you a valid response before calling any chartboost methods like you said before right?

The worst thing is that neither of us can reproduce it…

Thanks Joe

EDIT: Based on the crash report you provided Joe, i’m positive I have found the culprit. Please see my post here: http://forums.coronalabs.com/topic/50641-android-crash-report-in-chartboost-plugin-nullpointerexception/?p=262532

There is now safeguards in place that prevent that error from being possible to occur. Cheers.

New version pushed, available in about ~1.5 hours from the time of this edit.

All the reports about my app getting stuck are from iOS.

Earlier, I call init() right after the app starts and they said they couldn’t start the app. And for this new version, I call init() with a 2-second delay after the app starts, now the users said my app starts and gets stuck after a few seconds. I think it’s not just coincidence.

Of course now I only call any chartboost.* function after init returns valid license. I have a flag to be checked before every chartboost function(). If it’s not true, no chartboost function will be called.

Do you think “caching” could ever cause this? I mean I call cache function right after init() returns valid license in the callback. 

It’s very hard to reproduce. There are only a few users complaining about this comparing to my user base. I still see Chartboost revenue coming in everyday, I don’t want to remove Chartboost either. But my app is a reader app, not a small game, I can’t afford to lose reader’s loyalty to using my app. So I am very sensitive about user reports (and give them the reporting channel right in my app). I think they see this problem randomly too, not every time, or they can’t report this problem inside my app.

The Android crash only happened in rare occasion. Does it also happen in iOS? Would the problem above be associated with this crash?

That’s interesting information Joe.

I will take a look at the iOS version and see if the same race condition is possible there.

Don’t worry, we will get to the bottom of this. At least the android log gave us something to go on. I know this situation isn’t ideal and can appreciate your situation, as you know it’s just that much harder as we can’t reproduce it.

Thanks