public final class Settings extends Object
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_ID_PROPERTY
loadDefaultsFromMetadata will attempt to load certain settings (e.g., application ID, client token) from
metadata in the app's AndroidManifest.xml.
|
static String |
CLIENT_TOKEN_PROPERTY
loadDefaultsFromMetadata will attempt to load certain settings (e.g., application ID, client token) from
metadata in the app's AndroidManifest.xml.
|
Constructor and Description |
---|
Settings() |
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 String |
getApplicationId()
Gets the Facebook application ID for the current app.
|
static String |
getApplicationSignature(Context context) |
static String |
getAppVersion()
Gets the application version to the provided string.
|
static String |
getAttributionId(ContentResolver contentResolver)
Acquire the current attribution id from the facebook app.
|
static String |
getClientToken()
Gets the client token for the current app.
|
static Executor |
getExecutor()
Returns the Executor used by the SDK for non-AsyncTask background work.
|
static 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(Context context)
Gets whether data such as that generated through AppEventsLogger and sent to Facebook should be restricted from
being used for purposes other than analytics and conversions, such as for targeting ads to this user.
|
static 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 boolean |
getPlatformCompatibilityEnabled()
Gets whether the SDK is running in Platform Compatibility mode (i.e.
|
static String |
getSdkVersion()
Gets the current version of the Facebook SDK for Android as a string.
|
static boolean |
isDebugEnabled()
Indicates if we are in debug mode.
|
static boolean |
isLoggingBehaviorEnabled(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static boolean |
isLoggingEnabled()
Deprecated.
|
static void |
loadDefaultsFromMetadata(Context context)
Loads default values for certain settings from an application's AndroidManifest.xml metadata, if possible.
|
static void |
removeLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be
enabled in production.
|
static void |
sdkInitialize(Context context)
Initialize SDK
This function will be called once in the application, it is tried to be called as early as possible;
This is the place to register broadcast listeners.
|
static void |
setApplicationId(String applicationId)
Sets the Facebook application ID for the current app.
|
static void |
setAppVersion(String appVersion)
Sets the application version to the provided string.
|
static void |
setClientToken(String clientToken)
Sets the Facebook client token for the current app.
|
static void |
setExecutor(Executor executor)
Sets the Executor used by the SDK for non-AsyncTask background work.
|
static void |
setFacebookDomain(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 |
setIsLoggingEnabled(boolean enabled)
Deprecated.
|
static void |
setLimitEventAndDataUsage(Context context,
boolean limitEventUsage)
Sets whether data such as that generated through AppEventsLogger and sent to Facebook should be restricted from
being used for purposes other than analytics and conversions, such as for targeting ads to this user.
|
static void |
setOnProgressThreshold(long threshold)
Sets the threshold used to report progress on requests.
|
static void |
setPlatformCompatibilityEnabled(boolean platformCompatibilityEnabled)
Sets whether the SDK is running in Platform Compatibility mode (i.e.
|
public static final String APPLICATION_ID_PROPERTY
public static final String CLIENT_TOKEN_PROPERTY
public static void sdkInitialize(Context context)
public static final Set<LoggingBehavior> getLoggingBehaviors()
public static final void addLoggingBehavior(LoggingBehavior behavior)
behavior
- The LoggingBehavior to enablepublic static final void removeLoggingBehavior(LoggingBehavior behavior)
behavior
- The LoggingBehavior to disablepublic static final void clearLoggingBehaviors()
public static final boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
behavior
- The LoggingBehavior to check@Deprecated public static final boolean isLoggingEnabled()
isDebugEnabled()
instead.@Deprecated public static final void setIsLoggingEnabled(boolean enabled)
setIsDebugEnabled(boolean)
instead.public static final boolean isDebugEnabled()
public static final void setIsDebugEnabled(boolean enabled)
enabled
- Debug features (like logging) are enabled if true, disabled if false.public static Executor getExecutor()
public static void setExecutor(Executor executor)
executor
- the Executor to use; must not be null.public static String getFacebookDomain()
public static void setFacebookDomain(String facebookDomain)
facebookDomain
- the base domain to use instead of "facebook.com"public static String getAttributionId(ContentResolver contentResolver)
public static String getAppVersion()
public static void setAppVersion(String appVersion)
appVersion
- The version identifier of the Android app that events are being logged through.
Enables analysis and breakdown of logged events by app version.public static String getSdkVersion()
public static boolean getLimitEventAndDataUsage(Context context)
context
- Used to read the value.public static void setLimitEventAndDataUsage(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 boolean getPlatformCompatibilityEnabled()
public static void setPlatformCompatibilityEnabled(boolean platformCompatibilityEnabled)
platformCompatibilityEnabled
- whether to set Legacy Graph API modepublic static void loadDefaultsFromMetadata(Context context)
context
- the Context to use for loading metadatapublic static String getApplicationId()
public static void setApplicationId(String applicationId)
applicationId
- the application IDpublic static String getClientToken()
public static void setClientToken(String clientToken)
clientToken
- the client token