简体   繁体   English

Android,使用现有登录名添加FaceBook登录名(SDK 4.0.1)?

[英]Android, Adding FaceBook Login with Existing Login (SDK 4.0.1)?

I have an app, which already uses email and a database to log users in and out. 我有一个应用程序,该应用程序已经使用电子邮件和数据库来登录和注销用户。 I would like to incorporate a Facebook login, but am not sure how to track users. 我想加入一个Facebook登录名,但是不确定如何跟踪用户。

I follow the code from Facebook here , and it works fine to log in using Facebook, but I am unsure how to track users. 我在这里遵循来自Facebook的代码,并且使用Facebook登录可以很好地工作,但是我不确定如何跟踪用户。

With the email login, it is as simple as comparing the email and password with what is stored in the database, but what information is available to store when they use FB to log on? 使用电子邮件登录,就像将电子邮件和密码与数据库中存储的内容进行比较一样简单,但是当他们使用FB登录时可以存储哪些信息? People can change their names, email, etc, and even access tokens change every 6 months. 人们可以更改其姓名,电子邮件等,甚至访问令牌每6个月更改一次。

If I store anything that might potentially change, then there will be a mismatch with the database, and then they won't be able to log on anymore. 如果我存储了任何可能更改的内容,则该数据库将不匹配,然后它们将无法登录。

Thanks in advance. 提前致谢。

-Hello please correct me if i am wrong -As per facebook documentation -你好,如果我错了请指正我-根据facebook文档

- -

callbackManager = CallbackManager.Factory.create();

  ProfileTracker profileTracker = new ProfileTracker() {
        @Override
        protected void onCurrentProfileChanged(
                Profile oldProfile,
                Profile currentProfile) {
            // App code
        }
    };

-Can be used with it. -可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM