facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

Defaults to deprecated v2.10 Graph #1157

Open nickdnk opened 4 years ago

nickdnk commented 4 years ago

Hello guys

This library still defaults to 2.10, which has been deprecated and has EOL on November 5 (as I'm sure you know).

How about we update this to avoid all of these unnecessary warnings in the developer portal?

https://github.com/facebook/php-graph-sdk/blob/5.x/src/Facebook/Facebook.php#L61

nickdnk commented 4 years ago

I see this is a duplicate of https://github.com/facebook/php-graph-sdk/issues/1139.

But no answer for 3 months? :)

nebkam commented 4 years ago

Thankfully, it's just a default and it can be overriden by a constructor parameter:

$facebook = new Facebook([
    'app_id' => '***',
    'app_secret' => '***',
    'default_graph_version' => 'v2.12'
]);
fd6130 commented 4 years ago

So we should change it to 'default_graph_version' => 'v5.0' am i right?

nebkam commented 4 years ago

If you're starting out with a new app, yes, v5.0 is the latest stable version. On the other hand, if you already integrated this SDK into a production app and you want to upgrade, Facebook has a handy API Upgrade Tool, that checks which API endpoints is your app currently calling, and lets you know which newer version has BC breaks or deprecations (that's why I mentioned v2.12 - my app was safe to upgrade to that version, without any breaks)