Settings
이 클래스는 더 이상 최신 버전의 SDK에서 사용할 수 없습니다.
이 클래스의 최신 버전을 사용할 수 있습니다. 확인해보세요 최신 버전.

Allows some customization of sdk behavior.

확장:Object
패키지:facebook
생성자
Settings()
public Settings()
클래스 메서드
sdkInitialize(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.

public static synchronized void sdkInitialize(Context context)
매개변수설명
context
getLoggingBehaviors()

Certain logging behaviors are available for debugging beyond those that should be enabled in production.

Returns the types of extended logging that are currently enabled.

public static final Set getLoggingBehaviors()
Returns
A set containing enabled logging behaviors
addLoggingBehavior(LoggingBehavior)

Certain logging behaviors are available for debugging beyond those that should be enabled in production.

Enables a particular extended logging in the sdk.

public static final void addLoggingBehavior(LoggingBehavior behavior)
매개변수설명
behaviorThe LoggingBehavior to enable
removeLoggingBehavior(LoggingBehavior)

Certain logging behaviors are available for debugging beyond those that should be enabled in production.

Disables a particular extended logging behavior in the sdk.

public static final void removeLoggingBehavior(LoggingBehavior behavior)
매개변수설명
behaviorThe LoggingBehavior to disable
clearLoggingBehaviors()

Certain logging behaviors are available for debugging beyond those that should be enabled in production.

Disables all extended logging behaviors.

public static final void clearLoggingBehaviors()
isLoggingBehaviorEnabled(LoggingBehavior)

Certain logging behaviors are available for debugging beyond those that should be enabled in production.

Checks if a particular extended logging behavior is enabled.

public static final boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
매개변수설명
behaviorThe LoggingBehavior to check
Returns
Whether behavior is enabled
isLoggingEnabled()

This method is deprecated. Use Settings.isDebugEnabled() instead.

public static final boolean isLoggingEnabled()
setIsLoggingEnabled(boolean)

This method is deprecated. Use Settings.setIsDebugEnabled(boolean) instead.

public static final void setIsLoggingEnabled(boolean enabled)
매개변수설명
enabled
isDebugEnabled()

Indicates if we are in debug mode.

public static final boolean isDebugEnabled()
setIsDebugEnabled(boolean)

Used to enable or disable logging, and other debug features. Defaults to BuildConfig.DEBUG.

public static final void setIsDebugEnabled(boolean enabled)
매개변수설명
enabledDebug features (like logging) are enabled if true, disabled if false.
getExecutor()

Returns the Executor used by the SDK for non-AsyncTask background work.

By default this uses AsyncTask Executor via reflection if the API level is high enough. Otherwise this creates a new Executor with defaults similar to those used in AsyncTask.

public static Executor getExecutor()
Returns
An Executor used by the SDK. This will never be null.
setExecutor(Executor)

Sets the Executor used by the SDK for non-AsyncTask background work.

public static void setExecutor(Executor executor)
매개변수설명
executorThe Executor to use; must not be null.
getFacebookDomain()

Gets the base Facebook domain to use when making Web requests; in production code this will always be "facebook.com".

public static String getFacebookDomain()
Returns
The Facebook domain
setFacebookDomain(String)

Sets the base Facebook domain to use when making Web requests. This defaults to "facebook.com", but may be overridden to, e.g., "beta.facebook.com" to direct requests at a different domain. This method should never be called from production code.

public static void setFacebookDomain(String facebookDomain)
매개변수설명
facebookDomainThe base domain to use instead of "facebook.com"
setShouldAutoPublishInstall(boolean)

Sets whether opening a Session should automatically publish install attribution to the Facebook graph.

public static void setShouldAutoPublishInstall(boolean shouldAutoPublishInstall)
매개변수설명
shouldAutoPublishInstallTrue to automatically publish, false to not This method is deprecated. See AppEventsLogger.activateApp(Context, String) for more info.
getShouldAutoPublishInstall()

Gets whether opening a Session should automatically publish install attribution to the Facebook graph.

public static boolean getShouldAutoPublishInstall()
Returns
True to automatically publish, false to not This method is deprecated. See <a href='AppEventsLogger#activateApp(Context, String)'>AppEventsLogger.activateApp(Context, String)</a> for more info.
getAttributionId(ContentResolver)

Acquire the current attribution id from the facebook app.

public static String getAttributionId(ContentResolver contentResolver)
매개변수설명
contentResolver
Returns
Returns null if the facebook app is not present on the phone.
getAppVersion()

Gets the application version to the provided string.

public static String getAppVersion()
Returns
Application version set via setAppVersion.
setAppVersion(String)

Sets the application version to the provided string. AppEventsLogger.logEvent calls logs its event with the current app version, and App Insights allows breakdown of events by app version.

public static void setAppVersion(String appVersion)
매개변수설명
appVersionThe version identifier of the Android app that events are being logged through. Enables analysis and breakdown of logged events by app version.
getSdkVersion()

Gets the current version of the Facebook SDK for Android as a string.

public static String getSdkVersion()
Returns
The current version of the SDK
getLimitEventAndDataUsage(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. Defaults to false. This value is stored on the device and persists across app launches.

public static boolean getLimitEventAndDataUsage(Context context)
매개변수설명
contextUsed to read the value.
setLimitEventAndDataUsage(Context, boolean)

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. Defaults to false. This value is stored on the device and persists across app launches. Changes to this setting will apply to app events currently queued to be flushed.

public static void setLimitEventAndDataUsage(Context context, boolean limitEventUsage)
매개변수설명
contextUsed to persist this value across app runs.
limitEventUsage
getOnProgressThreshold()

Gets the threshold used to report progress on requests.

public static long getOnProgressThreshold()
setOnProgressThreshold(long)

Sets the threshold used to report progress on requests. Note that the value will be read when the request is started and can not be changed during a request (or batch) execution.

public static void setOnProgressThreshold(long threshold)
매개변수설명
thresholdThe number of bytes progressed to force a callback.
getPlatformCompatibilityEnabled()

Gets whether the SDK is running in Platform Compatibility mode (i.e. making calls to v1.0 endpoints by default) The default is false.

public static boolean getPlatformCompatibilityEnabled()
Returns
The value
setPlatformCompatibilityEnabled(boolean)

Sets whether the SDK is running in Platform Compatibility mode (i.e. making calls to v1.0 endpoints by default) The default is false. This is provided for apps that have strong reason not to take advantage of new capabilities in version 2.0+ of the API.

public static void setPlatformCompatibilityEnabled(boolean platformCompatibilityEnabled)
매개변수설명
platformCompatibilityEnabledWhether to set Legacy Graph API mode
loadDefaultsFromMetadata(Context)

Loads default values for certain settings from an application's AndroidManifest.xml metadata, if possible. If values have been explicitly set for a particular setting, they will not be overwritten. The following settings are currently loaded from metadata: APPLICATION_ID_PROPERTY, CLIENT_TOKEN_PROPERTY

public static void loadDefaultsFromMetadata(Context context)
매개변수설명
contextThe Context to use for loading metadata
getApplicationSignature(Context)
public static String getApplicationSignature(Context context)
매개변수설명
context
getApplicationId()

Gets the Facebook application ID for the current app. This will be null unless explicitly set or unless loadDefaultsFromMetadata has been called.

public static String getApplicationId()
Returns
The application ID
setApplicationId(String)

Sets the Facebook application ID for the current app.

public static void setApplicationId(String applicationId)
매개변수설명
applicationIdThe application ID
getClientToken()

Gets the client token for the current app. This will be null unless explicitly set or unless loadDefaultsFromMetadata has been called.

public static String getClientToken()
Returns
The client token
setClientToken(String)

Sets the Facebook client token for the current app.

public static void setClientToken(String clientToken)
매개변수설명
clientTokenThe client token
상수
APPLICATION_ID_PROPERTY
LoadDefaultsFromMetadata will attempt to load certain settings (e.g., application ID, client token) from metadata in the app's AndroidManifest.xml. The application ID will be read from this key.
public static final String APPLICATION_ID_PROPERTY
CLIENT_TOKEN_PROPERTY
LoadDefaultsFromMetadata will attempt to load certain settings (e.g., application ID, client token) from metadata in the app's AndroidManifest.xml. The client token will be read from this key.
public static final String CLIENT_TOKEN_PROPERTY