Skip to content

Latest commit

 

History

History
2853 lines (1840 loc) · 128 KB

APIReference.md

File metadata and controls

2853 lines (1840 loc) · 128 KB

Copyright (c) Meta Platforms, Inc. and affiliates.

Facebook.Unity

Contents

AccessToken type

Namespace

Facebook.Unity

Summary

Contains the access token and related information.

#ctor(tokenString,userId,expirationTime,permissions,lastRefresh) constructor

Summary

Initializes a new instance of the AccessToken class.

Parameters
Name Type Description
tokenString System.String Token string of the token.
userId System.String User identifier of the token.
expirationTime System.DateTime Expiration time of the token.
permissions System.Collections.Generic.IEnumerable{System.String} Permissions of the token.
lastRefresh System.Nullable{System.DateTime} Last Refresh time of token.

CurrentAccessToken property

Summary

Gets the current access token.

ExpirationTime property

Summary

Gets the expiration time.

GraphDomain property

Summary

Gets the domain this access token is valid for.

LastRefresh property

Summary

Gets the last refresh.

Permissions property

Summary

Gets the list of permissions.

TokenString property

Summary

Gets the token string.

UserId property

Summary

Gets the user identifier.

ToString() method

Summary

Returns a String that represents the current AccessToken.

Returns

A String that represents the current AccessToken.

Parameters

This method has no parameters.

Android type

Namespace

Facebook.Unity.FB

Summary

Contains code specific to the Android Platform.

KeyHash property

Summary

Gets the key hash.

RetrieveLoginStatus(callback) method

Summary

Retrieves the login status for the user. This will return an access token for the app if a user is logged into the Facebook for Android app on the same device and that user had previously logged into the app.If an access token was retrieved then a toast will be shown telling the user that they have been logged in.

Parameters
Name Type Description
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.ILoginStatusResult} The callback to be called when the request completes

AppEventName type

Namespace

Facebook.Unity

Summary

Contains the names used for standard App Events.

AchievedLevel constants

Summary

App Event for achieved level.

ActivatedApp constants

Summary

App Event for activated app.

AddedPaymentInfo constants

Summary

App Event for added payment info.

AddedToCart constants

Summary

App Event for added to cart.

AddedToWishlist constants

Summary

App Event for added to wishlist.

CompletedRegistration constants

Summary

App Event for completed registration.

CompletedTutorial constants

Summary

App Event for completed tutorial.

InitiatedCheckout constants

Summary

App Event for initiated checkout.

Purchased constants

Summary

App Event for purchased.

Rated constants

Summary

App Event for rated.

Searched constants

Summary

App Event for searched.

SpentCredits constants

Summary

App Event for spent credits.

UnlockedAchievement constants

Summary

App Event for unlocked achievement.

ViewedContent constants

Summary

App Event for content of the viewed.

AppEventParameterName type

Namespace

Facebook.Unity

Summary

Contains the parameter names used for standard App Events.

ContentID constants

Summary

App Event parameter for content ID.

ContentType constants

Summary

App Event parameter for type of the content.

Currency constants

Summary

App Event parameter for currency.

Description constants

Summary

App Event parameter for description.

Level constants

Summary

App Event parameter for level.

MaxRatingValue constants

Summary

App Event parameter for max rating value.

NumItems constants

Summary

App Event parameter for number items.

PaymentInfoAvailable constants

Summary

App Event parameter for payment info available.

RegistrationMethod constants

Summary

App Event parameter for registration method.

SearchString constants

Summary

App Event parameter for search string.

Success constants

Summary

App Event parameter for success.

AuthenticationToken type

Namespace

Facebook.Unity

#ctor(tokenString,nonce) constructor

Summary

Initializes a new instance of the AuthenticationToken class.

Parameters
Name Type Description
tokenString System.String Token string of the token.
nonce System.String Nonce of the token.

Nonce property

Summary

Gets the nonce string.

TokenString property

Summary

Gets the token string.

ToString() method

Summary

Returns a String that represents the current AuthenticationToken.

Returns

A String that represents the current AuthenticationToken.

Parameters

This method has no parameters.

Canvas type

Namespace

Facebook.Unity.FB

Summary

Contains methods specific to the Facebook Games Canvas platform.

Pay(product,action,quantity,quantityMin,quantityMax,requestId,pricepointId,testCurrency,callback) method

Summary

Pay the specified product, action, quantity, quantityMin, quantityMax, requestId, pricepointId, testCurrency and callback.

Parameters
Name Type Description
product System.String The URL of your og:product object that the user is looking to purchase.
action System.String Should always be purchaseitem.
quantity System.Int32 The amount of this item the user is looking to purchase - typically used when implementing a virtual currency purchase.
quantityMin System.Nullable{System.Int32} The minimum quantity of the item the user is able to purchase.
This parameter is important when handling price jumping to maximize the efficiency of the transaction.
quantityMax System.Nullable{System.Int32} The maximum quantity of the item the user is able to purchase.
This parameter is important when handling price jumping to maximize the efficiency of the transaction.
requestId System.String The developer defined unique identifier for this transaction, which becomes
attached to the payment within the Graph API.
pricepointId System.String Used to shortcut a mobile payer directly to the
mobile purchase flow at a given price point.
testCurrency System.String This parameter can be used during debugging and testing your implementation to force the dialog to
use a specific currency rather than the current user's preferred currency. This allows you to
rapidly prototype your payment experience for different currencies without having to repeatedly
change your personal currency preference settings. This parameter is only available for admins,
developers and testers associated with the app, in order to minimize the security risk of a
malicious JavaScript injection. Provide the 3 letter currency code of the intended forced currency.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IPayResult} The callback to use upon completion.

PayWithProductId(productId,action,quantity,quantityMin,quantityMax,requestId,pricepointId,testCurrency,callback) method

Summary

Pay the specified productId, action, quantity, quantityMin, quantityMax, requestId, pricepointId, testCurrency and callback.

Parameters
Name Type Description
productId System.String The product Id referencing the product managed by Facebook.
action System.String Should always be purchaseiap.
quantity System.Int32 The amount of this item the user is looking to purchase - typically used when implementing a virtual currency purchase.
quantityMin System.Nullable{System.Int32} The minimum quantity of the item the user is able to purchase.
This parameter is important when handling price jumping to maximize the efficiency of the transaction.
quantityMax System.Nullable{System.Int32} The maximum quantity of the item the user is able to purchase.
This parameter is important when handling price jumping to maximize the efficiency of the transaction.
requestId System.String The developer defined unique identifier for this transaction, which becomes
attached to the payment within the Graph API.
pricepointId System.String Used to shortcut a mobile payer directly to the
mobile purchase flow at a given price point.
testCurrency System.String This parameter can be used during debugging and testing your implementation to force the dialog to
use a specific currency rather than the current user's preferred currency. This allows you to
rapidly prototype your payment experience for different currencies without having to repeatedly
change your personal currency preference settings. This parameter is only available for admins,
developers and testers associated with the app, in order to minimize the security risk of a
malicious JavaScript injection. Provide the 3 letter currency code of the intended forced currency.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IPayResult} The callback to use upon completion.

PayWithProductId(productId,action,developerPayload,testCurrency,callback) method

Summary

Pay the specified productId, action, developerPayload, testCurrency and callback.

Parameters
Name Type Description
productId System.String The product Id referencing the product managed by Facebook.
action System.String Should always be purchaseiap.
developerPayload System.String A string that can be used to provide supplemental information about an order. It can be
used to uniquely identify the purchase request.
testCurrency System.String This parameter can be used during debugging and testing your implementation to force the dialog to
use a specific currency rather than the current user's preferred currency. This allows you to
rapidly prototype your payment experience for different currencies without having to repeatedly
change your personal currency preference settings. This parameter is only available for admins,
developers and testers associated with the app, in order to minimize the security risk of a
malicious JavaScript injection. Provide the 3 letter currency code of the intended forced currency.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IPayResult} The callback to use upon completion.

ComponentFactory type

Namespace

Facebook.Unity

AddComponent``1() method

Parameters

This method has no parameters.

GetComponent``1() method

Parameters

This method has no parameters.

Constants type

Namespace

Facebook.Unity

GraphUrl property

Summary

Gets the graph URL.

UnitySDKUserAgent property

Summary

Gets the Unity SDK user agent.

UnitySDKUserAgentSuffixLegacy property

Summary

Gets the legacy user agent suffix that gets appended to graph requests on ios and android.

CurrencyAmount type

Namespace

Facebook.Unity

Summary

Contains an amount and currency associated with a purchase or transaction.

#ctor(amount,currency) constructor

Summary

Initializes a new instance of the CurrencyAmount class.

Parameters
Name Type Description
amount System.String The associated amount.
currency System.String The associated currency.

Amount property

Summary

Gets the amount, eg "0.99".

Currency property

Summary

Gets the currency, represented by the ISO currency code, eg "USD".

ToString() method

Summary

Returns a String that represents a CurrencyAmount.

Returns

A String that represents a CurrencyAmount.

Parameters

This method has no parameters.

CustomUpdateContent type

Namespace

Facebook.Unity

Summary

Static class to hold Custom Update Content for FBGamingServices.PerformCustomUpdate.

CustomUpdateContentBuilder type

Namespace

Facebook.Unity.CustomUpdateContent

#ctor(contextTokenId,text,image) constructor

Summary

Creates a CustomUpdateContent Builder

Parameters
Name Type Description
contextTokenId System.String A valid GamingContext to send the update to
text Facebook.Unity.CustomUpdateLocalizedText The text that will be included in the update
image UnityEngine.Texture2D An image that will be included in the update

#ctor(contextTokenId,text,media) constructor

Summary

Creates a CustomUpdateContent Builder

