本文整理匯總了Java中com.facebook.FacebookSdk.setApplicationId方法的典型用法代碼示例。如果您正苦於以下問題:Java FacebookSdk.setApplicationId方法的具體用法?Java FacebookSdk.setApplicationId怎麽用?Java FacebookSdk.setApplicationId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.FacebookSdk
的用法示例。
在下文中一共展示了FacebookSdk.setApplicationId方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initGlobalObjects
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
private static void initGlobalObjects(Context context, Options options) {
GlobalObjectRegistry.addObject(OpenHelperManager.getHelper(context, DatabaseHelper.class));
Gson gson = new GsonBuilder()
.setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE)
.create();
GlobalObjectRegistry.addObject(gson);
ImageLoader.init(context);
EmbeddedSocialServiceProvider serviceProvider = new EmbeddedSocialServiceProvider(context);
GlobalObjectRegistry.addObject(EmbeddedSocialServiceProvider.class, serviceProvider);
GlobalObjectRegistry.addObject(new Preferences(context));
GlobalObjectRegistry.addObject(new RequestInfoProvider(context));
GlobalObjectRegistry.addObject(new UserAccount(context));
GlobalObjectRegistry.addObject(new NotificationController(context));
NetworkAvailability networkAccessibility = new NetworkAvailability();
networkAccessibility.startMonitoring(context);
GlobalObjectRegistry.addObject(networkAccessibility);
FacebookSdk.sdkInitialize(context);
FacebookSdk.setApplicationId(options.getFacebookApplicationId());
}
示例2: initFBSdk
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
private void initFBSdk() {
if (!FacebookSdk.isInitialized()) {
FacebookSdk.setApplicationId(ApiObjects.facebook.get("app_id"));
FacebookSdk.sdkInitialize(getActivity().getApplicationContext());
}
callbackManager = CallbackManager.Factory.create();
profileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
if (eventHandler != null) {
if (currentProfile != null)
eventHandler.onFacebookLoggedIn();
}
}
};
}
示例3: init
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
public void init (String p_appID) {
APP_ID = p_appID;
FacebookSdk.sdkInitialize(activity);
FacebookSdk.setApplicationId(APP_ID);
initCallbacks();
AppEventsLogger.activateApp(activity);
Utils.callScriptFunc("initialized", "true");
Utils.d("Facebook:Initialized");
onStart();
}
示例4: onCreate
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
Timber.plant(new Timber.DebugTree());
FirebaseApp.initializeApp(this);
FacebookSdk.setApplicationId(getString(R.string.facebook_app_id));
FacebookSdk.sdkInitialize(this);
instance = this;
database = FirebaseDatabase.getInstance();
startService(CommentTableService.createIntent(this));
}
示例5: initFacebook
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
private void initFacebook() {
FacebookSdk.setApplicationId(Config.FACEBOOK_APP_ID);
AccessTokenTracker accessTokenTracker = new AccessTokenTracker() {
@Override
protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken newAccessToken) {
Logger.printInfo(LOG_TAG, "Is loged in with facebook");
}
};
accessTokenTracker.startTracking();
}
示例6: onCreate
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
context = this;
applicationComponent = DaggerApplicationComponent.create();
//TODO uncomment when production ready
// if (!BuildConfig.DEBUG) {
TwitterAuthConfig authConfig = new TwitterAuthConfig(BuildConfig.TWITTER_ID, BuildConfig.TWITTER_SECRET);
Fabric.with(this, new Crashlytics(), new Twitter(authConfig));
FacebookSdk.setApplicationId(BuildConfig.FB_ID);
FacebookSdk.sdkInitialize(this);
// }
}
示例7: initLogin
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
public void initLogin(final Activity activity) {
callbackManager = CallbackManager.Factory.create();
Config.debug("login");
FacebookSdk.sdkInitialize(activity);
FacebookSdk.setApplicationId(facebookApplicationId);
LoginManager.getInstance().logInWithReadPermissions(activity, Arrays.asList("public_profile", "email"));
LoginManager.getInstance().registerCallback(callbackManager,
new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(final LoginResult loginResult) {
// App code
ServerRequest.dismissProgressBar();
getFacebookData(loginResult.getAccessToken(),activity);
Config.debug("onSuccess", loginResult.toString());
}
@Override
public void onCancel() {
// App code
ServerRequest.dismissProgressBar();
Config.debug("onCancel");
activity.finish();
}
@Override
public void onError(FacebookException exception) {
// App code
ServerRequest.dismissProgressBar();
exception.printStackTrace();
activity.finish();
}
});
}
示例8: initializeFacebookSDK
import com.facebook.FacebookSdk; //導入方法依賴的package包/類
private static void initializeFacebookSDK(FacebookConfig config) {
FacebookSdk.setApplicationId(config.getApplicationId());
FacebookSdk.sdkInitialize(mContext);
}