Since the full release notes aren’t available as of this post, and 4.9 Preview 1 is available now, I wanted to let everyone know about a breaking change in 4.9 regarding logging in to Game Center. For those of you following the GitHub master branch, the change is in this commit.
Most of these changes also apply to Google Play Games on Android, so please refer to this thread for anything Android-specific.
Up through 4.8, the iOS online subsystem (if enabled) would automatically start the login process, and potentially show the Game Center login UI, during engine startup - the game had no way of controlling when the UI came up, and in addition, it was causing timing issues in the engine.
To address these problems, in 4.9 the Game Center sign-in process and login UI is no longer triggered automatically at startup. We have implemented the IOnlineExternalUI::ShowLoginUI function for Game Center and added a new Blueprint node, “Show External Login UI”, which wraps this function. The existing “Connect to Service” node has been deprecated and we encourage everyone to switch to using “Show External Login UI” in their Blueprints. This returns control of the login process and UI to the game, so you’re free to activate it at a time that’s appropriate for you. Many games will be able to call it during a BeginPlay event - this will be after the engine has been initialized and any startup movie has finished playing.
Another benefit of this approach is that games will be explicitly notified when the login succeeds (or fails) - for instance, leaderboard- and achievement-related functions will be much more reliable after execution continues past the “On Success” pin!
In addition, we have implemented an “Is Logged In” Blueprint node that will return whether or not the user is logged in to Game Center.
Feel free to post any feedback about these changes here - though for specific bug reports, please post them on AnswerHub!
how does this interact with the JNI local reference table? As that is the problem I’m having I’m wondering if this will interact with the JNI differently as it doesn’t get loaded at engine start now and we can finally have people choose to log in or out with for example a button.
EDIT: I assume this also works for Android (that’s where I’m having problems with)?
The “Is logged In” does not work for me. It returns false even though I’m logged into game center in the ios settings. Does this work for anyone else? I can run “Show External Login GUI” and it will bring up the Welcome back message.
How do I set it up to when the game starts it logs into game center from the game if the user is logged into the ios game center and also not bring up the game center login if the user is not logged into the ios game center?
Are you using a game that you’ve uploaded to Apple ( iTunes connect ) and are running through TestFlight using a sandbox game center user ? Logged in is a combination of user and game logged in together. I’ll try and give the ‘is logged in’ a test tonight if I can … it’s a pita testing game center stuff
As a quick test log out of game center in settings. Start your game and then try and login in the full screen game center popup. If it whinges there, you aren’t logging in and it will tell you why.
You have to call the external login UI to log in. If you aren’t logged into game center you will get the full screen login. If you are already logged in you will get the welcome back banner.
I’m not sure there is a way round the login screen or banner popping up if that’s what you mean? it’s effectively a call to the API in iOS which is out of app developer hands.
Also please note that I was getting ‘Game not recognized by Game Center’ message until I added a leaderboard in iTunes connect, seems it doesn’t become active in Game Center till you enable some game center feature like leaderboards, weird ?
Ok I was looking Apple dev site and apparently this is how Apple wants it. Tried some other games including Tappy Chicken and I think it is annoying having the full screen gamecenter login popup when the game first starts. I did play one game that didn’t popup the login screen if not logged into gamecenter and it still connected to gamecenter if I was logged in to it.
Quick update, I checked the ‘Is logged in’ Node out last night and it works as expected. If anyone needs me to post my Blueprints for logging in , ‘is logged in’ and getting / setting a leaderboard let me know. I’ve Build Configuration set to Shipping (in case that makes a difference ) and I’m logging into Game Center with a sandbox user that I setup in iTunes Connect
Thanks, I’ve figured it out and I’m not doing a shipping build yet. I didn’t realize that the “Is logged In” just checked if the game is connected to game center. I also just figured out there is no need for an option in game to turn off gamecenter because if you haven’t been logged in to game center for a while or hit cancel 3 times the login popup won’t show up.
After a few days fiddling about with my ini files and build settings trying to get game center achievements working, I finally found this thread… now achievements work once I chucked this node in there!
Might want to think about adding this info to the game center docs, save someone else the trouble?