iOS beta, Android updates, and new features

Hey everyone,

Today we’ve launched the iOS version of the Facebook v4 plugin! In addition, we’ve also made some improvements on Android , as well as added a couple new features to the plugin.

Here’s a quick breakdown of some of the goodies that come with this update:

  • The iOS version targets Facebook SDK 4.5.1. and the Android version has been upgraded to 4.5.0.
  • iOS 6 is not supported with this plugin.
  • iOS 9 is supported with a couple additional setup steps.
  • facebook.currentAccessToken has been deprecated in favor of facebook.getCurrentAccessToken().
    • On top of providing knowledge of whether you have a logged in user, this new API provides access to:
      • The permissions the user has granted your app
      • The permission they’ve denied your app
      • Their Facebook User ID
      • and more
  • facebook.showDialog() now allows a new action, “link”.
    • This will bring up the new Share Dialog and will allow you to share a link on it.
    • If you have the Facebook app installed on your device, bringing up this dialog will allow you to tag friends and a place, all without additional calls to bring up the Places and Friends dialogs.
  • facebook.accessDenied for iOS has been removed. Since logging in through Settings on iOS isn’t supported, this API wasn’t very useful.

See the Facebook v4 plugin home page to get started!

:grinning:

“Since logging in through Settings on iOS isn’t supported” 

could you please explain what do you mean by that?

How come it’s not supported? If user is logged in on the OS they will need to login again in our apps?

Also, from the docs:

“Since Facebook v4 uses a modified version of the Facebook SDK on Android”

could you please explain why were the modifications needed/ what was that?

For the comment, “Since logging in through Settings on iOS isn’t supported”, we mean that the login credentials used in the screen below won’t be used in your Corona application.

fb-ios-7.jpg

Logging in through the Settings page has had a confusing history within our facebook plugin so I’ll try to explain as best as possible.

Facebook login through Settings was introduced as a feature in iOS 6 and the Facebook SDK introduced support for it in early versions of Facebook SDK 3. From Facebook SDK 3’s changelog, it had issues to the point where it wasn’t even recommended to be used.

In late November 2014, the API facebook.accessDenied was introduced. This API would return true if your app was listed on the screen below and access was explicitly granted to it (like it is for Calendar and Contacts).

How-to-Merge-Facebook-to-iOS-Contacts-2.

However, since logging in this way wasn’t ever supported by our facebook plugin in the past, if your app was listed on this page, then it was by unreliable means since the old plugin never had code that would explicitly request a listing here. That being said, an API that gives you info on something that you shouldn’t be listed on in the first place isn’t terribly useful.

This has been a feature request for awhile, and we had some discussion about doing it last year, but it wasn’t the highest priority item at the time. See this thread for more on that. While implementing facebook-v4, we did spend time experimenting with this, but again, there were stability concerns.

All that being said, should we have logging in through the Settings page play nicely with the rest of the plugin, then we will add the accessDenied API back, since it’ll actually be useful then.

Ok, the second question shouldn’t require as long of an explanation. There are two important modifications we’ve made to the Facebook SDK downloadable from their website.

The first is to allow the Facebook SDK to build with the Ant build system. Facebook dropped Ant build support with version 4 in favor of Gradle (the build system used by Android Studio). To ensure compatibility with Corona, we’ve added Ant build support back to the Facebook SDK we distribute through Corona Enterprise.

The second concerns features that Facebook removed from their SDK in version 4, but are still needed by the Corona plugin. Specifically, Facebook removed the Friend and Place pickers from their SDK, but still use that code as part of their Scrumptious sample. Since we use those pickers for the Facebook Friends and Facebook Places options for facebook.showDialog(), we ported that code back into the Facebook SDK that we distribute through Corona Enterprise.

Ajay: thank you very much for a detailed answer!

:grinning:

“Since logging in through Settings on iOS isn’t supported” 

could you please explain what do you mean by that?

How come it’s not supported? If user is logged in on the OS they will need to login again in our apps?

Also, from the docs:

“Since Facebook v4 uses a modified version of the Facebook SDK on Android”

could you please explain why were the modifications needed/ what was that?

For the comment, “Since logging in through Settings on iOS isn’t supported”, we mean that the login credentials used in the screen below won’t be used in your Corona application.

fb-ios-7.jpg

Logging in through the Settings page has had a confusing history within our facebook plugin so I’ll try to explain as best as possible.

Facebook login through Settings was introduced as a feature in iOS 6 and the Facebook SDK introduced support for it in early versions of Facebook SDK 3. From Facebook SDK 3’s changelog, it had issues to the point where it wasn’t even recommended to be used.

In late November 2014, the API facebook.accessDenied was introduced. This API would return true if your app was listed on the screen below and access was explicitly granted to it (like it is for Calendar and Contacts).

How-to-Merge-Facebook-to-iOS-Contacts-2.

However, since logging in this way wasn’t ever supported by our facebook plugin in the past, if your app was listed on this page, then it was by unreliable means since the old plugin never had code that would explicitly request a listing here. That being said, an API that gives you info on something that you shouldn’t be listed on in the first place isn’t terribly useful.

This has been a feature request for awhile, and we had some discussion about doing it last year, but it wasn’t the highest priority item at the time. See this thread for more on that. While implementing facebook-v4, we did spend time experimenting with this, but again, there were stability concerns.

All that being said, should we have logging in through the Settings page play nicely with the rest of the plugin, then we will add the accessDenied API back, since it’ll actually be useful then.

Ok, the second question shouldn’t require as long of an explanation. There are two important modifications we’ve made to the Facebook SDK downloadable from their website.

The first is to allow the Facebook SDK to build with the Ant build system. Facebook dropped Ant build support with version 4 in favor of Gradle (the build system used by Android Studio). To ensure compatibility with Corona, we’ve added Ant build support back to the Facebook SDK we distribute through Corona Enterprise.

The second concerns features that Facebook removed from their SDK in version 4, but are still needed by the Corona plugin. Specifically, Facebook removed the Friend and Place pickers from their SDK, but still use that code as part of their Scrumptious sample. Since we use those pickers for the Facebook Friends and Facebook Places options for facebook.showDialog(), we ported that code back into the Facebook SDK that we distribute through Corona Enterprise.

Ajay: thank you very much for a detailed answer!