0

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));
  • looks like the exact same issue (old spring framework trying to get the bio field, which is deprecated) – andyrandy Dec 01 '16 at 09:01
  • you should ask for help in the comments of the accepted answer, if that one really does not work for you it will help others too. – andyrandy Dec 01 '16 at 09:02

0 Answers0