프로그래밍/Spring

[Spring Social Facebook] Error message is (#12) bio field is deprecated for versions v2.8 and higher

AkaGeun 2018. 6. 19. 13:29

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.


1. 문제

 - spring-social-facebook:2.0.3 에서 'PROFILE_FIELDS' 내 bio 필드가 있어서 안됨. (위 내용 참고)

 - https://developers.facebook.com/docs/graph-api/changelog


 1) 해결법

  - 기존소스 

Connection<Facebook> connection = facebookConnectionFactory.createConnection(accessGrant);
Facebook facebook = connection.getApi();
User userProfile = facebook.userOperations().getUserProfile();

 - 변경 소스

Connection<Facebook> connection = facebookConnectionFactory.createConnection(accessGrant);
Facebook facebook = connection.getApi();
String [] fields = { "id", "email", "first_name", "last_name" };
User userProfile = facebook.fetchObject("me", User.class, fields);


2. 가능한 필드

{
"id",
"about",
"age_range",
"birthday",
"context",
"cover",
"currency",
"devices",
"education",
"email",
"favorite_athletes",
"favorite_teams",
"first_name",
"gender",
"hometown",
"inspirational_people",
"installed",
"install_type",
"is_verified",
"languages",
"last_name",
"link",
"locale",
"location",
"meeting_for",
"middle_name",
"name",
"name_format",
"political",
"quotes",
"payment_pricepoints",
"relationship_status",
"religion",
"security_settings",
"significant_other",
"sports",
"test_group",
"timezone",
"third_party_id",
"updated_time",
"verified",
"video_upload_limits",
"viewer_can_send_gift",
"website",
"work"
}


참고 링크

https://stackoverflow.com/questions/39890885/error-message-is-12-bio-field-is-deprecated-for-versions-v2-8-and-higher