public final class FacebookSdk
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_ID_PROPERTY
The key for the application ID in the Android manifest.
|
static java.lang.String |
APPLICATION_NAME_PROPERTY
The key for the application name in the Android manifest.
|
static java.lang.String |
CLIENT_TOKEN_PROPERTY
The key for the client token in the Android manifest.
|
Constructor and Description |
---|
FacebookSdk() |
Modifier and Type | Method and Description |
---|---|
static void |
addLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static void |
clearLoggingBehaviors()
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static android.content.Context |
getApplicationContext()
The getter for the context of the current application.
|
static java.lang.String |
getApplicationId()
Gets the Facebook application ID for the current app.
|
static java.lang.String |
getApplicationName()
Gets the Facebook application name of the current app.
|
static java.lang.String |
getApplicationSignature(android.content.Context context)
Internal call please don't use directly.
|
static java.io.File |
getCacheDir()
Gets the cache directory to use for caching responses, etc.
|
static int |
getCallbackRequestCodeOffset()
Getter for the callback request code offset.
|
static java.lang.String |
getClientToken()
Gets the client token for the current app.
|
static java.util.concurrent.Executor |
getExecutor()
Returns the Executor used by the SDK for non-AsyncTask background work.
|
static java.lang.String |
getFacebookDomain()
Gets the base Facebook domain to use when making Web requests; in production code this will
always be "facebook.com".
|
static boolean |
getLimitEventAndDataUsage(android.content.Context context)
Returns whether data such as those generated through AppEventsLogger and sent to Facebook
should be restricted from being used for purposes other than analytics and conversions, such
as targeting ads to this user.
|
static java.util.Set<LoggingBehavior> |
getLoggingBehaviors()
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static long |
getOnProgressThreshold()
Gets the threshold used to report progress on requests.
|
static java.lang.String |
getSdkVersion()
Returns the current version of the Facebook SDK for Android as a string.
|
static boolean |
isDebugEnabled()
Indicates if we are in debug mode.
|
static boolean |
isFacebookRequestCode(int requestCode)
Returns true if the request code is within the range used by Facebook SDK requests.
|
static boolean |
isInitialized()
Indicates whether the Facebook SDK has been initialized.
|
static boolean |
isLegacyTokenUpgradeSupported()
Indicates if the SDK should fallback and read the legacy token.
|
static boolean |
isLoggingBehaviorEnabled(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static void |
publishInstallAsync(android.content.Context context,
java.lang.String applicationId)
This method is public in order to be used by app events, please don't use directly.
|
static void |
removeLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static void |
sdkInitialize(android.content.Context applicationContext)
This function initializes the Facebook SDK, the behavior of Facebook SDK functions are
undetermined if this function is not called.
|
static void |
sdkInitialize(android.content.Context applicationContext,
int callbackRequestCodeOffset)
This function initializes the Facebook SDK, the behavior of Facebook SDK functions are
undetermined if this function is not called.
|
static void |
setApplicationId(java.lang.String applicationId)
Sets the Facebook application ID for the current app.
|
static void |
setApplicationName(java.lang.String applicationName)
Sets the Facebook application name for the current app.
|
static void |
setCacheDir(java.io.File cacheDir)
Sets the cache directory to use for caching responses, etc.
|
static void |
setClientToken(java.lang.String clientToken)
Sets the Facebook client token for the current app.
|
static void |
setExecutor(java.util.concurrent.Executor executor)
Sets the Executor used by the SDK for non-AsyncTask background work.
|
static void |
setFacebookDomain(java.lang.String facebookDomain)
Sets the base Facebook domain to use when making Web requests.
|
static void |
setIsDebugEnabled(boolean enabled)
Used to enable or disable logging, and other debug features.
|
static void |
setLegacyTokenUpgradeSupported(boolean supported)
Setter for legacy token upgrade.
|
static void |
setLimitEventAndDataUsage(android.content.Context context,
boolean limitEventUsage)
Sets whether data such as those generated through AppEventsLogger and sent to Facebook should
be restricted from being used for purposes other than analytics and conversions, such as
targeting ads to this user.
|
static void |
setOnProgressThreshold(long threshold)
Sets the threshold used to report progress on requests.
|
public static final java.lang.String APPLICATION_ID_PROPERTY
public static final java.lang.String APPLICATION_NAME_PROPERTY
public static final java.lang.String CLIENT_TOKEN_PROPERTY
public static void sdkInitialize(android.content.Context applicationContext, int callbackRequestCodeOffset)
applicationContext
- The application contextcallbackRequestCodeOffset
- The request code offset that Facebook activities will be
called with. Please do not use the range between the
value you set and another 100 entries after it in your
other requests.public static void sdkInitialize(android.content.Context applicationContext)
applicationContext
- The application contextpublic static boolean isInitialized()
public static java.util.Set<LoggingBehavior> getLoggingBehaviors()
public static void addLoggingBehavior(LoggingBehavior behavior)
behavior
- The LoggingBehavior to enablepublic static void removeLoggingBehavior(LoggingBehavior behavior)
behavior
- The LoggingBehavior to disablepublic static void clearLoggingBehaviors()
public static boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
behavior
- The LoggingBehavior to checkpublic static boolean isDebugEnabled()
public static void setIsDebugEnabled(boolean enabled)
enabled
- Debug features (like logging) are enabled if true, disabled if false.public static boolean isLegacyTokenUpgradeSupported()
public static void setLegacyTokenUpgradeSupported(boolean supported)
supported
- True if upgrade should be supported.public static java.util.concurrent.Executor getExecutor()
public static void setExecutor(java.util.concurrent.Executor executor)
executor
- the Executor to use; must not be null.public static java.lang.String getFacebookDomain()
public static void setFacebookDomain(java.lang.String facebookDomain)
facebookDomain
- the base domain to use instead of "facebook.com"public static android.content.Context getApplicationContext()
public static void publishInstallAsync(android.content.Context context, java.lang.String applicationId)
context
- The application context.applicationId
- The application id.public static java.lang.String getSdkVersion()
public static boolean getLimitEventAndDataUsage(android.content.Context context)
context
- Used to read the value.public static void setLimitEventAndDataUsage(android.content.Context context, boolean limitEventUsage)
context
- Used to persist this value across app runs.public static long getOnProgressThreshold()
public static void setOnProgressThreshold(long threshold)
threshold
- The number of bytes progressed to force a callback.public static java.lang.String getApplicationSignature(android.content.Context context)
context
- The application context.public static java.lang.String getApplicationId()
public static void setApplicationId(java.lang.String applicationId)
applicationId
- the application IDpublic static java.lang.String getApplicationName()
public static void setApplicationName(java.lang.String applicationName)
applicationName
- the application namepublic static java.lang.String getClientToken()
public static void setClientToken(java.lang.String clientToken)
clientToken
- the client tokenpublic static java.io.File getCacheDir()
public static void setCacheDir(java.io.File cacheDir)
cacheDir
- the cache directorypublic static int getCallbackRequestCodeOffset()
public static boolean isFacebookRequestCode(int requestCode)
requestCode
- the request code to check.