A few days ago I implemented FB Login to my APP, and today I found out that most of the things I have implemented are now deprecated.
Before, I was using Sess
My dilemma of using AccessToken and AccessTokenTracker for checking login status is that when AccessToken is ready and callback function of the tracker called but profile may be not ready yet, thus I cannot get or display Facebooker's name at that moment.
My solution is to check current profile != null and use its tracker for having Facebooker's name at the same time:
ProfileTracker fbProfileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
// User logged in or changed profile
}
};
Check login status and then get user name:
Profile profile = Profile.getCurrentProfile();
if (profile != null) {
Log.v(TAG, "Logged, user name=" + profile.getFirstName() + " " + profile.getLastName());
}