I checked this one.
On my Facebook profile I set birthday appearance to "day and month only"
In my app i login with following permissions:
NSArray *permissions = [[NSArray alloc] initWithObjects:@"user_birthday",
@"email",
@"user_about_me",
@"user_hometown",
nil];
FBSession *session = [[FBSession alloc] initWithAppID:nil
permissions:permissions
urlSchemeSuffix:nil
tokenCacheStrategy:_tokenCaching];
Of course you only need @"user_birthday"
permission.
Then I have fetchUserData
method:
- (void)fetchUserData
{
if (FBSession.activeSession.isOpen)
{
[[FBRequest requestForMe] startWithCompletionHandler:
^(FBRequestConnection *connection,
NSDictionary<FBGraphUser> *user,
NSError *error)
{
if (!error)
{
NSLog (@"FB: id: %@", user.id);
NSLog (@"FB: username: %@", user.username);
NSLog (@"FB: link: %@", user.link);
NSLog (@"FB: name: %@", user.name);
NSLog (@"FB: first_name: %@", user.first_name);
NSLog (@"FB: last_name: %@", user.last_name);
NSLog (@"FB: middle_name: %@", user.middle_name);
NSLog (@"FB: birthday: %@", user.birthday);
NSLog (@"FB: email: %@",[user objectForKey:@"email"]);
NSLog (@"FB: gender: %@",[user objectForKey:@"gender"]);
}
}];
}
}
And even though I'd set "day and month only" the result in fetchUserData is:
FB: birthday: 08/16/1978
EDIT:
This works for the logged-in user only. For his friends you will only be able to get the data they allow to post on timeline (even with FQL).
You can try what an FQL query returns in Graph API Explorer (FQL Query)
Make sure to get access token with users friends_birthday permission first (via Get Access token button)
run the query:
SELECT uid, name, birthday_date from user where uid IN (SELECT uid2 FROM friend WHERE uid1=your_facebook_id_here)
If you check the results you'll se that possible formats are:
full birthday: MM/DD/YYYY
month and day: MM/DD
don't show : <null>
So you'll be best off following advice from Anoop Vaidya.