View Full Version : No getMiddleName() in Spring Social Facebook?
Sep 26th, 2011, 04:01 PM
How do I get someone's middle name? FacebookProfile.getMiddleName() doesn't exist for some reason.
Sep 26th, 2011, 04:25 PM
You're correct...there is no getMiddleName() method, but there should be. I just checked the documentation at Facebook and saw the middle_name field, although I have been through that document several times before, including one pass where I specifically set out to fill out FacebookProfile with more fields, and never noticed it. I either overlooked it before, or it was one of those fields that previously wasn't documented but was added when Facebook went through their recent documentation updates. In any event, I've created https://jira.springsource.org/browse/SOCIALFB-29 to track this.
Sep 26th, 2011, 04:34 PM
You are really fast at responding Craig! Thanks. What is the difference between facebookProfile.getName() and .getFirstName() + .getMiddleName() (when implemented) + .getLastName()? Might it be different in some cases?
Sep 26th, 2011, 04:54 PM
I don't think there is any difference, but I don't know for certain. That's because getName() isn't implemented as you described. The Facebook profile record has a "name" field (as well as "first_name", "middle_name", and "last_name" fields). The getName() field gets its data from the "name" field returned from Facebook. I can only assume that Facebook implements it as you described.
Following up on my earlier comments: Facebook recently rewrote almost all of their documentation, updating it to reflect the current state of the platform. There were several places where the documentation was missing things (perhaps "middle_name" was one of those things) or even a few places that were completely incorrect. They announced at F8 Hack last week that all of the documentation had now been rewritten (with only a few small exceptions in cases where they intend to deprecate something), so there are likely a few more fields somewhere that Facebook sends back but that Spring Social Facebook doesn't capture or expose in its API binding. There may even be places where there are endpoints in Facebook's graph API that we're not exposing (I just discovered User/mutualfriends late last week). If you find any more of these, please let me know or open an issue in JIRA to request that they be added.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.