I used version 2.0.3.RELEASE of spring-social-facebook and Facebook app api v2.8.
I called Facebook login but returned this message.
“(#12) bio field is deprecated for versions v2.8 and higher”
How can i fix this?
Question posted in Facebook API
The official documentation for the Facebook APIs can be found here.
The official documentation for the Facebook APIs can be found here.
9
Answers
I got the same error, 2.0.3.RELEASE of spring-social-facebook seems to be not compatible with v2.8 Facebook API version (released yesterday). Reading from facebook changelog for the v2.8 (https://developers.facebook.com/docs/apps/changelog):
User Bios – The bio field on the User object is no longer available. If the bio field was set for a person, the value will now be appended to the about field.
I think we have to wait a new release of spring-social-facebook library. In the release 2.0.3 (in the interface org.springframework.social.facebook.api.UserOperations) there is the “bio” field in the PROFILE_FIELDS constant and it is not supported in the v2.8 facebook API version.
UPDATE: I found a workaround in my case:
BEFORE:
AFTER
Here a complete list of field you could use:
Workaround for JHipster. Add the following snippet into your
SocialService
class untilspring-social-facebook
is fixed.Source: https://github.com/jhipster/generator-jhipster/issues/2349 – minus
bio
infieldsToMap
array.This has been fixed in new release of spring-social-facebook. Please add the following to your pom.xml
If you get error that this version is not available, add the following as well.
Under grails spring security facebook I had a similar issue and
thanks to @user6904265 I have managed to get it working:
Basically the default provided example above states
User.class
. This running locally was unable to find fields such as last_name etc and gave a list it could query. Those provided options were from the actual spring security User class (default to my app) so ensure you also look up correct user classes.I had problems with the new version of spring-social-facebook. To fix this using version 2.0.3.RELEASE paste the following code in your SocialService.java
This code will not try to retrieve bio field from Facebook.
You can see more details here: https://github.com/jhipster/generator-jhipster/issues/2349
remove the parameter ->”bio” from your api call url, for me it solved
before
“https://graph.facebook.com/v2.7/me/?fields=name,picture,work,website,religion,location,locale,link,cover,age_range,bio,birthday,devices,email,first_name,last_name,gender,hometown,is_verified,languages&access_token=“
after
“https://graph.facebook.com/v2.7/me/?fields=name,picture,work,website,religion,location,locale,link,cover,age_range,birthday,devices,email,first_name,last_name,gender,hometown,is_verified,languages&access_token=“
I copied interface UserOperations in my project changing PROFILE_FIELDS removing bio field. On Tomcat, my edited class takes priority over org.springframework.social.facebook.api.UserOperations interface and this fix the problem. (see last rows of below file)
}