Skip to content

Facebook SDK for Unity Reference

Updated: Apr 17, 2026

This document provides the API details for the Facebook SDK for Unity.

The architecture follows, as much as possible within the constraints of the supported platforms, the design of the Javascript SDK. All functions implementing I/O operations are asynchronous and take a delegate as an argument which will be called with their output once it is ready.

Most data exchanged over the network is marshalled as strings containing JSON, and a utility class, Json, is provided to help manage that data within Unity.

Note: The Facebook SDK for Unity works with Unity 5.0 and above.

Core Methods

NameDescription
FB.InitInitialize the SDK, this is required before doing anything else
FB.APIMake an API call to the Graph API
FB.ShareLinkTrigger a Share dialog for one-to-many sharing
FB.FeedShareTrigger the legacy Feed sharing dialog, only use if you need legacy parameters
FB.AppRequestTrigger a Game Request dialog for one-to-one sharing
FB.GetAppLinkGet the URL with which the app was invoked

Facebook Login

NameDescription
FB.LogInWithReadPermissionsPrompt a user to authorize your app with requested read permissions, or to grant additional read permissions
FB.LogInWithPublishPermissionsPrompt a user to authorize your app with publish permissions, or to grant additional permissions
FB.LogOutLog a user entirely out of Facebook

Express Login

NameDescription
FB.Android.RetrieveLoginStatusRetrieves the login status of the user.

Session Properties

NameDescription
AccessTokenThe access token granted to your application by the current user
FB.IsInitializedCheck whether the SDK has been initialized
FB.IsLoggedInCheck whether a user is currently logged in and has authorized your app
FB.GraphApiVersionCheck whether a user is currently logged in and has authorized your app

App Events

NameDescription
FB.ActivateAppSignal an app launch or resume, for integrating with App Ads and Facebook Analytics for Apps
FB.LogAppEventPublish an App Event, for deeper integration with App Ads and Facebook Analytics for Apps
FB.LogPurchaseConvience method for publishing purchase events, for deeper integration with App Ads and Facebook Analytics for Apps

Mobile-only

NameDescription
FB.Mobile.RefreshCurrentAccessTokenUpdates the current access token with up-to-date permissions, and extends the expiration date if possible
FB.Mobile.AppInviteOpen an App Invite dialog, giving users the ability to send their friends a personal invite to your app
FB.Mobile.FetchDeferredAppLinkDataFetch deferred applink data from App Ads or invites
FB.Mobile.ShareDialogModeSet the preferred dialog type when using FB.ShareLink

Canvas-only Methods

NameDescription
FB.Canvas.PayPrompt the user to make a payment using Facebook Payments

Auxiliary Methods

NameDescription
FB.GameGroupCreatePrompt user to create a new Game Group
FB.GameGroupJoinPrompt user to join a Game Group

Other References

SDK Examples

Examples for the several common scenarios with the Facebook SDK for Unity

Using JSON with Unity

JSON is widely-used for data interchange; we can help you use it with Unity

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About