- Home /
Prevent Android pause when an overlay is active
Hello everyone,
I'm currently doing an Android port for an existing online multiplayer game. Right now I want to implement some Facebook and Google functions (login, achievement, leaderboard, sharing, invitations, billing, etc).
Most of these functions open an overlay over the running game and pause the application. While the game is paused it stops sending messages to the server and after a couple of seconds it loses connection and quits with an error screen.
Is there any way to prevent the pause when Google Play Services or Facebook Services open an overlay?
I know that you can use services to keep a closed or minimized application running, but I suppose it would be much easier and faster to just prevent the pause when I'm looking at the achievement board.
I was hoping that at least Google Play Services would not try to pause a game with "Realtime Multiplayer" support enabled, but apparently that's not the case.
Thanks for your time.
Answer by AmineMessa · Jul 05, 2017 at 12:11 PM
I'm not sure if you still need the answer
And i'm not sure if my answer is the correct one, but you can try using this
void OnApplicationPause(){
}
And make your server connection there or do your things .