Need help with Chartboost implementation

Hello again,

so, i want to implement chartboost in my app. i managed to get working the interstitials, but now i need help with the “more apps” screen. basically, i want it to be shown once a day, on exiting the app, and since my app is android only, on pressing the back key. the problem is, that if  i press the back key, the app kill itself. i tried adding a delay on exit, but that’s non very practical.  any tips on how to do this?

You’ll have to intercept the back key in your code and put your chartboost call there.
http://docs.coronalabs.com/api/event/key/keyName.html

(Personally I would show the ad at app start instead.)

EDIT:
Now I saw that you’re talking about the ‘More apps’ screen… OK I see your point of showing it at app-end.

i think i had an epiphany while reading your post. i know how to intercept button, but i didn’t know how to see if the user has closed the more apps window or not. now that i thought about it, i could simply make so that on the first click on the back button from the menu, the more apps page would open, and on the second the app will close itself. thank you for the tip, anyway

Yeah, that should work.

In case you still want to know if the user has closed the window you can implement delegates as described here:

https://github.com/ChartBoost/corona-sdk

Specifically the delegates “didDismissMoreApps”, “didCloseMoreApps” and “didFailToLoadMoreApps” would be of interest.

“didDismissMoreApps” will be called when the user actively closes the ad *and* when the user clicks on the ad and the window goes away. If “didFailToLoadMoreApps” occurs you could just do a native.requestExit() since no window will be displayed.

yeah, this is what i was searching for. thanks, gonna try it if the other code doesnt work as expected

You’ll have to intercept the back key in your code and put your chartboost call there.
http://docs.coronalabs.com/api/event/key/keyName.html

(Personally I would show the ad at app start instead.)

EDIT:
Now I saw that you’re talking about the ‘More apps’ screen… OK I see your point of showing it at app-end.

i think i had an epiphany while reading your post. i know how to intercept button, but i didn’t know how to see if the user has closed the more apps window or not. now that i thought about it, i could simply make so that on the first click on the back button from the menu, the more apps page would open, and on the second the app will close itself. thank you for the tip, anyway

Yeah, that should work.

In case you still want to know if the user has closed the window you can implement delegates as described here:

https://github.com/ChartBoost/corona-sdk

Specifically the delegates “didDismissMoreApps”, “didCloseMoreApps” and “didFailToLoadMoreApps” would be of interest.

“didDismissMoreApps” will be called when the user actively closes the ad *and* when the user clicks on the ad and the window goes away. If “didFailToLoadMoreApps” occurs you could just do a native.requestExit() since no window will be displayed.

yeah, this is what i was searching for. thanks, gonna try it if the other code doesnt work as expected