Hi guys,
I have odd behaviour in my game using adMob and the back button.
I catch my back button with a key listener:
auto pKeyListener = cocos2d::EventListenerKeyboard::create();
if (pKeyListener)
{
pKeyListener->onKeyPressed = CC_CALLBACK_2(GameLayer::onKeyPressed, this);
pKeyListener->onKeyReleased = CC_CALLBACK_2(GameLayer::onKeyReleased, this);
pEventDispatcher->addEventListenerWithSceneGraphPriority(pKeyListener, this);
}
And this works fine, until the player clicks the adMob banner (ad shows in browser for example) and clicks back (or use menu to re-activate the game).
When the user now clicks the back button, my game just closes, without any key event being captured on my end. This is really dangerous, as data isn’t saved.
It’s almost like the game crashes, because nothing gets logged after this.
Has anyone seen similar behaviour, or if you have adMob and back button handling implemented, could you check to see if your back button behaviour is the same after you click an ad and go back to your game?
Kind regards,
Michaël