Graph API v2.1 Upgrade Notice

Hi!

I received this message from Facebook:

... has been making recent API calls to Graph API v2.0, which will reach the end of the 2-year deprecation window on Monday, August 8, 2016. Please migrate all calls to v2.1 or higher in order to avoid potential broken experiences.

But my app use facebook-v4 plugin: why this message?  Facebook-v4 Plugin uses v2.0 api?

Thank you

There is a similar conversation towards the bottom of this page. https://forums.coronalabs.com/topic/62259-facebook-login-on-ios-always-cancels-the-very-first-login-attempt/

Actually that thread is for a different Facebook issue. To avoid continuing to hijack that thread, I’ve pointed the Graph 2.0 warning message conversation to continue here.

Here’s what we know.

Facebook (legacy) should be using 2.1 end points. Facebook V4 is most likely using even later API endpoints. Most people getting this seem to be getting it from older apps that were probably made before the legacy Facebook plugin got updated.

Do you have other older apps or is it specifically complaining about the app you’re currently building?

Thanks

Rob

I’ve been using Gradle for a few months now, so instead of copying the sdk files in manually I had this in my build.gradle file:

compile 'com.facebook.android:facebook-android-sdk:3.+'

My understanding is that this should fetch the latest 3.x version of the sdk, and all seems to work fine despite these warning messages I’ve had from Facebook. I much prefer using this gradle method because it means I don’t have to manually copy all of the jars+resource files to my project manually. I’m wondering whether Ajay or anyone else knows whether this should be fetching the correct version of the sdk, or is the facebook_sdk jar that can be found in Corona’s plugins folder altered in some way that means I would need to use that version?

If the gradle method is ok, I’m wondering whether the warnings are being generated by user’s who are using older versions of our apps. What would be helpful is knowing where I can look inside the jar file to see which version it is using, if anyone knows?

I have only one app (published on Android & iOS market) linked to this Facebook App. In my app use this Facebook API:

