本文整理汇总了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);
}