Parameters
Name Type Description
contextTokenId System.String A valid GamingContext to send the update to
text Facebook.Unity.CustomUpdateLocalizedText The text that will be included in the update
media Facebook.Unity.CustomUpdateMedia A gif or video that will be included in the update

build() method

Summary

Returns a CustomUpdateContent with the values defined in this builder

Returns

CustomUpdateContent instance to pass to FBGamingServices.PerformCustomUpdate()

Parameters

This method has no parameters.

setCTA(cta) method

Summary

Sets the CTA (Call to Action) text in the update message

Parameters
Name Type Description
cta Facebook.Unity.CustomUpdateLocalizedText Custom CTA to use. If none is provided a localized version of 'play' is used.

setData(data) method

Summary

Sets a Data that will be sent back to the game when a user clicks on the message. When the game is launched from a Custom Update message the data here will be forwarded as a Payload.

Parameters
Name Type Description
data System.String A String that will be sent back to the game

CustomUpdateLocalizedText type

Namespace

Facebook.Unity

Summary

Represents a text string that can have different Locale values provided.

#ctor(defaultText,localizations) constructor

Summary

Creates a CustomUpdateLocalizedText instance

Parameters
Name Type Description
defaultText System.String Text that will be used if no matching locale is found
localizations System.Collections.Generic.IDictionary{System.String,System.String} Optional key-value Dictionary of Locale_Code: Locale String Value for this text.
For a list of valid locale codes see:
https://lookaside.facebook.com/developers/resources/?id=FacebookLocales.xml

CustomUpdateMedia type

Namespace

Facebook.Unity

Summary

Represents a media that will be included in a Custom Update Message

#ctor(gif,video) constructor

Summary

Creates a CustomUpdateMedia instance. Note that gif and video are mutually exclusive

Parameters
Name Type Description
gif Facebook.Unity.CustomUpdateMediaInfo Gif that will be included in the Update Message
video Facebook.Unity.CustomUpdateMediaInfo Video that will be included in the Update Message. Currently this is not yet
supported but will be in a server side update so it is already included in the SDK. This
disclaimer will be removed as soon as it is.

CustomUpdateMediaInfo type

Namespace

Facebook.Unity

Summary

Stores Information about a Media that will be part of a Custom Update

FB type

Namespace

Facebook.Unity

Summary

Static class for exposing the facebook integration.

AppId property

Summary

Gets the app identifier. AppId might be different from FBSettings.AppId if using the programmatic version of FB.Init().

ClientToken property

Summary

Gets the app client token. ClientToken might be different from FBSettings.ClientToken if using the programmatic version of FB.Init().

GraphApiVersion property

Summary

Gets or sets the graph API version. The Unity sdk is by default pegged to the lastest version of the graph api at the time of the SDKs release. To override this value to use a different version set this value.

IsInitialized property

Summary

Gets a value indicating whether is the SDK is initialized.

IsLoggedIn property

Summary

Gets a value indicating whether a user logged in.

LimitAppEventUsage property

Summary

Gets or sets a value indicating whether this FB limit app event usage. If the player has set the limitEventUsage flag to YES, your app will continue to send this data to Facebook, but Facebook will not use the data to serve targeted ads. Facebook may continue to use the information for other purposes, including frequency capping, conversion events, estimating the number of unique users, security and fraud detection, and debugging.

API(query,method,callback,formData) method

Summary

Makes a call to the Facebook Graph API.

Parameters
Name Type Description
query System.String The Graph API endpoint to call.
You may prefix this with a version string to call a particular version of the API.
method Facebook.Unity.HttpMethod The HTTP method to use in the call.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IGraphResult} The callback to use upon completion.
formData System.Collections.Generic.IDictionary{System.String,System.String} The key/value pairs to be passed to the endpoint as arguments.

API(query,method,callback,formData) method

Summary

Makes a call to the Facebook Graph API.

Parameters
Name Type Description
query System.String The Graph API endpoint to call.
You may prefix this with a version string to call a particular version of the API.
method Facebook.Unity.HttpMethod The HTTP method to use in the call.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IGraphResult} The callback to use upon completion.
formData UnityEngine.WWWForm Form data for the request.

ActivateApp() method

Summary

Sends an app activation event to Facebook when your app is activated.

On iOS and Android, this event is logged automatically if you turn on AutoLogAppEventsEnabled flag. You may still need to call this event if you are running on web.

On iOS the activate event is fired when the app becomes active On Android the activate event is fired during FB.Init

Parameters

This method has no parameters.

AppRequest(message,actionType,objectId,to,data,title,callback) method

Summary

Apps the request.

Parameters
Name Type Description
message System.String The request string the recipient will see, maximum length 60 characters.
actionType Facebook.Unity.OGActionType Request action type for structured request.
objectId System.String Open Graph object ID for structured request.
Note the type of object should belong to this app.
to System.Collections.Generic.IEnumerable{System.String} A list of Facebook IDs to which to send the request.
data System.String Additional data stored with the request on Facebook,
and handed back to the app when it reads the request back out.
Maximum length 255 characters.
title System.String The title for the platform multi-friend selector dialog. Max length 50 characters..
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IAppRequestResult} A callback for when the request completes.

