We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Getting user birthday from Facebook with Facebook connect | Forum

Marisa
Marisa Mar 31 '17
I was able to successfully do it until March 25, when FB depreciated Graph API v.2.2. After that, with v.2.3 being the oldest available, it stopped working. 


This is my code modification that used to work on older versions of Graph API. 


In file ow_plugins/fbconnect/bol/service.php:


Old line: 

private $jsInitialized = false, $scope = 'email,public_profile';

Replaced with:

private $jsInitialized = false, $scope = 'email,public_profile,user_birthday';


Old lines:

    public function getPossibleFbFieldList($questionName = null)   

 {       

 switch ($questionName)       

 {            

case 'username':                

return array('name');            

case 'email':                

return array('email');       

 }

Replaced with:

    public function getPossibleFbFieldList($questionName = null)   

 {        

switch ($questionName)        

{            

case 'username':               

 return array('name');            

case 'email':               

 return array('email');           

 case 'birthdate':                

return array('birthday');       

 }


Also added a row in the database, in table ow_fbconnect_field:

6 - birthdate - birthday - FBCONNECT_FC_Date


The converter FBCONNECT_FC_Date already exists in:

ow_plugins/fbconnect/classes/converters.php

This converter is a leftover from prior versions of oxwall, from the old good times when FB didn't require approval for extra fields, so it was handy.


My site was approved by FB for user_birthday permission (and still is!), everything was working great before March 25, Oxwall was grabbing users birthdays from FB, but now it stopped working, I have no idea why and how to fix it. 


Any help would be appreciated.

The Forum post is edited by Marisa Mar 31 '17