facebook.login(facebookListener,{"user\_friends”}) facebook.setFBConnectListener(facebookListener) facebook.getCurrentAccessToken() facebook.isActive facebook.request("me", "GET", {fields="id,name,picture.type(large)"}) facebook.request("me/friends", "GET", {fields="id,name,picture.type(large)"}) facebook.logout() facebook.showDialog("requests", {filter="APP\_NON\_USERS", message=message, title=title}) facebook.showDialog("feed", {name=name, description=description, link=link, picture=picture}) facebook.showDialog("requests", {app\_id=fbAppID, message=message, title=title}) facebook.request("me/friends", "GET", {fields="id,name,picture.type(large)"})

 Thank you

Thanks for following up. How long as your app been out? Could this be a case of someone with an older version having not updated? I’m trying to isolate the problem.

Thanks

Rob

See:

https://developers.facebook.com/docs/android/change-log-3.x/#ver3_20_0

https://developers.facebook.com/docs/android/downloads

The v3.20 of the SDK targets v2.2 of the Graph API, but v3 is deprecated: https://developers.facebook.com/docs/android/deprecated

 

You should import last sdk:

// Facebook #################################################################################### compile('com.facebook.android:facebook-android-sdk:4.13.0') { exclude group: 'com.android.support', module: 'support-v4' }

I release the apps on the store Mar 25, 2016, and I used the public release 2016.2830 (I used daily building only for development)

Alan – i’ve been using the 4.5.0 source that is part of the enterprise distribution.  My understanding was that there were some tweaks but I’ve never seen anything specific about what.

There’s no need to copy anything, you can just make it a dependency in gradle.  I posted the steps in the Enterprise forum.

I have the same notice from facebook. I also released in March with build 2016.2830.  What is exactly the issue? should i rebuild the game with a daily build?

We are still investigating.

I’ve just double checked and the version that is being pulled into my project through Gradle is 3.23.1. Since Simone Valenti says that 3.20 supports Graph 2.2, I assume my projects are in fact calling 2.2 as well, and the warning messages are from older builds which users have not updated.

I’ll take a look at nandgate’s suggestion about updating to v4, however myself and others have been experiencing problems with the v4 plugin.

Hi everyone,

Looks like there’s lots of lingering questions in this thread, so I’ll do what I can to address most (if not all) of them.

  1. Why did I get a warning about upgrading to Graph API v2.1?

If you haven’t seen it already, here’s the bug report to Facebook on the issue: https://developers.facebook.com/bugs/1634445133540643/

Here’s the important part:

  • “If your app’s minimum API version is v2.1 or above (you can verify this in the app settings “Dashboard” page), you don’t need to do anything, and you can ignore this alert. If your app’s minimum API version is v2.0, we recommend that you vet your app’s code and look for Platform Integrations (API calls) that explicitly use v2.0. You can then proceed to upgrade those. If you are certain that you are not using v2.0, you can also ignore this alert.”

As Rob mentioned, Facebook-v4 uses Graph API endpoints higher than version 2.0. Moreover, Facebook SDK version 4 and Graph API version 2.3 were introduced at the same time per this blog post, meaning that anyone using the Facebook-v4 plugin at any point would be making calls to Graph API version 2.3 at the earliest.

The following comments are assuming you haven’t attempted to manually override what version of the Graph API you’re calling by doing something like facebook.request( “v2.0/other/graph/path/stuff” ):

  • All that being said, if you’re using the Facebook-v4 plugin , you can  ignore the message.
  • Similarly, if you’re using the legacy Facebook plugin , but your app’s minimum API version is v2.1 or greater , you can  ignore the message.
  • If you’re using the legacy Facebook plugin , but your app’s minimum API version is lower than v2.1 , you should upgrade your app to at least use the latest version of the legacy Facebook plugin, which will convert your Graph API calls to target version 2.1.

Lastly, if you have attempted to manually override the Graph API version being used, those calls should be upgraded to at least version 2.1, i.e. facebook.request( “v2.1/other/graph/path/stuff” ).

  1. Is Corona’s version of the Facebook SDK altered in a way where it must be used for Enterprise users wanting Facebook-v4?

On iOS , we currently don’t have any modifications to the Facebook SDK such that you must use the version we distribute with Corona Enterprise.

On Android , there are modifications, but whether you need to use this version depends on what you’re doing with the plugin and what API Levels you want to target. The two biggest modifications we’ve made are:

  • Porting in the Facebook Places and Facebook friends dialogs.
  • Restoring support for API Levels 10-14.

For Enterprise users, this means that you  must use our forked Facebook SDK for Android for the following:

  • Making calls to facebook.showDialog( “place” ) or facebook.showDialog( “friends” )
  • Having your app run on Android 2.3.3 - 4.0.2.
  1. Where in the facebook_sdk.jar file can I find version info?
  • The Facebook SDK version number is in the com.facebook.FacebookSdkVersion.class file. It should be the public static final String BUILD constant.
  • The Graph API version number is in the com.facebook.internal.ServerProtocol.class file. It should be the public static final String GRAPH_API_VERSION constant.
  1. How do I integrate Facebook-v4 using Android Studio?

nandgate’s instructions posted here are on par with improvements we’re making to the process. One change I’d recommended is to target SDK version 23 instead of 21, since the Corona core targets version 23.

While this is still a work in progress, anyone who is interested can try integrating our forked Facebook SDK available on GitHub.

  1. Why are there so many issues with the Facebook-v4 plugin?

A lot of this comes down to manpower. Facebook can make changes faster than we can keep up with them. Many of the recent Facebook-v4 developments (outside of investigating bugs) have been aimed at making maintenance of the plugin easier for everyone. Transitioning our Facebook SDK fork for Android over to GitHub is a part of this process.

There is a similar conversation towards the bottom of this page. https://forums.coronalabs.com/topic/62259-facebook-login-on-ios-always-cancels-the-very-first-login-attempt/

Actually that thread is for a different Facebook issue. To avoid continuing to hijack that thread, I’ve pointed the Graph 2.0 warning message conversation to continue here.

Here’s what we know.

Facebook (legacy) should be using 2.1 end points. Facebook V4 is most likely using even later API endpoints. Most people getting this seem to be getting it from older apps that were probably made before the legacy Facebook plugin got updated.

Do you have other older apps or is it specifically complaining about the app you’re currently building?

Thanks

Rob

I’ve been using Gradle for a few months now, so instead of copying the sdk files in manually I had this in my build.gradle file:

compile 'com.facebook.android:facebook-android-sdk:3.+'

My understanding is that this should fetch the latest 3.x version of the sdk, and all seems to work fine despite these warning messages I’ve had from Facebook. I much prefer using this gradle method because it means I don’t have to manually copy all of the jars+resource files to my project manually. I’m wondering whether Ajay or anyone else knows whether this should be fetching the correct version of the sdk, or is the facebook_sdk jar that can be found in Corona’s plugins folder altered in some way that means I would need to use that version?

If the gradle method is ok, I’m wondering whether the warnings are being generated by user’s who are using older versions of our apps. What would be helpful is knowing where I can look inside the jar file to see which version it is using, if anyone knows?

I have only one app (published on Android & iOS market) linked to this Facebook App. In my app use this Facebook API:

facebook.login(facebookListener,{"user\_friends”}) facebook.setFBConnectListener(facebookListener) facebook.getCurrentAccessToken() facebook.isActive facebook.request("me", "GET", {fields="id,name,picture.type(large)"}) facebook.request("me/friends", "GET", {fields="id,name,picture.type(large)"}) facebook.logout() facebook.showDialog("requests", {filter="APP\_NON\_USERS", message=message, title=title}) facebook.showDialog("feed", {name=name, description=description, link=link, picture=picture}) facebook.showDialog("requests", {app\_id=fbAppID, message=message, title=title}) facebook.request("me/friends", "GET", {fields="id,name,picture.type(large)"})

 Thank you

Thanks for following up. How long as your app been out? Could this be a case of someone with an older version having not updated? I’m trying to isolate the problem.

Thanks

Rob

See:

https://developers.facebook.com/docs/android/change-log-3.x/#ver3_20_0

https://developers.facebook.com/docs/android/downloads

The v3.20 of the SDK targets v2.2 of the Graph API, but v3 is deprecated: https://developers.facebook.com/docs/android/deprecated

 

You should import last sdk:

// Facebook #################################################################################### compile('com.facebook.android:facebook-android-sdk:4.13.0') { exclude group: 'com.android.support', module: 'support-v4' }

I release the apps on the store Mar 25, 2016, and I used the public release 2016.2830 (I used daily building only for development)