Facebook account setup
This guide describes the Facebook and leaderboard setup for the current HomeDesignMatch3Kit project.
The original Candy Smith guide uses the spelling Leadboard and describes a legacy Gamesparks/PlayFab flow. The original Facebook sequence is preserved below, while project-specific notes explain the current Unity Gaming Services (UGS) setup.
Source guide: How to setup Facebook and Leadboard.
What is configured
Facebook Login through the Facebook Unity SDK.
Facebook as an identity provider in Unity Authentication.
A UGS leaderboard that stores the player's current level.
Cloud Code scripts for gifts and Facebook-to-Unity player mapping.
Optional Facebook friends access through the
user_friendspermission.
Prerequisites
Before starting, prepare the following:
A Meta developer account: Meta for Developers.
A Meta app registered for the game, or access to an existing Meta app for this game.
The Android package name and iOS Bundle ID from Unity Player Settings.
Access to the Unity organization and UGS project that will be used by the game.
A debug or release keystore and its Android key hash.
Test Facebook accounts. Do not use fake accounts; add real test users or app-role accounts in the Meta dashboard.
Link the Unity project
Open the project in Unity 6000.0.80f1 or a compatible Unity version.
Sign in to the Unity Editor.
Open
HomeDesignMatch3Kit > Settings > Setup Wizard.In step 1, open Project Services and link the project to the correct Unity organization and UGS project.
Select the environment used for development or release.
Create and configure the Meta app
Open the Meta Developer Dashboard, open My Apps, and click Create App.
Create the app
Enter the game name.
Select the use case Authenticate and request data from users with Facebook Login. The wording may be shortened to Authenticate and request data from users in the current dashboard.
At the Business step, select the business connected to the game or continue without connecting a business.
Finish creating the app and open its dashboard.



Basic app settings
Open App settings > Basic.
Set the Category, Sub-category, and App icon when those fields are shown.
Save the changes.
Copy the numeric App ID.
Copy the Client Token from the security section in Settings > Advanced.
Keep the App Secret private. It is required to configure Unity Authentication, but it must not be committed to the repository or stored in
LeaderboardSettings.asset.

Android platform
Add an Android platform to the Meta app:
Set the package name to the exact value from
Project Settings > Player > Android > Package Name.Set the Unity deep-linking activity class to
com.facebook.unity.FBUnityDeepLinkingActivityif the dashboard asks for it.Enable Single Sign On and Deep Linking when those options are available.
Add every key hash used to sign the app, including separate debug and release hashes.
Save the platform settings.



iOS platform
Add an iOS platform and set its Bundle ID to the exact value from Project Settings > Player > iOS > Bundle Identifier.
If the dashboard asks for an App Store ID or other store metadata, use the values belonging to the final iOS app. Save the platform settings.
Before publishing the app, provide a valid privacy policy URL and complete the app's required verification and review steps.

In Settings > Advanced, enable Native or desktop app when the option is available. Keep the app in development mode while testing; switch it to Live/public only after the required review and verification steps are complete.


Install and configure the Facebook SDK in Unity
The setup wizard can install the Facebook Unity SDK used by this project.
The original guide describes a manual SDK flow: download the Facebook Unity SDK package, open the .unitypackage, and click Import. Use that flow only if the setup wizard cannot install the SDK; do not import a second SDK copy.


Return to
HomeDesignMatch3Kit > Settings > Setup Wizard.Open step 4, Set up Facebook.
Click Install Facebook SDK if the SDK is not installed.
Enter the Meta App ID and Client Token in the Facebook SDK Settings section.
Enter the App Secret only in the password field used by Configure Facebook Automatically.
Click Configure Facebook Automatically.
Click Regenerate Android Manifest if the wizard did not regenerate it successfully.

The original guide also shows the App ID copied from Meta into the Unity Facebook settings:

The wizard synchronizes the App ID and Client Token with Assets/FacebookSDK/SDK/Resources/FacebookSettings.asset, configures iOS stripping, regenerates the Android manifest, and registers or updates the Facebook identity provider in Unity Authentication. The App Secret is used for the setup operation and is not saved in the project.

Configure the UGS leaderboard
In the setup wizard, open step 5, Configure the leaderboard.
Set the leaderboard ID. The default value is
global_leaderboard.Set
Score Fetch LimitandOpponent Countas required by the UI.Click Save Settings.
Click Configure Leaderboard.
The provisioner creates the leaderboard in the selected environment with descending sort order and Keep Best update behavior. Running the action again reuses an existing leaderboard with the same ID.
The settings asset is stored at:
The runtime submits the player's current level and reads scores through Unity Leaderboards. The current popup displays UGS leaderboard entries; it is not the legacy Gamesparks friend leaderboard.

Enable Cloud Save and upload Cloud Code
In the selected UGS environment, open Cloud Save and enable it.
Return to the setup wizard.
Open step 6, Upload and publish Cloud Code.
Click Upload Cloud Code.
The action creates or updates and publishes the included scripts for gifts and Facebook player mapping. The facebookPlayerMappings collection is created automatically after the first successful Facebook sign-in.
If the game uses Facebook friends, complete the separate user_friends permission setup before testing that flow.
Test the integration
Use a device build rather than relying only on the Unity Editor:
Build with the same Android package name or iOS Bundle ID configured in Meta.
Install the build on a test device.
Open the Settings popup and tap the Facebook button.
Complete Facebook Login with an allowed test account.
Open the leaderboard and finish at least one level so a score can be submitted.
Confirm that the login completes, the UGS player is authenticated, and the score appears in the selected leaderboard.
If friends functionality is enabled, test it with two Facebook accounts that both use the app.
The original guide also includes a video tutorial and Unity test. Use a device build and the navigation that exists in the submitted version of this project.
Legacy backend note
The source guide links to a paid PlayFab setup guide for its leaderboard, friends-on-map, and player-cloud-store flow. This project uses UGS instead, so the PlayFab/Gamesparks setup is not required for the current build.
Next steps
Request the
user_friendspermissionFacebook and leaderboard troubleshooting
Last updated
