For the complete documentation index, see llms.txt. This page is also available as Markdown.

Apple Game Center

Apple Game Center platform needs to be enabled and configured in the Web Console before it can be used in your game. This also requires you to have a developer account with Apple.

Configuration

First start by installing the GameKit Unity Plugin found in the Apple Unity Repository.

Then in the Unity Editor menu, go to Edit > Project Settings…, then select Services > Authentication from the navigation menu.

Set ID Providers to Apple Game Center, then select Add.

Enter the Bundle ID from the Apple developer console in the Bundle ID text field, then select Save. The Bundle ID should look like this: "com.lootlocker.hector".

Please see Unreal's guide on how to configure your project to gain access to the necessary calls to use Apple Game Center Authentication.

Start Session

We do store the Refresh Token for the next time the player starts your game. This Token can be used to Refresh a Session which uses a simpler flow.

string bundleId;
string signature;
string playerId;
string salt;
string publicKeyUrl;
string timestamp;

LootLockerSDKManager.StartAppleGameCenterSession(bundleId, playerId, publicKeyUrl, signature, salt, timestamp, (response) => 
{

    if (!response.success)
    {
        Debug.Log("error starting LootLocker session");

        return;
     }

     Debug.Log("successfully started LootLocker session");

});

Example response:

Refresh Session

Refreshing a Session can be done in order to start the session without going through the entire StartAppleGameCenterSession() flow, if your session token is still valid.

Last updated

Was this helpful?