Android-Facebook集成:无法导入com.facebook.Session [英] Android - Facebook Integration: Impossible to Import com.facebook.Session

查看:88
本文介绍了Android-Facebook集成:无法导入com.facebook.Session的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android上的新手-Facebook集成.
我正尝试将我的应用程序与Facebook集成,因此我按照

i'm new on android - facebook integration.
I'm trying to integrate my app with facebook, so i follow all the steps on the facebook tutorial, and things work fine (at least i'm abble to perform the login).

But when i try to use this following code, i realize that i can't import the library from the Facebook:

会话会话= Session.getActiveSession();

Session session = Session.getActiveSession();

我正在使用Android Studio,并且IDE仅给我导入 android.service.textservice.SpellCheckerService 的选项,但是我想正确的导入是 com.facebook .Session

有什么我想念的想法吗?

PS: FB SDK版本是facebook-android-sdk-4.5.1.

I'm using Android Studio, and the IDE only give me the option to import the android.service.textservice.SpellCheckerService, but i guess that the right import is com.facebook.Session

Any ideas of what i'm missing here?

PS: FB SDK version is facebook-android-sdk-4.5.1

推荐答案

Facebook在新SDK中删除会话. 针对同一问题检查我的答案

Facebook remove session in new SDK. check my answer for same question

我给出了完整的集成代码.

there full integration code is given by me.

您可以通过此代码检查用户是否登录.

you can check whether user is logged in or not by this code.

profile = Profile.getCurrentProfile().getCurrentProfile();
if (profile != null) {
	// user has logged in

} else {
	// user has not logged in
   
}

这篇关于Android-Facebook集成:无法导入com.facebook.Session的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