【问题标题】:Facebook Video Upload Limits - Spring Social IssueFacebook 视频上传限制 - 春季社交问题
【发布时间】:2015-12-07 21:34:28
【问题描述】:

我们使用的是最新版本 (2.02) 的 Spring Social Facebook API。它工作正常,直到今天。 Facebook 似乎将Video Upload Limits 的返回值从Integer 更改为Long。 有人有同样的问题吗?

我想确定这是否是由于 Facebook API 更改而产生的问题。

提前致谢。

【问题讨论】:

标签: java spring facebook spring-social


【解决方案1】:

请注意,此问题已被报告、确认和修复。见https://jira.spring.io/browse/SOCIALFB-198

维护版本即将发布,可能在今天。

同时,如果上述解决方法有效,请暂时使用它。

【讨论】:

    【解决方案2】:

    从这里回答: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();
        }
    }
    

    此解决方法已在实际环境中进行了测试。

    【讨论】:

      猜你喜欢
      • 2014-09-21
      • 1970-01-01
      • 2017-04-10
      • 2015-07-07
      • 1970-01-01
      • 2015-01-07
      • 2016-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多