Hi,
I have been playing around with GPGS and trying to write a module to make it easier to implement Game Center and GPGS together (https://github.com/riceburgerlabs/miscUtilities/tree/master/gameNetworking - still a bit of work in progress).
Anyway, I was playing around with userInitiated and am not quite sure how it is supposed to work. My app logs in perfectly when I set it to true, but if I set it to false then I get the following error.
table: 0xc5b68720 { [name] =\> "login" [phase] =\> "logged in" [errorMessage] =\> "sign in required" [errorCode] =\> 4 [isError] =\> true }
This confuses me as I thought the point of “gpgs.login( userInitiated = false )” was to log the user in silently so they don’t see the popup etc? What is the point of it if they have to be logged in first? Have I misinterpreted the way it works?
Currently, what I have seems to work (needs more testing);
- When the app loads check if a persistent variable (saved in a json file) called GPGSLogged in is true
- If true then log in silently “gpgs.login( userInitiated = false )”
- If false then log in and prompt “gpgs.login( userInitiated = true )” and set GPGSLogged to true
- If the user logs out the set GPGSLogged to false
This seems to work, but it does mean that the first time the user uses the app they are prompted with the sign in dialog, I would prefer a more silent approach for a better user experience (like the ketchapp apps seem to use).
Craig