Because it's due date for graph api 2.2, I'm trying fix my graph api using v2.3 But I discover most api request response nothing when I use 2.3, but I can not found any update for this in the upgrade document. For example:
https://graph.facebook.com/v2.3/{$user_id}?date_format=U&fields=albums.order(reverse_chronological).limit(100).offset(0){id,count,name,created_time}
will return nothing if I use 2.3. And I can't get user's birthday when I call:
https://graph.facebook.com/v2.3/{$user_id}
It's only return name and live location. But in v2.2, it include birthday profile.
I use facebook SDK 3.2.2 because my php version is 5.3. Is there any update that I don't know? Thanks.
I have found the problem myself. It's because the SDK 3.2.2. For facebook update (from the Changelog for API version 2.3):
But SDK is recognize the response as an array(in the getAccessTokenFromCode function):
This will not get user access token correctly, and you can't get user's data. So you should update this function to parse data as json:
Then all of the function will work as usual.
Additionally, you must make similar changes to
setExtendedAccessToken()
. Otherwise, your app won't be able to extend access tokens. The code below demonstrates how to upgrade the function.