简体   繁体   中英

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.

I follow the code from Facebook here , and it works fine to log in using Facebook, but I am unsure how to track users.

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? People can change their names, email, etc, and even access tokens change every 6 months.

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

-

callbackManager = CallbackManager.Factory.create();

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

-Can be used with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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