AppRequest(message,actionType,objectId,filters,excludeIds,maxRecipients,data,title,callback) method

Summary

Apps the request.

Parameters
Name Type Description
message System.String The request string the recipient will see, maximum length 60 characters.
actionType Facebook.Unity.OGActionType Request action type for structured request.
objectId System.String Open Graph object ID for structured request.
Note the type of object should belong to this app.
filters System.Collections.Generic.IEnumerable{System.Object} The configuration of the platform multi-friend selector.
It should be a List of filter strings.
excludeIds System.Collections.Generic.IEnumerable{System.String} A list of Facebook IDs to exclude from the platform multi-friend selector dialog.
This list is currently not supported for mobile devices.
maxRecipients System.Nullable{System.Int32} Platform-dependent The maximum number of recipients the sender should be able to
choose in the platform multi-friend selector dialog.
Only guaranteed to work in Unity Web Player app.
data System.String Additional data stored with the request on Facebook, and handed
back to the app when it reads the request back out.
Maximum length 255 characters.
title System.String The title for the platform multi-friend selector dialog. Max length 50 characters.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IAppRequestResult} A callback for when the request completes.

AppRequest(message,to,filters,excludeIds,maxRecipients,data,title,callback) method

Summary

Apps the request.

Parameters
Name Type Description
message System.String The request string the recipient will see, maximum length 60 characters.
to System.Collections.Generic.IEnumerable{System.String} A list of Facebook IDs to which to send the request.
filters System.Collections.Generic.IEnumerable{System.Object} The configuration of the platform multi-friend selector.
It should be a List of filter strings.
excludeIds System.Collections.Generic.IEnumerable{System.String} A list of Facebook IDs to exclude from the platform multi-friend selector dialog.
This list is currently not supported for mobile devices.
maxRecipients System.Nullable{System.Int32} Platform-dependent The maximum number of recipients the sender should be able to
choose in the platform multi-friend selector dialog.
Only guaranteed to work in Unity Web Player app.
data System.String Additional data stored with the request on Facebook, and handed
back to the app when it reads the request back out.
Maximum length 255 characters.
title System.String The title for the platform multi-friend selector dialog. Max length 50 characters.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IAppRequestResult} A callback for when the request completes.

ClearAppLink() method

Summary

Clear app link.

Clear app link when app link has been handled, only works for Android, this function will do nothing in other platforms.

Parameters

This method has no parameters.

FeedShare(toId,link,linkName,linkCaption,linkDescription,picture,mediaSource,callback) method

Summary

Legacy feed share. Only use this dialog if you need the legacy parameters otherwiese use [](#!-FB-ShareLink-System-String, System-String, System-String, System-String, Facebook-FacebookDelegate- 'FB.ShareLink(System.String, System.String, System.String, System.String, Facebook.FacebookDelegate)').

Parameters
Name Type Description
toId System.String The ID of the profile that this story will be published to.
If this is unspecified, it defaults to the value of from.
The ID must be a friend who also uses your app. |

| link | System.Uri | The link attached to this post. | | linkName | System.String | The name of the link attachment. | | linkCaption | System.String | The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link. | | linkDescription | System.String | The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page. | | picture | System.Uri | The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on sharing best practices for more information on sizes. | | mediaSource | System.String | The URL of a media file (either SWF or MP3) attached to this post. If SWF, you must also specify picture to provide a thumbnail for the video. | | callback | Facebook.Unity.FacebookDelegate{Facebook.Unity.IShareResult} | The callback to use upon completion. |

GetAppLink(callback) method

Summary

Gets the deep link if available.

Parameters
Name Type Description
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IAppLinkResult} The callback to use upon completion.

Init(onInitComplete,onHideUnity,authResponse) method

Summary

This is the preferred way to call FB.Init(). It will take the facebook app id specified in your "Facebook" => "Edit Settings" menu when it is called.

Parameters
Name Type Description
onInitComplete Facebook.Unity.InitDelegate Delegate is called when FB.Init() finished initializing everything. By passing in a delegate you can find
out when you can safely call the other methods.
onHideUnity Facebook.Unity.HideUnityDelegate A delegate to invoke when unity is hidden.
authResponse System.String Auth response.

Init(appId,clientToken,cookie,logging,status,xfbml,frictionlessRequests,authResponse,javascriptSDKLocale,onHideUnity,onInitComplete) method

Summary

If you need a more programmatic way to set the facebook app id and other setting call this function. Useful for a build pipeline that requires no human input.

Parameters
Name Type Description
appId System.String App identifier.
clientToken System.String App client token.
cookie System.Boolean If set to true cookie.
logging System.Boolean If set to true logging.
status System.Boolean If set to true status.
xfbml System.Boolean If set to true xfbml.
frictionlessRequests System.Boolean If set to true frictionless requests.
authResponse System.String Auth response.
javascriptSDKLocale System.String The locale of the js sdk used see
https://developers.facebook.com/docs/internationalization#plugins.
onHideUnity Facebook.Unity.HideUnityDelegate A delegate to invoke when unity is hidden.
onInitComplete Facebook.Unity.InitDelegate Delegate is called when FB.Init() finished initializing everything. By passing in a delegate you can find
out when you can safely call the other methods.

LogAppEvent(logEvent,valueToSum,parameters) method

Summary

Logs an app event.

Parameters
Name Type Description
logEvent System.String The name of the event to log.
valueToSum System.Nullable{System.Single} A number representing some value to be summed when reported.
parameters System.Collections.Generic.Dictionary{System.String,System.Object} Any parameters needed to describe the event.

LogInWithPublishPermissions(permissions,callback) method

Summary

Logs the user in with the requested publish permissions.

Parameters
Name Type Description
permissions System.Collections.Generic.IEnumerable{System.String} A list of requested permissions.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.ILoginResult} Callback to be called when request completes.
Exceptions
Name Description
System.NotSupportedException Thrown when called on a TV device.

LogInWithReadPermissions(permissions,callback) method

Summary

Logs the user in with the requested read permissions.

Parameters
Name Type Description
permissions System.Collections.Generic.IEnumerable{System.String} A list of requested permissions.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.ILoginResult} Callback to be called when request completes.
Exceptions
Name Description
System.NotSupportedException Thrown when called on a TV device.

LogOut() method

Summary

Logs out the current user.

Parameters

This method has no parameters.

LogPurchase(logPurchase,currency,parameters) method

Summary

Logs the purchase.

Parameters
Name Type Description
logPurchase System.Decimal The amount of currency the user spent.
currency System.String The 3-letter ISO currency code.
parameters System.Collections.Generic.Dictionary{System.String,System.Object} Any parameters needed to describe the event.
Elements included in this dictionary can't be null.

LogPurchase(logPurchase,currency,parameters) method

Summary

Logs the purchase.

Parameters
Name Type Description
logPurchase System.Single The amount of currency the user spent.
currency System.String The 3-letter ISO currency code.
parameters System.Collections.Generic.Dictionary{System.String,System.Object} Any parameters needed to describe the event.
Elements included in this dictionary can't be null.

ShareLink(contentURL,contentTitle,contentDescription,photoURL,callback) method

Summary

Opens a share dialog for sharing a link.

Parameters
Name Type Description
contentURL System.Uri The URL or the link to share.
contentTitle System.String The title to display for this link..
contentDescription System.String The description of the link. If not specified, this field is automatically populated by
information scraped from the link, typically the title of the page.
photoURL System.Uri The URL of a picture to attach to this content.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IShareResult} A callback for when the request completes.

FBGamingServices type

Namespace

Facebook.Unity

Summary

Static class for exposing the Facebook GamingServices Integration.

OpenFriendFinderDialog(callback) method

Summary

Opens the Friend Finder Dialog

Parameters
Name Type Description
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IGamingServicesFriendFinderResult} A callback for when the Dialog is closed.

PerformCustomUpdate(content,callback) method

Summary

Informs facebook that the player has taken an action and will notify other players in the same GamingContext

Parameters
Name Type Description
content Facebook.Unity.CustomUpdateContent Please check CustomUpdateContent.Builder for details on all the fields that
allow customizing the update.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IGraphResult} The callback to use upon completion.

UploadImageToMediaLibrary(caption,imageUri,shouldLaunchMediaDialog,callback) method

Summary

Uploads an Image to the player's Gaming Media Library

Parameters
Name Type Description
caption System.String Title for this image in the Media Library
imageUri System.Uri Path to the image file in the local filesystem. On Android
this can also be a content:// URI
shouldLaunchMediaDialog System.Boolean If we should open the Media Dialog to allow
the player to Share this image right away.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IMediaUploadResult} A callback for when the image upload is complete.

UploadVideoToMediaLibrary(caption,videoUri,callback) method

Summary

Uploads a video to the player's Gaming Media Library

Parameters
Name Type Description
caption System.String Title for this video in the Media Library
videoUri System.Uri Path to the video file in the local filesystem. On Android
this can also be a content:// URI
callback System.Boolean A callback for when the video upload is complete.
Remarks

Note that when the callback is fired, the video will still need to be encoded before it is available in the Media Library.

FBInsightsFlushBehavior type

Namespace

Facebook.Unity.Mobile.IOS.IOSFacebook

FBInsightsFlushBehaviorAuto constants

Summary

The FB insights flush behavior auto.

FBInsightsFlushBehaviorExplicitOnly constants

Summary

The FB insights flush behavior explicit only.

FBLocation type

Namespace

Facebook.Unity

ID property

Summary

Gets the location's unique identifier

Name property

Summary

Gets the location's name.

ToString() method

Summary

Returns a String that represents the current FBLocation.

