LootLocker
The BasicsGame SystemsContent ManagementPlayer Management
LootLocker
  • 📌The Basics
    • Getting Started
    • What is LootLocker?
    • Core Concepts
      • Players
      • Assets
      • Character Classes
      • API Types
      • Web Console
      • Stage & Live Environments
      • Glossary
    • Unity Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • Unreal Quick Start
      • Install & Configure the SDK
        • Older versions
      • Authenticate Your First Player
    • Godot Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • SDKs
    • Samples
      • Authentication Samples
      • Leaderboard Samples
      • Progression Samples
      • Player Samples
    • Launching Your Game
    • Support
      • Error Codes
      • Unreal Marketplace Plugin Support
  • 🎭Players
    • Overview
    • Authentication
      • How To
        • Guest Login
        • Steam
        • Apple
        • Apple Game Center
        • Google
        • Epic Games
        • PlayStation
        • Meta / Oculus
        • Xbox
        • Nintendo Switch
    • Files
      • How To
        • Manage Files in Web Console
        • Work with Files In-Game
    • Inventory
      • How To
        • Work with Player Inventory
    • Messages
      • How To
        • Configure Messages in Web Console
    • Names
      • How To
        • Work with Player Names
    • Player Manager
      • How To
        • Manage Players through Web Console
        • Manage Players In-Game
        • Use Player Operations
    • Unified Player Accounts
      • How To
        • Configure UPA in Web Console
        • Use Remote Login In-Game
        • Connect Identiy Provider to Player
        • External Provider Linking
        • Transition from Guest Login to Other Provider
        • Disconnect Identity Provider from Player
    • White Label Login
      • How To
        • Configure White Label Login
        • Create a New White Label User
        • Request User Verification
        • Handle Returning Users
        • Start a White Label Session
  • 🪙Commerce
    • Overview
    • Catalogs
      • How To
        • Configure Catalogs in LootLocker Console
        • List all Catalogs
        • Use Catalogs In-Game
        • Setup In-Game Store
    • Currencies
      • How To
        • Configure a Currency in Web Console
        • Use Currencies In-Game
    • DLC Management
      • How To
        • Configure DLC in Web Console
        • Use DLC In-Game
    • Entitlements
      • How To
        • Work with Entitlements In-Game
    • Real Money Purchases
      • How To
        • Configure In-App Purchase in Web Console
        • Make Purchases through Google Play Store
        • Make Purchases through Apple Store
        • Make Purchases through Steam Store
    • Virtual Purchases
    • Wallets
      • How To
        • Manage a Wallet in Web Console
        • Use Wallets In-Game
  • ⚔️Content
    • Overview
    • Assets
      • How To
        • Create & Configure an Asset
        • Organize & Search for Assets
        • Retrieve Assets In-Game
        • Set up Asset Storage Template
        • Check Grant Notifications
        • Set up a Game Config Asset
        • Create a Loot Box
        • Work with Loot Boxes In-Game
        • Create a Drop Table
        • Work with Drop Tables In-Game
        • Create a Rental Asset
        • Work with Rental Assets In-Game
    • User Generated Content (UGC)
      • How To
        • Create UGC In-Game
    • Twitch Drops
  • 🕹️Game Systems
    • Overview
    • Classes & Heroes
      • How To
        • Base Classes
        • Hero Classes
        • Implement Classes In-Game
        • Implement Heroes In-Game
    • Leaderboards
      • How To
        • Configure Leaderboard in Web Console
        • Use Player Leaderboards
        • Use Generic Leaderboards
        • Use Metadata to Store Additional Information
        • Use Scheduled Reset with Rewards
        • Use Leaderboards for Time Based Rankings
      • Leaderboard FAQ
      • GameMaker References
    • Feedback
      • How To
        • Manage Feedback Categories
        • Create Player Feedback
        • Create UGC Feedback
        • Create Game Feedback
        • View and Manage Feedback
    • Progressions
      • How To
        • Create a Progression
        • Game Progressions
        • Player Progressions
        • Class Progressions
        • Asset Instance Progressions
    • Triggers
      • How To
        • Setup a trigger in the Web Console
        • Invoke trigger from game
  • ⛓️Shared Systems
    • Overview
    • Metadata
      • How To
        • Add Metadata in Console
        • Fetch a Single Metadata In-Game
        • Fetch Metadata In-Game by Tags
        • Fetch Metadata In-Game from Multiple Sources
    • Notifications
      • How To
        • List Notifications and Mark as Read In-Game
  • 🗝️Admin
    • Settings
    • User Settings
    • Organization Settings
    • CORS Allowlist
  • ⭕️ Legacy
    • Deprecations
      • Unity SDK Deprecation Log
        • Version 2.1.5 - Migration to Open UPM
        • Version 2.0.0
      • Unreal SDK Deprecation Log
        • Version 4.0.0
        • Version 3.0.0
    • Legacy Storage
    • Legacy Triggers
      • Activate a trigger
      • Create a trigger
    • Legacy Progressions
      • Create a Progression System
      • Use a Progression System In-Game
