/** * Gets the Facebook application name of the current app. This should only be called after the * SDK has been initialized by calling FacebookSdk.sdkInitialize(). * * @return the application name */ public static String getApplicationName() { Validate.sdkInitialized(); return applicationName; }
/** * Getter for the callback request code offset. The request codes starting at this offset and * the next 100 values are used by the Facebook SDK. * * @return The callback request code offset. */ public static int getCallbackRequestCodeOffset() { Validate.sdkInitialized(); return callbackRequestCodeOffset; }
/** * Gets the client token for the current app. This will be null unless explicitly set or unless * loadDefaultsFromMetadata has been called. * @return the client token */ public static String getClientToken() { Validate.sdkInitialized(); return appClientToken; }
/** * Gets the Facebook application ID for the current app. This should only be called after the * SDK has been initialized by calling FacebookSdk.sdkInitialize(). * * @return the application ID */ public static String getApplicationId() { Validate.sdkInitialized(); return applicationId; }
/** * @return the codeless debug flag for the application */ public static boolean getCodelessDebugLogEnabled() { Validate.sdkInitialized(); return codelessDebugLogEnabled; }
/** * Gets the theme used by {@link com.facebook.internal.WebDialog} * @return the theme */ public static int getWebDialogTheme() { Validate.sdkInitialized(); return webDialogTheme; }
/** * The getter for the context of the current application. * @return The context of the current application. */ public static Context getApplicationContext() { Validate.sdkInitialized(); return applicationContext; }
/** * Gets the threshold used to report progress on requests. */ public static long getOnProgressThreshold() { Validate.sdkInitialized(); return onProgressThreshold.get(); }
/** * 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. Defaults to false. This value is stored on the device and * persists across app launches. * * @param context Used to read the value. */ public static boolean getLimitEventAndDataUsage(Context context) { Validate.sdkInitialized(); SharedPreferences preferences = context.getSharedPreferences( AppEventsLogger.APP_EVENT_PREFERENCES, Context.MODE_PRIVATE); return preferences.getBoolean("limitEventUsage", false); }
LoginManager() { Validate.sdkInitialized(); sharedPreferences = FacebookSdk.getApplicationContext() .getSharedPreferences(PREFERENCE_LOGIN_MANAGER, Context.MODE_PRIVATE); }
/** * Gets the cache directory to use for caching responses, etc. The default will be the value * returned by Context.getCacheDir() when the SDK was initialized, but it can be overridden. * * @return the cache directory */ public static File getCacheDir() { Validate.sdkInitialized(); return cacheDir.getValue(); }
Validate.sdkInitialized(); if (context == null) { return null;
/** * Constructor. */ public ProfileTracker() { Validate.sdkInitialized(); this.receiver = new ProfileBroadcastReceiver(); this.broadcastManager = LocalBroadcastManager.getInstance( FacebookSdk.getApplicationContext()); startTracking(); }
/** * The constructor. */ public AccessTokenTracker() { Validate.sdkInitialized(); this.receiver = new CurrentAccessTokenBroadcastReceiver(); this.broadcastManager = LocalBroadcastManager.getInstance( FacebookSdk.getApplicationContext()); startTracking(); }
protected AppEventsLogger( String activityName, String applicationId, AccessToken accessToken) { Validate.sdkInitialized(); this.contextName = activityName; if (accessToken == null) { accessToken = AccessToken.getCurrentAccessToken(); } // If we have a session and the appId passed is null or matches the session's app ID: if (AccessToken.isCurrentAccessTokenActive() && (applicationId == null || applicationId.equals(accessToken.getApplicationId())) ) { accessTokenAppId = new AccessTokenAppIdPair(accessToken); } else { // If no app ID passed, get it from the manifest: if (applicationId == null) { applicationId = Utility.getMetadataApplicationId( FacebookSdk.getApplicationContext()); } accessTokenAppId = new AccessTokenAppIdPair(null, applicationId); } initializeTimersIfNeeded(); }