當前位置: 首頁>>代碼示例>>Java>>正文


Java FacebookSdk.setApplicationId方法代碼示例

本文整理匯總了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());
}
 
開發者ID:Microsoft,項目名稱:EmbeddedSocial-Android-SDK,代碼行數:20,代碼來源:EmbeddedSocial.java

示例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();
            }
        }
    };
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:18,代碼來源:FacebookShield.java

示例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();
}
 
開發者ID:FrogSquare,項目名稱:GDFacebook,代碼行數:15,代碼來源:FacebookSDK.java

示例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));

}
 
開發者ID:NarendraSickarwar,項目名稱:FirebasePost,代碼行數:14,代碼來源:AgroStarApplication.java

示例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();
}
 
開發者ID:KKorvin,項目名稱:uPods-android,代碼行數:12,代碼來源:LoginMaster.java

示例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);
    // }
}
 
開發者ID:belatrix,項目名稱:AndroidAllStars,代碼行數:14,代碼來源:BelatrixConnectApplication.java

示例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();
                }
            });
}
 
開發者ID:nishant-git,項目名稱:social-api,代碼行數:34,代碼來源:FacebookService.java

示例8: initializeFacebookSDK

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
private static void initializeFacebookSDK(FacebookConfig config) {
    FacebookSdk.setApplicationId(config.getApplicationId());
    FacebookSdk.sdkInitialize(mContext);
}
 
開發者ID:WindSekirun,項目名稱:SocialLogin,代碼行數:5,代碼來源:SocialLogin.java


注:本文中的com.facebook.FacebookSdk.setApplicationId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。