Facebook的Andr​​oid SDK中3.0 SSO [英] Facebook android sdk 3.0 SSO

查看:122
本文介绍了Facebook的Andr​​oid SDK中3.0 SSO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在previous Facebook的SDK中,我们可以检查,如果用户是通过使用令牌仍登录的版本。在新的3.0版本,我无法找到另一种方式比调用的openSession()来检查,如果用户仍然登录的 SSO 。但的openSession()自动调用登录,如果用户没有保存,我不希望出现这种情况。我只是想检查SSO。如何做到这一点?

In previous versions of the Facebook SDK we could check if a user is still signed in by using tokens. In the new 3.0 version I can't find another way other than invoking openSession() to check if the user is still logged in with SSO. But openSession() automatically invokes the login if the user is not saved and I don't want that. I only want to check SSO. How do I do this?

推荐答案

我在我的应用程序做了一个辅助函数,来检查是否仍然登录的用户(或实际上有活动会话)对我来说:

I made a helper function that to check if the user is still logged in (or actually has an active session) for me in my app:

public static boolean isActive() {
    Session session = Session.getActiveSession();
    if (session == null) {
        return false;
    }
    return session.isOpened();
}

这篇关于Facebook的Andr​​oid SDK中3.0 SSO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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