Yo
I received a PM asking for some more details on the gameCenter setup I use. Rather than just reply I thought I’d create a post with as much info as I have and could remember
First off AFAIK there is still no multiplayer support so this just covers Leaderboards, Achivements and In-App Purchases ( IAP ). Leaderboards only grab the highest score in Blueprints.
The tutorials from Epic on youtube cover a lot of this but not all in one place, from what I remember. I think the Unreal Match 3 video the most information, especially around achievements and what values to use ( if differs between android and iOS)
So … here goes
Apple Developer site
Obviously , you need an Apple developer account first:)
Certificates , Identifiers & Profiles
App IDs
Provisioning Profiles
- Distribution
This is distrubution profile as we need to upload the .apk to iTunes Connect ( needs an Apple Mac and the Apple Uploader software or xCode )
iTunes Connect Website
First upload your .apk ( you need to package for distribution and sign with your distribution cert in unreal ( see below ))
App Information – Make sure bundle ID matches AppID . From memory i think you pick the app from a list of your apps so this will always be correct, presuming you picked the correct app
Features
In short you will reference the ID of each item in your blueprints ( IAP - product ID , Leaderboard ID , Achievement ID )
IAP
LeaderBoards
Achievement
Now just add some testers , set your version of the app up for them to test and then have them download it through TestFlight ( Once you have done this it seems that you can push development builds from the editor to your phone/ipad and the online functionality still works )
Unreal
I have online subsystem set in two places, here you go
Engine
C:\Program Files\Epic Games\UE_4.15\Engine\Config\IOS\IOSEngine.ini
[OnlineSubsystem]
DefaultPlatformService=IOS
Project
C:\files\UE4\RRR\Config\DefaultEngine.ini
[OnlineSubsystem]
DefaultPlatformService=Null
Editor Settings
Edit Project Settings
In packaging tick ‘For Distribution’ , it should automatically set to ‘Shipping’
then
Note the Bundle Identifier matches the Development cert and what shown in iTunes connect
Blueprints
I have one blueprint that handles all the gamecenter stuff . My player controller creates an instance of this class to use for its online services. You can just put all the online stuff directly in the Event Graph of your player controller. I created a separate class so I could reuse it more easily. The instance of GameCenterHandler is passed a reference to the controller that owns it as the game center nodes need a player controller.
Player controller creating an instance of the GameCenterHandler class
The rest of this stuff is in my gameCenterHandler class but like I said you could just put this directly in the event graph of your player controller
A lot of the game center functions are latent so I created custom events in the event graph as you can’t have latent calls in functions. I only call the events from functions in my gameCenterHandler, they sanitize input, parse raw leaderboard data back into game appropriate data etc. . It’s these functions that I make public not the events, again, this is to make it more reusable
When this all works you will get a ‘Welcome back gameCenterUser’ popup over your app when you login
Any questions or mistakes etc. let me know
rOb
Sorry , I know this is in the wrong place … trying to figure out how to move it to the IOS area :S