I'm following the guide, https://spring.io/guides/gs/accessing-facebook/
and error is occur.
org.springframework.social.UncategorizedApiException: (#12) bio field is deprecated for versions v2.8 and higher
This is my Controller code.
@Controller
@RequestMapping("/")
public class HelloController {
private Facebook facebook;
private ConnectionRepository connectionRepository;
public HelloController(Facebook facebook, ConnectionRepository connectionRepository) {
this.facebook = facebook;
this.connectionRepository = connectionRepository;
}
@GetMapping
public String helloFacebook(Model model) {
if (connectionRepository.findPrimaryConnection(Facebook.class) == null) {
return "redirect:/connect/facebook";
}
String[] fields = {"id", "email", "first_name"};
User user = facebook.fetchObject("me", User.class, fields);
//System.out.println(user.getFirstName());
model.addAttribute("facebookProfile", facebook.fetchObject("me", User.class, fields));
//PagedList<Post> feed = facebook.feedOperations().getFeed();
//model.addAttribute("feed", feed);
return "home";
}
}
I also saw Error message is (#12) bio field is deprecated for versions v2.8 and higher
and modified, but seems not to work.
There is also same error after I commented this lines.
User user = facebook.fetchObject("me", User.class, fields);
model.addAttribute("facebookProfile", facebook.fetchObject("me", User.class, fields));