With Facebook Upgrading to Graph API 2.x and the New Facebook Login.
Is it necessary to upgrade Facebook php SDK 3.2.3 to 4.0.0?
If it is not, how can I make change for Graph API 2.x base on PHP SDK 3.2.3?
Thank you,
Griffin
With Facebook Upgrading to Graph API 2.x and the New Facebook Login.
Is it necessary to upgrade Facebook php SDK 3.2.3 to 4.0.0?
If it is not, how can I make change for Graph API 2.x base on PHP SDK 3.2.3?
Thank you,
Griffin
There are another option, not very clean but... you can hack the class.
You can change
https://graph.facebook.com/
to
https://graph.facebook.com/v2.0/
in
base_facebook.php
Be aware with deprecated dates https://developers.facebook.com/docs/apps/changelog
The cleanest way I found is to modify $DOMAIN_MAP outside of the vendor code and before you use the Facebook API.
$version = 'v2.3';
BaseFacebook::$DOMAIN_MAP = [
'api' => 'https://api.facebook.com/' .$version . '/',
'api_video' => 'https://api-video.facebook.com/' .$version . '/',
'api_read' => 'https://api-read.facebook.com/' .$version . '/',
'graph' => 'https://graph.facebook.com/' .$version . '/',
'graph_video' => 'https://graph-video.facebook.com/' .$version . '/',
'www' => 'https://www.facebook.com/' .$version . '/',
];
Please use latest facebook sdk, because it old version will be closed. See change log https://developers.facebook.com/docs/apps/changelog sdk v3.2.3 (graph api v1.0) available until 2015/4/30
About php, you can upgrade the php verion to php 5.4 or try use facebook sdk for javascript.
It isn't strictly necessary, but v3.2.3 has no support for specifying the graph API version you want to use.
If you are updating an app and want to use graph v2.0+ before Facebook forces it on April 30th, you'll need to use the v4 SDK or hack v3.2.3. I recommend you just bite the bullet now and use v4. v3.2.3 is deprecated anyways.