Error message is (#12) bio field is deprecated for versions v2.8 and higher

后端 未结 9 1306
南旧
南旧 2020-12-01 09:31

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 vers

9条回答
  •  攒了一身酷
    2020-12-01 09:52

    Under grails spring security facebook I had a similar issue and thanks to @user6904265 I have managed to get it working:

    //This was provided example method:
    //org.springframework.social.facebook.api.User fbProfile = facebook.userOperations().userProfile
    //This is the groovy way of declaring fields:
    String[] fields = ['id',"email", "age_range", "birthday","first_name",
                        "last_name","gender"]  as String[]
    //This bit pay attention to the User.class segment. 
    org.springframework.social.facebook.api.User fbProfile = 
    facebook.fetchObject("me", 
    org.springframework.social.facebook.api.User.class, fields)
    

    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.

提交回复
热议问题