Hi
I tried cocos2d-x c++ sdks in iOS simulator.
I found if I pressed the home button let app go to background, the online status of the player in server is still true.
1. Is that normal? Will app keep receive data in the background?
I think the cocos2d-x update function would stop, so the SDK should not be working.
And then the server should time-out the player and set the online status to false.
2. Can I manually disconnect when app goes to background?
I need to send push notification if players are not in foreground, please help.
Thanks a lot
Jo
Hi Jo
You can use GS.Disconnect when the app goes into the background and GS.Connect when it comes into the foreground
SetDurable can be used to queue messages and request to get sent when the player reconnects.
Thanks
Katie
1 - Yes if the websocket doesn't close properly they player can appear online for a while after.
Gamesparks will disconnect when in the background and reconnect when the app is opened.
2. To manually disconnect the player use Spark.getPlayer().disconnect(true);
Hi Katie
1. "Gamesparks will disconnect when in the background and reconnect when the app is opened."
How long will it timeout? is that possible to shorten it to few seconds?
Because of it, I cannot use the "player disconnected" binding cloud code in this situation.
And users will miss some messages because push notification won't be sent.
2. What you mentioned is cloud code api? But I'm using cocos2d-x c++ SDK.
For the server, it still thinks the player is online BTW.
Thanks a lot.
Jo Huang
Hi
I tried cocos2d-x c++ sdks in iOS simulator.
I found if I pressed the home button let app go to background, the online status of the player in server is still true.
1. Is that normal? Will app keep receive data in the background?
I think the cocos2d-x update function would stop, so the SDK should not be working.
And then the server should time-out the player and set the online status to false.
2. Can I manually disconnect when app goes to background?
I need to send push notification if players are not in foreground, please help.
Thanks a lot
Jo
Hi Jo
You can use GS.Disconnect when the app goes into the background and GS.Connect when it comes into the foreground
SetDurable can be used to queue messages and request to get sent when the player reconnects.
Thanks
Katie
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Jo
1 - Yes if the websocket doesn't close properly they player can appear online for a while after.
Gamesparks will disconnect when in the background and reconnect when the app is opened.
2. To manually disconnect the player use Spark.getPlayer().disconnect(true);
Thanks
Katie
Jo Huang
Hi Katie
1. "Gamesparks will disconnect when in the background and reconnect when the app is opened."
How long will it timeout? is that possible to shorten it to few seconds?
Because of it, I cannot use the "player disconnected" binding cloud code in this situation.
And users will miss some messages because push notification won't be sent.
2. What you mentioned is cloud code api? But I'm using cocos2d-x c++ SDK.
For the server, it still thinks the player is online BTW.
Thanks a lot.
Jo
Customer Support
Hi Jo
You can use GS.Disconnect when the app goes into the background and GS.Connect when it comes into the foreground
SetDurable can be used to queue messages and request to get sent when the player reconnects.
Thanks
Katie
-
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