Download

GameCenter Guide - working setup - 4.15

Yo :slight_smile:
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
746a2ed6583651e0c383d78c9e7723368957bf49.jpeg

App IDs
0bb95e62b5409b43acf422080baf20fa66c48f6a.jpeg
2c3886d0f2cfcd34231969f7bb5e61c7372197a0.jpeg

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 )
ab0db27c0217bc7e1fb43d9a70e59d767ccd1600.jpeg

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
4aaa281ccc87f268b0be6c750840a250937109b8.jpeg
pic6.jpg

LeaderBoards
pic7.jpg

Achievement
pic8.jpg

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
pic9.jpg
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
80aa14ddc70ffc336250302f5a473ad3c1725083.jpeg

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

d19e74b9500f14dc35dcfe7b0ef9b4eb52710db8.jpeg
2f9b95ac788efe3b74c8598518d91ae3b694f0bd.jpeg

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

Hello,

In IOSEngine.ini, I found the “DefaultPlatformService” entry. It was set to something like “MCP”. Don’t know it exactly anymore. :smiley:
But i couldn’t find the “DefaultPlatformService” in the DefaultEngine.ini.
Do I have to add it manually?

And then I have also a question about the Leaderboards.
In the Game Center section, I hade to create a group for the services.
And now every Leaderboard-ID is forced to have a “grp.” prefix.

My Leaderboards are already Live and called like this: “grp.normal_mode”.
The Type is also “Single”.

When I want to open a Leaderboard, nothing happens…

Thank you in advance :slight_smile:

Greetings
Wolfi

Update:

The change of “DefaultPlatformService=” from “MCP” to “IOS” was the crucial point.
Everything works now as expected. :slight_smile:

Thank you soo much!! :o:o

Greetings
Wolfi

glad it helped :smiley:

rOb

Hi insanerob,
Is it necessary to login to Game Center to read or make in app purchases? In Android it is not needed. Do IOS behave differently?

Amazing guide! As @w0lfi suggested, changing the DefaultPlatformService from MCP to IOS was the key!

Thank you for your tutorial!

I’m trying to do this for our app, but I have a development certificate and provision instead.

I added the “Show External Login” BP function and it runs when the app starts up (even tried a delay before it for safety).

When running the game using the project launcher, the result of running the function is always a failure.

Is there something I’m missing to tell my game to connect with Game Center?

Note: I’ve downloaded Unreal’s Match 3 and tied my provision/certificate to that app and it logs in successfully. However, I cannot find a difference between their and my logic.

Nevermind, it turns out I never checked the “Online Subsystem iOS” plugin in the Editor.

If you’re still updating this tutorial, I’d recommend adding this in. Though obvious, others may miss this like I did :).

Thank you for your tutorial again! Without it I’d probably miss setting up lots of other things. :stuck_out_tongue: