Sign In Register

How can we help you today?

Start a new topic
Answered

GameSparksAvailable, task switching, and messaging.

I want to display a message to the user when our game loses connection to GameSparks. To do this, I've added a handler to the GameSparksAvailable action. This works, however it also triggers when the game is task switched, as GameSparks disconnects when the task switch happens. The problem is that when the app is task switched out the GameSparksAvailable action doesn't get called until after the app task switched back in, and the GS.Reconnect() has been called. So I can't tell if the call to the GameSparksAvailable handler is valid or not.


Thanks for any help.


Best Answer

I don't think checking network connectivity helps. In the end I just disabled the code in the GameSparksAvailable-false action when called just after waking up, and instead setup a coroutine to check GS.Available four seconds later. It's not pretty but it works.


Hi Kevin, 

It's quite straight forward to achieve this through code.  To check for connectivity you can ping googles servers. This way it is quite straight forward to determine a network connection or not and handle based on that. 


Let me know if this helps. 

Best Regards, Patrick. 

Answer

I don't think checking network connectivity helps. In the end I just disabled the code in the GameSparksAvailable-false action when called just after waking up, and instead setup a coroutine to check GS.Available four seconds later. It's not pretty but it works.

Hi Kevin, 

Thank you for your update, glad to see you found a workaround.


Best Regards, Patrick. 

Login to post a comment