Returns

A String that represents the current FBLocation.

Parameters

This method has no parameters.

FacebookDelegate`1 type

Namespace

Facebook.Unity

Summary

Facebook delegate.

Parameters
Name Type Description
result T:Facebook.Unity.FacebookDelegate`1 The result.
Generic Types
Name Description
T The result type.

FacebookSdkVersion type

Namespace

Facebook.Unity

Summary

Facebook sdk version.

Build property

Summary

Gets the SDK build version.

FriendFinderInviation type

Namespace

Facebook.Unity

Summary

Contains a Inviation from Friend Finder.

HideUnityDelegate type

Namespace

Facebook.Unity

Summary

Hide unity delegate.

Parameters
Name Type Description
isUnityShown T:Facebook.Unity.HideUnityDelegate When called with its sole argument set to false,
your game should pause and prepare to lose focus. If it's called with its
argument set to true, your game should prepare to regain focus and resume
play. Your game should check whether it is in fullscreen mode when it resumes,
and offer the player a chance to go to fullscreen mode if appropriate.

HttpMethod type

Namespace

Facebook.Unity

Summary

Http method.

DELETE constants

Summary

Indicates that the request is a DELETE request.

GET constants

Summary

Indicates that the request is a GET request.

POST constants

Summary

Indicates that the request is a POST request.

IAccessTokenRefreshResult type

Namespace

Facebook.Unity

Summary

The access token refresh result.

AccessToken property

Summary

Gets the refreshed access token.

IAppLinkResult type

Namespace

Facebook.Unity

Summary

A result containing an app link.

Extras property

Summary

Gets the extras.

Ref property

Summary

Gets the ref.

TargetUrl property

Summary

Gets the target URI.

Url property

Summary

Gets the URL. This is the url that was used to open the app on iOS or on Android the intent's data string. When handling deffered app links on Android this may not be available.

IAppRequestResult type

Namespace

Facebook.Unity

Summary

App request result.

RequestID property

Summary

Gets RequestID.

To property

Summary

Gets the list of users who the request was sent to.

ICatalogResult type

Namespace

Facebook.Unity

Summary

The catalog result.

Products property

Summary

Gets a list of products available for purchase.

IChooseGamingContextResult type

Namespace

Facebook.Unity

Summary

The Choose Gaming Context API result.

ICreateGamingContextResult type

Namespace

Facebook.Unity

Summary

The Create Gaming Context API result.

IGamingServicesFriendFinderResult type

Namespace

Facebook.Unity

Summary

The result of a a FriendFinder Dialog. There is no data returned to the client.

IGetCurrentGamingContextResult type

Namespace

Facebook.Unity

Summary

The Get Current Gaming Context API result.

ContextId property

Summary

Gets Gaming Context ID.

IGraphResult type

Namespace

Facebook.Unity

Summary

The result of a graph api call.

ResultList property

Summary

Gets the result.

Texture property

Summary

Gets the Texture.

Remarks

The Graph API does not return textures directly, but a few endpoints can redirect to images when no 'redirect=false' parameter is specified. Ex: '/me/picture'.

IGroupCreateResult type

Namespace

Facebook.Unity

Summary

The result of a group creation.

GroupId property

Summary

Gets the group identifier.

IGroupJoinResult type

Namespace

Facebook.Unity

Summary

The result of a group join.

IHasLicenseResult type

Namespace

Facebook.Unity

Summary

The license check for premium games result.

HasLicense property

Summary

Gets if the user has a license to play the game.

IInternalResult type

Namespace

Facebook.Unity

CallbackId property

Summary

Gets the callback identifier.

ILoginResult type

Namespace

Facebook.Unity

Summary

The result of a login request.

AccessToken property

Summary

Gets the access token.

AuthenticationToken property

Summary

Gets the authentication token.

ILoginStatusResult type

Namespace

Facebook.Unity

Summary

The result for getting the Login Status of a user.

Failed property

Summary

Gets a value indicating whether the access token retrieval has failed

IMediaUploadResult type

Namespace

Facebook.Unity

Summary

The result of a Media Upload

MediaId property

Summary

Gets the Media Identifier.

IPayResult type

Namespace

Facebook.Unity

Summary

The result of a pay request.

ErrorCode property

Summary

Gets the error code.

IPayloadResult type

Namespace

Facebook.Unity

Summary

The payload result.

Payload property

Summary

Gets a dictionary of the payload items.

IProfileResult type

Namespace

Facebook.Unity

Summary

The result of a user profile request.

CurrentProfile property

Summary

Gets the current user profile.

IPurchaseResult type

Namespace

Facebook.Unity

Summary

The purchase result.

Purchase property

Summary

Gets the purchase information of the item that was purchased.

IPurchasesResult type

Namespace

Facebook.Unity

Summary

The access token refresh result.

Purchases property

Summary

Gets a list of products available for purchase.

IResult type

Namespace

Facebook.Unity

Summary

A class contiaing the result data.

