Skip to content

Apple

This how-to walks you through configuring Sign in with Apple and starting an Apple session from your game.

Prerequisites

  • Unity, Unreal, or Godot SDK installed and configured in your project (not required for REST).
  • An Apple developer account with access to the Apple Developer Portal.

Configuration

Configure your integration in the platform settings.

Apple Sign In platform settings in the Web Console

Team ID: log in to the Apple Developer Portal and go to the Membership page to find your Team ID.

Client ID: in most cases this is the bundle identifier for your app, set when you created it in Xcode or the Apple Developer Portal.

Key ID & Certificate: in the Apple Developer Portal, go to Certificates, Identifiers & Profiles and create a new key. Enable "Sign in with Apple" on the key and set the Primary App ID to your game's bundle identifier. Download the certificate when finished — you'll upload it to the LootLocker Console. The Key ID is visible when you click the key after creation.

Start Session

Acquire an Apple authorization code, then use it to start a session. The response includes a refresh token, which LootLocker stores so you don't need to repeat the full sign-in flow each time.

// authCode can be retrieved from appleIDCredential.authorizationCode
string authCode = "put authorizationCode here";
LootLockerSDKManager.StartAppleSession(authCode, (response) =>
{
if (!response.success)
{
Debug.Log("error starting LootLocker session");
return;
}
Debug.Log("session started successfully");
});

Refresh Session

Refresh the session instead of having the player go through the full sign-in flow every time. The request returns a 401 (Unauthorized) if the refresh token has expired, in which case start a new session instead.

LootLockerSDKManager.RefreshAppleSession((response) =>
{
if (!response.success)
{
if (response.statusCode == 401) {
// Refresh token has expired, use StartAppleSession
}
else {
Debug.Log("error starting LootLocker session");
}
return;
}
Debug.Log("session started successfully");
});

Conclusion

You've started using LootLocker in your game with Sign in with Apple. Next, review LootLocker's full feature set to decide which other features to implement.