GameSparksAvailable, task switching, and messaging.
K
Kevin Martin
started a topic
about 6 years ago
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
K
Kevin Martin
said
almost 6 years ago
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.
Thank you for your update, glad to see you found a workaround.
Best Regards, Patrick.
K
Kevin Martin
said
almost 6 years ago
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.
Customer Support
said
about 6 years ago
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.
Kevin Martin
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.
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.
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstCustomer Support
Hi Kevin,
Thank you for your update, glad to see you found a workaround.
Best Regards, Patrick.
Kevin Martin
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.
Customer Support
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.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics