How to setup FaceBook and Leadboard
Last updated
Last updated
Download Facebook SDK
Import facebook-unity-sdk-xxx.unitypackage the file
Open downloaded package
Click Import
Create your app in Facebook developer account https://developers.facebook.com/apps/ Add a New App
Select Gaming app type and enter the app name
Select Settings->Basic and select category Games and Sub-category and Save changes
Now we got App ID. Lets put App ID and App name into Unity. Go to menu Facebook->Edit settings
Put your App ID and App name into setting in Inspector
Make sure you have no spaces!
Regenerate android manifest
Click Settings and + Add Platform
Select your platform. Note: This asset adjusted for mobile platforms, to use Facebook canvas you should make changes like landscape view and Facebook monetization.
For Android: Set your package name Set class name: com.facebook.unity.FBUnityDeepLinkingActivity Enable Single Sign On Enable Deep Linking
For iOS: For Bundle ID use Apple ID from the Appstore connect For iPhone and iPad store ID use your package name Enable Single Sign On Enable Deep Linking
Put Key Hashes from Unity Facebook Settings
Save changes
In Settings -> Advanced set is as Native app.
Make it public to make it works.
How to fill Privacy policy - GUIDE
Go to Dashboard, and setup the Facebook Login
Select a platform and go to the settings of the Facebook login
Keep it by default like this
Don’t forget to Save all Changes
Go to the Dashboard, find the App Center and click “Set up”
Fill the screenshots and the description of your game. This information will represent your game in Facebook.
Generate the key-hash for Android. More info
1. Open the game
2. Click Play
3. On the map click to the Facebook icon and login
4. Click on the level on the map to see leadboard of you and your friends if they pass a level
e) Upload the video, we prepared file for you Download video
f) Click Save
Then complete App Verification and Submit for Review.
Leadboard, friends and player cloud store setup
Next service provide leadboard, friends on map, player data cloud store, just choose one: how to setup PlayFab (Paid service)
The error on the device: “Invalid key hash”. Put the key hash from the error to your Facebook settings.
"Assets\GameSparks\GameSparksSettings.cs(6,16): error CS1029: #error: 'The GameSparks SDK only supports "Scripting Runtime Version.NET 3.5 Equivalent" and Api compatibility level 2.0'" - the error related to latest gamesparks To solve please import this package
Android building problem Try this Android Resolver
Keytool not found. How to fix
Release 7.12.1 has problem on iOS, recommend to use 7.12.0 instead
Don’t try to use fake accounts to test, use test spectial test account inside of the game
NullReferenceException: Object reference not set to an instance of an object; GameSparks.Platforms.PlatformBase.Start () (at Assets/GameSparks/Platforms/PlatformBase.cs:209) Gamesparks from 5.5.6 require to add GameSparksUnity component to the NetworkManager object in the map or game scene depending from the game
error CS1704: An assembly with the same name `Facebook.Unity.Settings' has already been imported. Solution: delete Facebook.Unity.Settings.dll file from <Your Project>/Library/FacebookSDK/ and restart Unity
IOS building error: FBSDKShareKit/FBSDKShareKit.h file not found Solution: Check path to facebook sdk plugin. Like this
Unity 5.5 and Facebook SDK not working well together in iOS Try to use latest Unity patch Unity 5.5 patches they should fix it someday. Or read this http://answers.unity3d.com/questions/1252223/unity-55-and-facebook-sdk-not-working-well-togethe.html
If you still can’t see the leaboard try to delete game from Gamesparks account and create in again from the Unity.
Open AndroidManifest file from Assets/Plugins/Android and add next line xmlns:tools="http://schemas.android.com/tools" there
Adding User friends permission. Before sending a requiest test Facebook login on the android device. In case of issues check the Troubleshooting For proper work of the leadboards you should have all these permissions 1)Go to the Permissions and features 2)Find the user_friends permission and press “Request” and “Continue” d) Fill the form and provide verification details In the “Tell us Fill the text area with the next text:
Main reason of the review rejection. Generate the key-hash If it doesn’t help try to: create test app in the Facebook account, use new Facebook ID in Unity, Launch the game on android device, Get the error about the wrong key hash Then put this new key hash into Facebook settings