A "close" event for the app


#1

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!


#2

I hate to bump my own topic, but I’d love an answer to this really simple question. Anyone?


#3

Hi @wouterlockefeer,

I can only think of the pause event. I don’t know if that will fit you.

Regards.


#4

Hey @Blue_Sialia,

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? :slight_smile:


#5

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.

Good luck!


#6

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.