0

We are using the Spring Social Facebook API, with the latest release (2.02). It was working ok, till today. It seems like Facebook change the returned value of Video Upload Limits from IntegertoLong. Does somebody have the same problem?

I want to be sure if this is an issue created because of the Facebook API changes or not.

Thanks in advance.

m.aibin
  • 3,528
  • 4
  • 28
  • 47
  • 2
    Yes, they changed it and a fix was also committed to the repository, but there is no new version of the library. If you do not need to use the video upload limits, than use this workaround: http://stackoverflow.com/a/34133450/1943228 – kamwo Dec 07 '15 at 21:35
  • we also found a workaround: https://lingohub.com/blog/2015/12/workaround-for-broken-facebook-oauth-using-spring-social/ ;) – Betty St Dec 09 '15 at 11:37

2 Answers2

1

Be aware that this issue has already been reported, confirmed, and fixed. See https://jira.spring.io/browse/SOCIALFB-198.

A maintenance release is forthcoming, possibly today.

In the meantime, if the workaround described above works, then feel free to use it temporarily.

Craig Walls
  • 2,080
  • 1
  • 12
  • 13
0

Answer from here: Spring social facebook login error - Numeric value out of range of int

@PostConstruct
private void init() {
    // hack for the facebook login
    try {
        String[] fieldsToMap = {
                "id", "about", "age_range", "address", "bio", "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", "viewer_can_send_gift",
                "website", "work"
        };

        Field field = Class.forName("org.springframework.social.facebook.api.UserOperations")
                .getDeclaredField("PROFILE_FIELDS");
        field.setAccessible(true);

        Field modifiers = field.getClass().getDeclaredField("modifiers");
        modifiers.setAccessible(true);
        modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL);
        field.set(null, fieldsToMap);

    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

This workaround has been tested in live environment.

Community
  • 1
  • 1
m.aibin
  • 3,528
  • 4
  • 28
  • 47