In the browser version of our game, we listen to the "unload" event to notify our server that a player leaves the game. We were wondering if there's a similar event we can listen to in Cocoon.
Thanks in advance!
I hate to bump my own topic, but I'd love an answer to this really simple question. Anyone?
I can only think of the pause event. I don't know if that will fit you.
Unfortunately that doesn't help us. We need to know when the app is opened (easy to do) and when it is closed (currently impossible to do) so that our game server can quickly recognize that the player has gone offline. We understand that such an event cannot always be fired (because the app might close unexpectedly) but even if it only fires under "normal" circumstances, it'd be an improvement for us.
Maybe a feature to add in the future?
It's a thing to consider, though it's a tricky task.
For the moment, depending on your goal, you might come up with some kind of workaround like this.