Cancelled property

Summary

Gets a value indicating whether this instance cancelled.

Error property

Summary

Gets the error.

ErrorDictionary property

Summary

Gets the error, as a Dictionary.

RawResult property

Summary

Gets the raw result.

ResultDictionary property

Summary

Gets the result.

ISessionScoreResult type

Namespace

Facebook.Unity

Summary

The post session score result.

IShareResult type

Namespace

Facebook.Unity

Summary

The result of a share.

PostId property

Summary

Gets the post identifier.

ISwitchGamingContextResult type

Namespace

Facebook.Unity

Summary

The Switch Gaming Context API result.

ITournamentResult type

Namespace

Facebook.Unity

Summary

The instant tournament result.

ITournamentScoreResult type

Namespace

Facebook.Unity

Summary

The instant tournament score result.

InitDelegate type

Namespace

Facebook.Unity

Summary

Init delegate.

Json type

Namespace

Facebook.MiniJSON

Summary

This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/ JSON uses Arrays and Objects. These correspond here to the datatypes IList and IDictionary. All numbers are parsed to doubles.

Deserialize(json) method

Summary

Parses the string json into a value.

Returns

An List, a Dictionary<string, object>, a double, an integer,a string, null, true, or false.

Parameters
Name Type Description
json System.String A JSON string.

Serialize(obj) method

Summary

Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string.

Returns

A JSON encoded string, or null if object 'json' is not serializable.

Parameters
Name Type Description
obj System.Object A Dictionary<string, object> / List.

Mobile type

Namespace

Facebook.Unity.FB

Summary

A class containing the settings specific to the supported mobile platforms.

ShareDialogMode property

Summary

Gets or sets the share dialog mode.

UserID property

Summary

Gets or sets the user ID.

CurrentAuthenticationToken() method

Summary

Current Authentication Token.

Parameters

This method has no parameters.

CurrentProfile() method

Summary

Current Profile.

Parameters

This method has no parameters.

CurrentProfile() method

Summary

Current Profile via vallback.

Parameters

This method has no parameters.

EnableProfileUpdatesOnAccessTokenChange() method

Summary

Call this function so that Profile will be automatically updated based on the changes to the access token.

Parameters

This method has no parameters.

FetchDeferredAppLinkData(callback) method

Summary

Fetchs the deferred app link data.

Parameters
Name Type Description
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IAppLinkResult} A callback for when the call is complete.

IsImplicitPurchaseLoggingEnabled() method

Summary

Returns the setting for Automatic Purchase Logging

Parameters

This method has no parameters.

LoginWithTrackingPreference(loginTracking,permissions,nonce,callback) method

Summary

Login with tracking experience.

Parameters
Name Type Description
loginTracking Facebook.Unity.LoginTracking The option for login tracking preference, "enabled" or "limited".
permissions System.Collections.Generic.IEnumerable{System.String} A list of permissions.
nonce System.String An optional nonce to use for the login attempt.
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.ILoginResult} A callback for when the call is complete.

RefreshCurrentAccessToken(callback) method

Summary

Refreshs the current access to get a new access token if possible.

Parameters
Name Type Description
callback Facebook.Unity.FacebookDelegate{Facebook.Unity.IAccessTokenRefreshResult} A on refresh access token compelte callback.

SetAdvertiserIDCollectionEnabled(advertiserIDCollectionEnabled) method

Summary

Sets the setting for Advertiser ID collection.

Parameters
Name Type Description
advertiserIDCollectionEnabled System.Boolean The setting for Advertiser ID collection

SetAdvertiserTrackingEnabled(advertiserTrackingEnabled) method

Summary

Sets the setting for Advertiser Tracking Enabled.

Parameters
Name Type Description
advertiserTrackingEnabled System.Boolean The setting for Advertiser Tracking Enabled

SetAutoLogAppEventsEnabled(autoLogAppEventsEnabled) method

Summary

Sets the setting for Automatic App Events Logging.

Parameters
Name Type Description
autoLogAppEventsEnabled System.Boolean The setting for Automatic App Events Logging

SetPushNotificationsDeviceTokenString(token) method

Summary

Sets device token in the purpose of uninstall tracking.

Parameters
Name Type Description
token System.String The device token from APNs

MobileFacebook type

Namespace

Facebook.Unity.Mobile

Summary

Classes defined on the mobile sdks.

ShareDialogMode property

Summary

Gets or sets the dialog mode.

OGActionType type

Namespace

Facebook.Unity

Summary

OG action type.

ASKFOR constants

Summary

ASKFOR Action.

SEND constants

Summary

SEND Action.

TURN constants

Summary

TURN Action.

Product type

Namespace

Facebook.Unity

Summary

Contains a Instant Game Product.

#ctor(title,productID,description,imageURI,price,priceAmount,priceCurrencyCode) constructor

Summary

Initializes a new instance of the Product class.

