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.
Name | Description |
---|---|
Initialize the SDK, this is required before doing anything else | |
Make an API call to the Graph API | |
Trigger a Share dialog for one-to-many sharing | |
Trigger the legacy Feed sharing dialog, only use if you need legacy parameters | |
Trigger a Game Request dialog for one-to-one sharing | |
Get the URL with which the app was invoked |
Name | Description |
---|---|
Prompt a user to authorize your app with requested read permissions, or to grant additional read permissions | |
Prompt a user to authorize your app with publish permissions, or to grant additional permissions | |
Log a user entirely out of Facebook |
Name | Description |
---|---|
Retrieves the login status of the user. |
Name | Description |
---|---|
The access token granted to your application by the current user | |
Check whether the SDK has been initialized | |
Check whether a user is currently logged in and has authorized your app | |
Check whether a user is currently logged in and has authorized your app |
Name | Description |
---|---|
Signal an app launch or resume, for integrating with App Ads and Facebook Analytics for Apps | |
Publish an App Event, for deeper integration with App Ads and Facebook Analytics for Apps | |
Convience method for publishing purchase events, for deeper integration with App Ads and Facebook Analytics for Apps |
Name | Description |
---|---|
Updates the current access token with up-to-date permissions, and extends the expiration date if possible | |
Open an App Invite dialog, giving users the ability to send their friends a personal invite to your app | |
Fetch deferred applink data from App Ads or invites | |
Set the preferred dialog type when using |
Name | Description |
---|---|
Prompt the user to make a payment using Facebook Payments |
Name | Description |
---|---|
Prompt user to create a new Game Group | |
Prompt user to join a Game Group |
Examples for the several common scenarios with the Facebook SDK for Unity
JSON is widely-used for data interchange; we can help you use it with Unity