Facebook Versioning/Upgrading

The following is an overview of the differences between major versions of the Facebook SDK implemented via the Facebook plugin. Some of these updates will be delivered automatically when a new device build is made, while others may require updating to a later version of Corona. Bug fixes will typically only be delivered to the latest major version available.

Major Version History

Release Name Release Date Corona Compatibility Facebook SDK (iOS/Android) Graph API Available
Android Beta 07/24/2015 2015.2685 - 2016.2827 – / 4.4.0 (fork) v2.4
iOS Beta 09/01/2015 2015.2685 - 2016.2827 4.5.1 / 4.5.0 (fork) v2.4
11/2015 Update 11/10/2015 2015.2685 - 2016.2827 4.5.1 / 4.5.0 (fork) v2.4
3/2016 Update 03/25/2016 2015.2828 - 2016.2931 4.10.1 / 4.10.1 (fork) v2.5
Stable Release 10/27/2016 2016.2932 + 4.16.1 / 4.16.1 (fork) v2.8

Upgrade Details

3/2016 Update → Stable Release

  • The Graph API version has been updated from v2.5 to v2.8. See Facebook's Graph API Upgrade Guide for more information on how this may affect your facebook.request() calls.

  • Previously denied permissions will be re-requested in the login screen.

  • Facebook Places and Facebook Friends have been deprecated in favor of selecting these in the Share Dialog. Please migrate to using facebook.showDialog( "link" ) instead of facebook.showDialog( "feed" ), facebook.showDialog( "place" ), or facebook.showDialog( "friends" ).

  • facebook.showDialog( "link" ) now requires a link key in the params table. This means that using the Share Dialog to let users compose a plain-text status update is no longer possible. For alternate means to do this, see the Social Plugin.

  • The Facebook SDK is no longer distributed with Corona Enterprise in the Plugins/sdk-facebook directory. For iOS, the appropriate SDK version can be downloaded here. For Android, Corona's fork of the Facebook SDK is now provided on GitHub.

  • A new method, facebook.isFacebookAppEnabled(), will help determine if a native Facebook app is installed and accessible on the device. See the documentation for more info.

  • facebook.showDialog() now supports sharing photos to a user's photo album.

  • For iOS, the Facebook SDK version has been updated from 4.10.1 to 4.16.1 which supports iOS 10. If you're a Corona Enterprise user, see Facebook's upgrade guide for more information.

  • On iOS 9 and above, the Share Dialog will use a SFSafariViewController. This is to coincide with the default that began with Facebook SDK 4.6.0.

  • For Android, the Facebook SDK version has been updated from 4.10.1 to 4.16.1. This means that the Facebook Lite app will be used for login if the Facebook app for Android is not installed. If you're a Corona Enterprise user, see Facebook's upgrade guide for more information.

11/2015 Update → 3/2016 Update

  • The Graph API version has been updated from v2.4 to v2.5. See Facebook's Graph API Upgrade Guide for more information on how this may affect your facebook.request() calls.

  • For iOS, the Facebook SDK version has been updated from 4.5.1 to 4.10.1. This means that devices running iOS 9 and above will use a SFSafariViewController to log users in. If you're a Corona Enterprise user, see Facebook's upgrade guide for more info.

  • For Android, the Facebook SDK version has been updated from 4.5.0 to 4.10.1. This means that the target Android SDK version is now API Level 23. If you're a Corona Enterprise user, see Facebook's upgrade guide for more information.

  • For Android, support for API Levels 10-14 has been maintained despite the Facebook SDK changing the minimum SDK version to API Level 15.

  • On Android, Facebook Places will now prompt users for Location permission if it hasn't been granted on devices running Android 6.0 and above.

iOS Beta → 11/2015 Update

Android Beta → iOS Beta

  • The property facebook.currentAccessToken has been deprecated in favor of the facebook.getCurrentAccessToken() function.

  • facebook.showDialog( "link" ) has been added in favor of facebook.showDialog( "feed" ) for sharing URL content. With this, the functionality of Facebook Places and Facebook Friends is built in if the Facebook app is installed.

  • For Android, the Facebook SDK version has been updated from 4.4.0 to 4.5.0. See Facebook's upgrade guide for more information.

Facebook v4 Migration

If you have an older project which used Corona's legacy Facebook plugin, you'll need to migrate to the current Facebook plugin. The following is an overview of the differences between Facebook SDK v3 and Facebook SDK v4, now fully implemented via the Facebook plugin.

The updated project settings for the current plugin can be found here.

Additions

  • facebook.getCurrentAccessToken() — This indicates the access token corresponding to which user logged in to Facebook from your app. This can be used to determine if a user is already logged in when the app starts, know when to refresh an access token, and track which permissions need to be requested.

  • facebook.isActive — This property lets you know if the facebook-v4 plugin has been initialized. The initialization begins when you require() the plugin in your project, but it isn't guaranteed to be completed at the time when the next line of code executes.

  • facebook.setFBConnectListener() — This function lets you set the fbconnect event listener which the facebook-v4 plugin will use. It can be used to change the listener conditionally or simply to set the listener at the beginning of your app.

  • There are new actions available to facebook.showDialog() which have the built-in ability to tag a place/friends and share a link to Facebook.

Deletions

  • facebook.accessDenied — Since logging in through Settings on an iOS device is not supported, this API no longer serves a purpose.

Differences

  • To include the current Facebook plugin, use require( "plugin.facebook.v4" ). Do not use require( "facebook" ) as with the legacy plugin.

  • Implementation for iOS 9 and above requires a few additional steps detailed in the top-level plugin documentation here.

  • If you're using Corona Enterprise for iOS, you'll need to add a reference to the CoronaFacebookDelegate in your Info.plist as outlined in the top-level plugin documentation here.

  • On Android, you must now include a Facebook App ID in build.settings. Previously, you also needed to specify the android.permission.INTERNET permission in build.settings, but this has been built into the plugin for Corona SDK users. Enterprise users, however, will still need to add the android.permission.INTERNET permission to their AndroidManifest.xml.

  • Passing your Facebook App ID as the first argument to facebook.login() and facebook.publishInstall() is no longer necessary. Doing so will result in a warning advising you to remove the argument.

  • Passing a listener function reference to facebook.login() is now optional. The listener function for fbconnect events can be set independently of facebook.login() via the facebook.setFBConnectListener() API.

  • facebook.showDialog() is more limited on combinations of valid options. This is due to the new sharing model introduced in Facebook SDK v4. Currently, only dialog types that are explicitly documented are supported.

  • The "apprequests" action for facebook.showDialog() has been replaced by "requests" which corresponds to the Game Requests Dialog.

  • The URI responses given from facebook.showDialog() will be different as a result of the new sharing model. For example, a "link" action will return only the ID of the post made, while a "requests" action will return the request ID and the list of recipients in the request.

  • facebook.showDialog() now provides feedback if the user cancelled out of the dialog. If the dialog is cancelled, the fbconnect event will have contain this indication in its response.

  • On Corona Enterprise for Android, the facebook-v4 plugin uses a modified version of the Facebook SDK which can be found on GitHub.