Powered by GitBook
On this page
  1. Players
  2. Authentication
  3. How To

Apple

PreviousSteamNextApple Game Center

Last updated 5 months ago

Apple 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

To start using Sign in with Apple we first need to configure our integration in the

Team ID

You can find your Apple Team ID by logging in to the Apple developer portal and going to the Membership page. On that page you should be able to see your Team ID.

Client ID

Client ID will in most cases be the bundle identifier for your App when you created it in Xcode or in the Apple developer portal.

Key ID & Certificate

After logging in to your Apple developer portal, navigate to the "Certificates, Identifiers & Profiles" page. From here you can create a new key.

When creating a key, make sure to enable "Sign in with Apple" and pressing the configure button. The "Primary App ID" should be the same as your game (bundle identifier)

When finished creating your key, make sure you download the certificate, which we will upload in the LootLocker Console.

The Key ID can be seen when clicking the key after creation in the Apple developer portal.

Start Session

// 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");
});

Input

Output

We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails and what (if any) continued actions you want on success. For subsequent calls to different LootLocker methods, you will want to create variables from the Player Id and Player Identifier outputs. In the session response when starting an Apple session you also get a refresh token that we will save under the hood. But if you want to use it manually, we provide it for you.

Beyond those three, there is a lot of interesting stuff in the session response, like current xp and level for example.

curl -X POST "https://api.lootlocker.io/game/session/apple" \
  -H "LL-Version: 2021-03-01" \
  -H "Content-Type: application/json" \
  -d "{\"game_key\": \"your_game_key\", \"apple_authorization_code\": \"eyJQa....\", \"game_version\": \"1.0.0.0\", \"session_id\": \"8438f4b3-90e4-4cdd-8434-c5c6b4c2c9f1\"}"

Example response:

{
  "success": true,
  "session_token": "e6fa44946f077dd9fe67311ab3f188c596df9969",
  "player_id": 3,
  "public_uid": "TSEYDXD8",
  "player_created_at": "2022-05-30T07:56:01+00:00",
  "check_grant_notifications": true,
  "check_deactivation_notifications": false,
  "seen_before": true,
  "refresh_token": "748b5ac8-794a-44e3-bb59-c59a2f397e84",
  "player_identifier": "76561198023004363"
}

Refresh Session

With Apple authentication, you can refresh the session instead of having the player do a full sign-in every time. The request will return a 401 (Unauthorized) if the refresh token has expired, in which case you will need to start a new session.

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");
});

Input

Output

We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails and what (if any) continued actions you want on success. For subsequent calls to different LootLocker methods, you will want to create variables from the Player Id and Player Identifier outputs. In the session response when starting an Apple session you also get a refresh token that we will save under the hood. But if you want to use it manually, we provide it for you.

Beyond those three, there is a lot of interesting stuff in the session response, like current xp and level for example.

curl -X POST "https://api.lootlocker.io/game/session/apple" \
  -H "LL-Version: 2021-03-01" \
  -H "Content-Type: application/json" \
  -d "{\"game_key\": \"your_game_key\", \"refresh_token\": \"748b....\", \"player_identifier\": \"765..\", \"game_version\": \"1.0.0.0\", \"session_id\": \"8438f4b3-90e4-4cdd-8434-c5c6b4c2c9f1\"}"

Example response:

{
  "success": true,
  "session_token": "e6fa44946f077dd9fe67311ab3f188c596df9969",
  "player_id": 3,
  "public_uid": "TSEYDXD8",
  "player_created_at": "2022-05-30T07:56:01+00:00",
  "check_grant_notifications": true,
  "check_deactivation_notifications": false,
  "seen_before": true,
  "refresh_token": "748b5ac8-794a-44e3-bb59-c59a2f397e84",
  "player_identifier": "76561198023004363"
}

You need to acquire an to be able to start an apple session, but once you have that, simply follow along to the code snippet below. In the response from LootLocker you will find a refresh token. We will store this and use it to refresh the session during the lifetime of the refresh token so that you do not need to do the full sign-in flow each time.

To copy and paste the above example into your editor, .

You need to exchange the TriggerAppleStartSession event for whatever event you want to use to trigger the login flow. Remove the node REPLACE: Apple Auth Code and replace it with your preferred method of getting the.

To copy and paste the above example into your editor, .

You need to exchange the TriggerAppleRefreshSession event for whatever event you want to use to trigger the login flow. The node Refresh Token is the one you saved , but it is optional as we save it behind the scenes as well.

Congratulations - you have now started using LootLocker in your game with Apple Game Center! Next up we suggest you look at our and decide which ones you want to use in your game.

🎭
Apple authorization code
look here
Apple Authentication Code
look here
when starting a session
platform settings
feature set,
Blueprint example of starting a game session with Apple - https://blueprintue.com/blueprint/f3r3owbk/
Blueprint example of refreshing a game session with Apple - https://blueprintue.com/blueprint/djpexw1a/
Blueprint example of starting a game session with Google
Blueprint example of refreshing a game session with Apple