Facebook 视频上传限制 - Spring 社会问题
Facebook Video Upload Limits - Spring Social Issue
我们使用的是 Spring Social Facebook API
,最新版本 (2.02)。它工作正常,直到今天。 Facebook 似乎将 Video Upload Limits
的返回值从 Integer
更改为 Long
。
有人遇到同样的问题吗?
我想确定这是否是由于 Facebook API 更改而造成的问题。
提前致谢。
从这里回答:
@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();
}
}
此解决方法已在实时环境中进行测试。
请注意,此问题已得到报告、确认和修复。参见 https://jira.spring.io/browse/SOCIALFB-198。
即将发布维护版本,可能是今天。
在此期间,如果上述解决方法有效,请暂时使用它。
我们使用的是 Spring Social Facebook API
,最新版本 (2.02)。它工作正常,直到今天。 Facebook 似乎将 Video Upload Limits
的返回值从 Integer
更改为 Long
。
有人遇到同样的问题吗?
我想确定这是否是由于 Facebook API 更改而造成的问题。
提前致谢。
从这里回答:
@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();
}
}
此解决方法已在实时环境中进行测试。
请注意,此问题已得到报告、确认和修复。参见 https://jira.spring.io/browse/SOCIALFB-198。
即将发布维护版本,可能是今天。
在此期间,如果上述解决方法有效,请暂时使用它。