Parameters
Name Type Description
title System.String The title of the product.
productID System.String The product's game-specified identifier.
description System.String The product description.
imageURI System.String A link to the product's associated image.
price System.String The price of the product.
priceAmount System.Nullable{System.Double} The numeric price of a product.
priceCurrencyCode System.String The currency code for the product.

Description property

Summary

Gets the description.

ImageURI property

Summary

Gets the image uniform resource identifier.

Price property

Summary

Gets the price.

PriceAmount property

Summary

Gets the price amount.

PriceCurrencyCode property

Summary

Gets the price currency code.

ProductID property

Summary

Gets the product identifier.

Title property

Summary

Gets the title.

ToString() method

Summary

Returns a String that represents a Product.

Returns

A String that represents a Product.

Parameters

This method has no parameters.

Profile type

Namespace

Facebook.Unity

#ctor(userID,firstName,middleName,lastName,name,email,imageURL,linkURL,friendIDs,birthday,ageRange,hometown,location,gender) constructor

Summary

Initializes a new instance of the Profile class.

Parameters
Name Type Description
userID System.String User ID.
firstName System.String First Name.
middleName System.String Middle Name.
lastName System.String Last Name.
name System.String Name.
email System.String Email.
imageURL System.String Image URL.
linkURL System.String Link URL.
friendIDs System.String[] A list of identifiers for the user's friends.
birthday System.String User's birthday
ageRange Facebook.Unity.UserAgeRange Age Range for the User
hometown Facebook.Unity.FBLocation Home Town
location Facebook.Unity.FBLocation Location
gender System.String Gender

AgeRange property

Summary

Gets the user's age range.

Birthday property

Summary

Gets the user's birthday.

Email property

Summary

Gets the email.

FirstName property

Summary

Gets the fist name.

FriendIDs property

Summary

Gets the list of identifiers for the user's friends.

Gender property

Summary

Gets the user's gender

Hometown property

Summary

Gets the user's hometown

ImageURL property

Summary

Gets the image URL.

LastName property

Summary

Gets the last name.

LinkURL property

Summary

Gets the link URL.

Location property

Summary

Gets the user's location

MiddleName property

Summary

Gets the middle name.

Name property

Summary

Gets the name.

UserID property

Summary

Gets the user ID.

ToString() method

Summary

Returns a String that represents the current Profile.

Returns

A String that represents the current Profile.

Parameters

This method has no parameters.

Purchase type

Namespace

Facebook.Unity

Summary

Contains a Instant Game Purchase.

#ctor(developerPayload,isConsumed,paymentActionType,paymentID,productID,purchasePlatform,purchasePrice,purchaseTime,purchaseToken,signedRequest) constructor

Summary

Initializes a new instance of the Purchase class.

Parameters
Name Type Description
developerPayload System.String A developer-specified string, provided during the purchase of the product.
isConsumed System.Boolean Whether or not the purchase has been consumed.
paymentActionType System.String The current status of the purchase.
paymentID System.String The identifier for the purchase transaction.
productID System.String The product's game-specified identifier.
purchasePlatform System.String The purchase platform, such as "GOOGLE" or "FB".
purchasePrice System.Collections.Generic.IDictionary{System.String,System.Object} Contains the local amount and currency associated with the purchased item.
purchaseTime System.Int64 Unix timestamp of when the purchase occurred.
purchaseToken System.String A token representing the purchase that may be used to consume the purchase.
signedRequest System.String Server-signed encoding of the purchase request.

DeveloperPayload property

Summary

Gets the developer payload string.

IsConsumed property

Summary

Gets whether or not the purchase has been consumed.

PaymentActionType property

Summary

Gets the purchase status.

PaymentID property

Summary

Gets the purchase identifier.

ProductID property

Summary

Gets the product identifier.

PurchasePlatform property

Summary

Gets the platform associated with the purchase.

PurchasePrice property

Summary

Gets the amount and currency fields associated with the purchase.

PurchaseTime property

Summary

Gets the purchase time.

PurchaseToken property

Summary

Gets the price.

SignedRequest property

Summary

Gets the price currency code.

ToString() method

Summary

Returns a String that represents a Purchase.

Returns

A String that represents a Purchase.

Parameters

This method has no parameters.

ShareDialogMode type

Namespace

Facebook.Unity

Summary

Share dialog mode.

AUTOMATIC constants

Summary

The sdk will choose which type of dialog to show See the Facebook SDKs for ios and android for specific details.

FEED constants

Summary

Uses the feed dialog.

NATIVE constants

Summary

Uses the dialog inside the native facebook applications. Note this will fail if the native applications are not installed.

WEB constants

Summary

Opens the facebook dialog in a webview.

UserAgeRange type

Namespace

Facebook.Unity

Max property

Summary

Gets the user's maximun age, -1 if unspecified.

Min property

Summary

Gets the user's minimun age, -1 if unspecified.

ToString() method

Summary

Returns a String that represents the current UserAgeRange.

Returns

A String that represents the current UserAgeRange.

Parameters

This method has no parameters.