本文整理匯總了Java中com.facebook.internal.Utility.loadAppSettingsAsync方法的典型用法代碼示例。如果您正苦於以下問題:Java Utility.loadAppSettingsAsync方法的具體用法?Java Utility.loadAppSettingsAsync怎麽用?Java Utility.loadAppSettingsAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.internal.Utility
的用法示例。
在下文中一共展示了Utility.loadAppSettingsAsync方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sdkInitialize
import com.facebook.internal.Utility; //導入方法依賴的package包/類
/**
* This function initializes the Facebook SDK, the behavior of Facebook SDK functions are
* undetermined if this function is not called. It should be called as early as possible.
* @param applicationContext The application context
* @param callback A callback called when initialize finishes. This will be called even if the
* sdk is already initialized.
*/
public static synchronized void sdkInitialize(
Context applicationContext,
final InitializeCallback callback) {
if (sdkInitialized) {
if (callback != null) {
callback.onInitialized();
}
return;
}
Validate.notNull(applicationContext, "applicationContext");
// Don't throw for these validations here, just log an error. We'll throw when we actually
// need them
Validate.hasFacebookActivity(applicationContext, false);
Validate.hasInternetPermissions(applicationContext, false);
FacebookSdk.applicationContext = applicationContext.getApplicationContext();
// Make sure we've loaded default settings if we haven't already.
FacebookSdk.loadDefaultsFromMetadata(FacebookSdk.applicationContext);
// Load app settings from network so that dialog configs are available
Utility.loadAppSettingsAsync(FacebookSdk.applicationContext, applicationId);
// Fetch available protocol versions from the apps on the device
NativeProtocol.updateAllAvailableProtocolVersionsAsync();
BoltsMeasurementEventListener.getInstance(FacebookSdk.applicationContext);
cacheDir = new LockOnGetVariable<File>(
new Callable<File>() {
@Override
public File call() throws Exception {
return FacebookSdk.applicationContext.getCacheDir();
}
});
FutureTask<Void> accessTokenLoadFutureTask =
new FutureTask<Void>(new Callable<Void>() {
@Override
public Void call() throws Exception {
AccessTokenManager.getInstance().loadCurrentAccessToken();
ProfileManager.getInstance().loadCurrentProfile();
if (AccessToken.getCurrentAccessToken() != null &&
Profile.getCurrentProfile() == null) {
// Access token and profile went out of sync due to a network or caching
// issue, retry
Profile.fetchProfileForCurrentAccessToken();
}
if (callback != null) {
callback.onInitialized();
}
return null;
}
});
getExecutor().execute(accessTokenLoadFutureTask);
sdkInitialized = true;
}