com.facebook
Class Settings

java.lang.Object
  extended by com.facebook.Settings

public final class Settings
extends Object

Allows some customization of sdk behavior.


Constructor Summary
Settings()
           
 
Method Summary
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 getAttributionId(ContentResolver contentResolver)
          Acquire the current attribution id from the facebook app.
static Executor getExecutor()
          Returns the Executor used by the SDK for non-AsyncTask background work.
static Set<LoggingBehavior> getLoggingBehaviors()
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static String getMigrationBundle()
          Gets the current Facebook migration bundle string; this string can be passed to Graph API endpoints to specify a set of platform migrations that are explicitly turned on or off for that call, in order to ensure compatibility between a given version of the SDK and the Graph API.
static String getSdkVersion()
          Gets the current version of the Facebook SDK for Android as a string.
static boolean getShouldAutoPublishInstall()
          Gets whether opening a Session should automatically publish install attribution to the Facebook graph.
static boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static boolean publishInstallAndWait(Context context, String applicationId)
          Manually publish install attribution to the Facebook graph.
static Response publishInstallAndWaitForResponse(Context context, String applicationId)
          Manually publish install attribution to the Facebook graph.
static void publishInstallAsync(Context context, String applicationId)
          Manually publish install attribution to the Facebook graph.
static void publishInstallAsync(Context context, String applicationId, Request.Callback callback)
          Manually publish install attribution to the Facebook graph.
static void removeLoggingBehavior(LoggingBehavior behavior)
          Certain logging behaviors are available for debugging beyond those that should be enabled in production.
static void setExecutor(Executor executor)
          Sets the Executor used by the SDK for non-AsyncTask background work.
static void setShouldAutoPublishInstall(boolean shouldAutoPublishInstall)
          Sets whether opening a Session should automatically publish install attribution to the Facebook graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
Method Detail

getLoggingBehaviors

public static final Set<LoggingBehavior> 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.

Returns:
a set containing enabled logging behaviors

addLoggingBehavior

public static final void addLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Enables a particular extended logging in the sdk.

Parameters:
behavior - The LoggingBehavior to enable

removeLoggingBehavior

public static final void removeLoggingBehavior(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Disables a particular extended logging behavior in the sdk.

Parameters:
behavior - The LoggingBehavior to disable

clearLoggingBehaviors

public static final void clearLoggingBehaviors()
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Disables all extended logging behaviors.


isLoggingBehaviorEnabled

public static final boolean isLoggingBehaviorEnabled(LoggingBehavior behavior)
Certain logging behaviors are available for debugging beyond those that should be enabled in production. Checks if a particular extended logging behavior is enabled.

Parameters:
behavior - The LoggingBehavior to check
Returns:
whether behavior is enabled

getExecutor

public static Executor 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.

Returns:
an Executor used by the SDK. This will never be null.

setExecutor

public static void setExecutor(Executor executor)
Sets the Executor used by the SDK for non-AsyncTask background work.

Parameters:
executor - the Executor to use; must not be null.

publishInstallAsync

public static void publishInstallAsync(Context context,
                                       String applicationId)
Manually publish install attribution to the Facebook graph. Internally handles tracking repeat calls to prevent multiple installs being published to the graph.

Parameters:
context - the current Context
applicationId - the fb application being published.

publishInstallAsync

public static void publishInstallAsync(Context context,
                                       String applicationId,
                                       Request.Callback callback)
Manually publish install attribution to the Facebook graph. Internally handles tracking repeat calls to prevent multiple installs being published to the graph.

Parameters:
context - the current Context
applicationId - the fb application being published.
callback - a callback to invoke with a Response object, carrying the server response, or an error.

setShouldAutoPublishInstall

public static void setShouldAutoPublishInstall(boolean shouldAutoPublishInstall)
Sets whether opening a Session should automatically publish install attribution to the Facebook graph.

Parameters:
shouldAutoPublishInstall - true to automatically publish, false to not

getShouldAutoPublishInstall

public static boolean getShouldAutoPublishInstall()
Gets whether opening a Session should automatically publish install attribution to the Facebook graph.

Returns:
true to automatically publish, false to not

publishInstallAndWait

public static boolean publishInstallAndWait(Context context,
                                            String applicationId)
Manually publish install attribution to the Facebook graph. Internally handles tracking repeat calls to prevent multiple installs being published to the graph.

Parameters:
context - the current Context
applicationId - the fb application being published.
Returns:
returns false on error. Applications should retry until true is returned. Safe to call again after true is returned.

publishInstallAndWaitForResponse

public static Response publishInstallAndWaitForResponse(Context context,
                                                        String applicationId)
Manually publish install attribution to the Facebook graph. Internally handles caching repeat calls to prevent multiple installs being published to the graph.

Parameters:
context - the current Context
applicationId - the fb application being published.
Returns:
returns a Response object, carrying the server response, or an error.

getAttributionId

public static String getAttributionId(ContentResolver contentResolver)
Acquire the current attribution id from the facebook app.

Returns:
returns null if the facebook app is not present on the phone.

getSdkVersion

public static String getSdkVersion()
Gets the current version of the Facebook SDK for Android as a string.

Returns:
the current version of the SDK

getMigrationBundle

public static String getMigrationBundle()
Gets the current Facebook migration bundle string; this string can be passed to Graph API endpoints to specify a set of platform migrations that are explicitly turned on or off for that call, in order to ensure compatibility between a given version of the SDK and the Graph API.

Returns:
the migration bundle supported by this version of the SDK