Wednesday, March 18, 2015

Upgrade to facebook v2.0 Javascript SDK

Facebook asks every app developer to upgrade to v2.0+ version before April 30, 2015.

Fortunately Facebook has well written document to explain the upgrade and new SDK

https://developers.facebook.com/docs/apps/upgrading
https://developers.facebook.com/docs/javascript/quickstart/v2.2

One main change is about Login API which needs review process if ask for non-default permissions. And the whole upgrade change limits to:
1. Point to new sdk endpoint which supports locale and versioning
https://connect.facebook.net/en_US/sdk.js
2. When init SDK, pass in version, for example
                       FB.init({
                            appId: app.config.global.fb_app_id,
                            status: true,
                            cookie: true,
                            // Disabling XFBML Parsing if we don't use social plugins (but we use feed dialog)
                            xfbml: true,
                            // frictionlessRequests: true,
                            version: 'v2.2'
                        });

We also use feed dialog, but Facebook suggests to change to new Share Dialog, will consider the migration in future release.
https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.2

No comments:

Post a Comment