This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
forked from restfb/restfb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGELOG
361 lines (316 loc) · 20.4 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
1.6.13 (Unreleased)
* Now support signed request parsing with new FacebookClient.parseSignedRequest().
Thanks to Josef Gierbl for the patch.
1.6.12 (March 10, 2013)
* Now support Graph API FQL endpoint with new FacebookClient.executeFqlQuery() and FacebookClient.executeFqlMultiquery().
FacebookClient.executeQuery() and FacebookClient.executeMultiquery() have been deprecated.
Thanks to Ofer Fort for the patch.
* Fixed "expires" parsing in AccessToken.fromQueryString().
Thanks to Chris Petersen.
* Added "can_upload" field to Album.
Thanks to Chris Petersen.
* Added "status_type" field to Post.
Thanks to Shaya Potter.
* It is possible for Facebook to return a Place's Location object as a String instead - added Place.getLocationAsString().
Thanks to Ido for finding this.
* Added "currency" field to User.
Thanks to Timo Maaranen for reporting this.
* Added "general_info" field to Page.
Thanks to Brendan Dahl for reporting this.
* Added "link", "subject", and "former_participants" fields to Conversation.
Thanks to spiffychick for reporting this.
* Added "shares" to Post.
Thanks to Mike Champion for the pull request.
* Added "attachments", "updated_time", "unread", and "unseen" fields to Message.
Thanks to S13_Alan for the patch.
* Fix for invalid Windows filename.
Thanks to Samuel Gélineau for the patch.
1.6.11 (September 7, 2012)
* New feature: you may annotate a method in a class mapped by JsonMapper with @JsonMappingCompleted.
Your method may be private and must take 0 parameters or 1 JsonMapper parameter.
This is useful for performing one-time actions after the JsonMapper has completed its work, e.g. massaging
JSON data into other formats.
* Bugfix: The message_tags field in Post could throw an exception when JsonMapper attempted to map it.
Thanks to Shaya Potter for reporting this.
1.6.10 (September 3, 2012)
* Potentially-breaking change: in the event of a Graph API 404 (like fetching an object with an id that doesn't exist, e.g. /XXX)
we now throw the correct FacebookOAuthException instead of FacebookNetworkException.
Thanks to oferiko for the bug report.
* Changed all network logging to use the new com.restfb.HTTP logger and now default to FINE instead of INFO
for normal requests/responses. This means you must explicitly enable logging to see what goes over the wire.
Thanks to Johno Crawford and Marcel Stoer.
* Added a new method to extend an existing Access Token: FacebookClient.obtainExtendedAccessToken(String appId, String appSecret, String accessToken).
See https://developers.facebook.com/roadmap/offline-access-removal/#extend_token for details.
Thanks to Chris Petersen for the initial patch.
* Added a new method to acquire an Application Access Token: FacebookClient.obtainAppAccessToken(String appId, String appSecret).
See https://developers.facebook.com/docs/authentication/applications for details.
Thanks to Chris Petersen for the initial patch.
* Added Andrew Liles' InsightUtils class, which provides a nice wrapper around querying for Insights data.
Thanks to Andrew Liles.
* Changed the signature of FacebookClient.deleteObject(String object) to FacebookClient.deleteObject(String object, Parameter... parameters)
to support parameterized deletion. This is a breaking change if you have a custom implementation of FacebookClient (should not be many of you).
Thanks to Nick Fenwick for the patch.
* FacebookOAuthException now includes an "errorCode" field since FB now returns one.
Thanks to connectvg for the bug report.
* FacebookOAuthException now includes an "httpStatusCode" field since it's helpful for client application error messaging.
Thanks to mtsahakis for the suggestion.
* DateUtils.toDateFromLongFormat(String date) now handles the case where FB occasionally returns the number of
seconds since the epoch instead of a yyyy-MM-dd'T'HH:mm:ssZ string.
Thanks to [email protected] for the bug report.
* Added the static method AccessToken.fromQueryString(String queryString), which encapsulates logic for parsing out
Facebook's "standard" access token query strings, e.g. 'access_token=XXX' or 'access_token=XXX&expires=YYY'.
Thanks to [email protected] for the suggestion.
* Can now map Java types to JSON if they have multiple @Facebook annotations for the same value (e.g. User's hometown fields).
Previously the mapper would throw an exception, now it picks one of the fields - it's luck of the draw which one is used.
This behavior may change later, this is a quick workaround to address the issue short-term.
Thanks to petermein for the bug report.
* Various changes to classes in com.restfb.types to reflect latest Facebook updates.
Thanks to Chris Petersen, Marcel Stoer, Mike Hazelwood, Marco Scavuzzo, Stefan Hauk, Mike Champion, nitinik, [email protected], and others.
1.6.9 (October 21, 2011)
* Bugfix for Connection page iteration.
Thanks to Takashi Kawachi for the patch.
1.6.8 (October 15, 2011)
* Now allow batch requests to specify "name" parameter and fixed a bug where request headers were not
being included in requests.
Thanks to jyorke.
* Added new "place" field to Post type.
Thanks to Chris Schilling.
* Added new "location" field to Page type.
Thanks to Fernando Padilla.
* Made several updates to the "education" field on the User type.
Thanks to Marcel Stoer and Silent Film.
* Fix for FB's inconsistent and undocumented behavior for returning "likes" and "comments" fields in StatusMessage.
Thanks to volkenborn.
* Moved to Github (https://github.com/revetkn/restfb) and back to an Ant-based build system for simplicity.
RestFB releases will still be pushed to Maven central, but RestFB itself will no longer use Maven.
1.6.7 (September 10, 2011)
* The Connection<T> constructor is now public and the class implements Iterable<List<T>>.
Thanks to kongo09, Andrew Liles, and everyone else who requested this.
* Fixed regression: re-added "comments" and "likes" fields to StatusMessage (FB docs are incorrect).
Thanks to nstratos and volkenborn for letting me know.
* Added "cover_photo" and "privacy" fields to Album.
Thanks to serg472 for the heads-up.
* Added "checkins" and "phone" fields to Page.
Thanks to jaiswal.rahul for the heads-up about the "checkins" field.
* Added an example project which shows how to route java.util.logging calls to Log4j.
It's available at http://restfb.com/examples/RestFB%20Log4j%20Example.zip
Thanks to Daniel Longosz for asking about this.
1.6.6 (July 12, 2011)
* Fixes a bug introduced in 1.6.5 where facebookClient.delete(...) would throw an NPE.
Thanks to Garret Collins.
1.6.5 (July 4, 2011)
* BREAKING CHANGE:
We are no longer passing around InputStream objects to represent binary files when publishing -
they have been replaced by instances of the new com.restfb.BinaryAttachment type.
So this method:
<T> T FacebookClient.publish(String connection, Class<T> objectType, InputStream inputStream, Parameter... parameters)
is now:
<T> T FacebookClient.publish(String connection, Class<T> objectType, BinaryAttachment binaryAttachment, Parameter... parameters)
This change was necessary to support correct video uploads (FB now requires a filename with a video extension, e.g. .mov) and the new Batch API.
Documentation and usage examples for com.restfb.BinaryAttachment are available on http://restfb.com.
* Added support for the new Batch API. The two new methods are:
List<BatchResponse> FacebookClient.executeBatch(BatchRequest... batchRequests)
List<BatchResponse> FacebookClient.executeBatch(List<BatchRequest> batchRequests, List<BinaryAttachment> binaryAttachments)
Thanks to everyone who asked for this!
* Added support for the new video upload API endpoint via https://graph-video.facebook.com and fixed a multipart
filename bug that broke video uploads.
Thanks to [email protected] for the filename bugfix and [email protected] and everyone else who asked for this!
* All types under com.restfb.types now implement Serializable.
Thanks to everyone who asked for this!
* Fixed a numeric precision bug in JsonObject.getLong() which caused large numbers to be rounded incorrectly.
Thanks very much to [email protected] for finding this and providing a patch.
* DefaultJsonMapper can now instantiate types with no-argument constructors that are private, protected, or package-private -
you no longer have to expose your constructors if you don't want to.
* JsonMapper.toJson(Object object, boolean ignoreNullValuedProperties) was added, which enables you to turn a Java object into
JSON without including any properties with null values.
* Added "comments", "likes", "position", and "images" fields to Photo.
Thanks to Andre Oosthuizen and Grace Win.
* Added "name", "tags", and "source" fields to Video and marked "message" as deprecated.
Thanks to Andre Oosthuizen and Marcel Stoer.
* Added "likes" and "access_token" fields to Page and deprecated "fan_count".
Thanks to Shashank Agarwal and jspyeatt.
* Added "object_id" field to Post.
Thanks to Grace Win.
* Added "username" field to User.
Thanks to Iwan Gulenko.
* Added "city", "state", and "country" fields to Checkin.Place.Location.
Thanks to Thom Nichols.
* Removed "messages" and "likes" fields from StatusMessage because they're now connections.
Added the "type" field to StatusMessage.
Thanks to [email protected].
1.6.4 (March 5, 2011)
* Added "application" and "type" fields to Post.
Thanks to nelrib.
* Removed "mobilePhone" and "address" fields from User.
Thanks to Marcel Stoer.
* Added undocumented "properties" field to Post type.
1.6.3 (February 19, 2011)
* RestFB now automatically uses the faster read-only endpoints for Graph and Old REST API calls when possible.
Thanks to Dmitry Naumenko for the suggestion.
* POTENTIALLY BREAKING CHANGE: Old REST API calls (including FQL with the Graph API) will now throw
FacebookOAuthException instead of FacebookResponseStatusException when error code 190 is encountered.
Thanks to Ofer Fort for the suggestion.
* It is now simple to customize how RestFB maps Facebook error responses to FacebookException instances
for both Graph and Old REST API errors by overriding DefaultFacebookClient.createGraphFacebookExceptionMapper() and
BaseFacebookClient.createLegacyFacebookExceptionMapper(), respectively. The default instances returned
by both of these methods are now marked protected instead of anonymous classes so you can leverage them if you wish.
Thanks to Alexis Dufrenoy for the suggestion.
* Added lots of new fields to User, e.g "sports" and "languages".
Thanks to Patrick Alberts for the patch.
* Added new PageConnection type, useful for mapping partial page types returned by some connections, e.g. "me/music".
Thanks to Patrick Alberts for the patch.
* Added undocumented "is_community_page" and "description" fields to the Page type.
Thanks to Ivan Viragine.
* Can now customize HttpURLConnection creation in DefaultWebRequestor by overriding openConnection(URL url)
to support custom proxying etc.
Thanks to Matti Haro for the suggestion.
* Added new Insight type which can be used like this:
Connection<Insight> insights = facebookClient.fetchConnection("PAGE_ID/insights", Insight.class);
1.6.2 (January 23, 2011)
* You can now instruct DefaultJsonMapper how to handle mapping exceptions, e.g.
ignoring them and mapping as null instead of throwing an exception.
FacebookClient facebookClient = new DefaultFacebookClient("MY_ACCESS_TOKEN",
new DefaultWebRequestor(), new DefaultJsonMapper(new JsonMappingErrorHandler() {
public boolean handleMappingError(String unmappableJson, Class<?> targetType, Exception e) {
// Here you might log the fact that JSON mapping failed.
err.println(format("Uh oh, mapping %s to %s failed...", unmappableJson, targetType));
// Returning true tells the mapper to map this JSON as null and keep going.
// Returning false tells the mapper to throw an exception.
return true;
}
}));
The default behavior is still to throw an exception immediately on mapping errors,
this callback interface is your way of saying "I know what I'm doing and want to
handle errors myself". Very useful for keeping your app running in production
when Facebook changes the API unexpectedly.
Thanks to Igor Kabiljo for the suggestion.
* Added new "quotes" and "address" and "mobile_phone" fields to the User type.
Thanks to ne52 for the heads-up about the addition of the quotes field.
* DateUtils.toDateFromMonthYearFormat now returns null for "0000-00" instead of 0 AD.
Not sure why FB gives us 0000-00 instead of null in some situations, e.g. work start date.
1.6.1 (unofficial release)
* We're now fully Mavenized - you can add RestFB to your Maven project like this:
<dependency>
<groupId>com.restfb</groupId>
<artifactId>restfb</artifactId>
<version>1.6.2</version>
</dependency>
Many thanks to Kalle Korhonen, and congratulations to him for being the first additional RestFB committer!
* JsonException is now unchecked.
* Fix for start and end date handling on the Event type.
Thanks to Jason Peltzer.
* @Facebook annotation on accessToken on Account type is now correctly mapped to "access_token".
Thanks to Scott Aaron.
* Added the "category" field to the Checkin.Place type.
Thanks to Mattia Tommasone.
* Latitude and Longitude fields on Checkin.Place are now of type Double instead of Float,
thereby supporting the full precision of the data returned by FB instead of truncating to fit correctly in a Float.
1.6 (December 30, 2010)
* POTENTIALLY BREAKING CHANGE: User.getPicture() has been removed.
To get the user's picture, simply construct a URL by hand, e.g. http://graph.facebook.com/USER_ID/picture
* Now use java.util.logging instead of Log4j - RestFB now has 0 dependencies.
* FacebookException now extends RuntimeException - you no longer have to catch it if you don't want to.
Thanks to Jeff Schnitzer.
* Removed "contains" attribute on @Facebook annotation since it is no longer necessary.
Thanks to Igor Kabiljo for the initial patch.
* Exposed and cleaned up previously-internal RestFB's repackaged JSON.org code in the new com.restfb.json package.
* You may now tell JsonMapper to map to JsonObject, which permits you to have total control over result mapping at run time
(as opposed to the compile-time-only @Facebook annotation).
* JsonMapper now supports having a Facebook JSON field mapped to multiple @Facebook-annotated Java fields.
This addresses the issue of Facebook returning the same field name but differently-structured data in certain situations.
See issues 56 and 90 for details.
Thanks to Daniel Winterstein, Igor Kabiljo, Marcel Stoer, Pramod Biligiri, and Tom Schindl for their input.
* Exposed and cleaned up previously-internal RestFB utilities in the new com.restfb.util package.
* Added new exception package com.restfb.exception and exception types
(FacebookOAuthException, FacebookQueryParseException) for simple handling of common Graph API exception types.
Thanks to Jeff Schnitzer.
* Added formal support for Connection paging by URL via FacebookClient.fetchConnectionPage() and the new Connection.getPreviousPageUrl()/getNextPageUrl().
No more manual offset calculation required. Example:
Connection<Post> myFeed = facebookClient.fetchConnection("me/feed", Post.class);
if(myFeed.hasNext()) {
Connection<Post> myFeedPage2 = facebookClient.fetchConnectionPage(myFeed.getNextPageUrl(), Post.class);
...
}
Thanks to Jakub Danilewicz.
* Added FacebookClient.convertSessionKeysToAccessTokens() method.
Thanks to Scott Hernandez and Mattia Tommasone.
* Fixed issue where User.birthday causes mapping to fail if "show only month & date" is set on FB.
Thanks to Kalle Korhonen.
* Old REST API now always uses the HTTPS endpoint.
Thanks to Christopher Oestlund.
* Added embed_html, picture, icon, comments to Video type.
Thanks to Fahd Akbar and Chris Pruett.
* Added Account type to support impersonation feature.
Thanks to jovanovich.
* Fixed error-handling issues: 1) where HTTP 400 error code would throw an incorrect exception and 2) where error response JSON would not get
correctly read in this and other error situations.
Thanks to Igor Kabiljo, ovonick, and everyone else who reported this.
* Performance enhancement: ReflectionUtils now caches @Facebook field information so we never have to reflect more than once.
Thanks to Igor Kabiljo for the patch.
* Added Checkin type.
Thanks to everyone else who requested this and Colin Britton for the checkin code snippet.
* Added StatusMessage type.
* Added middle_name field to User type.
Thanks to Fehmican Saglam.
1.5.4 (September 16, 2010)
* Post comment type now handles case where FB returns an empty array instead of an object type.
Thanks to Pipo, CR, S13_Alan, Igor Kabiljo, and Jakub Danilewicz.
1.5.3 (July 21, 2010)
* NamedFacebookType now handles situation where FB returns, for example,
"hometown":"Beograd", instead of the expected "hometown":{"id":123,"name":"Belgrade, Serbia"}
Thanks to Igor Kabiljo for the bug report and suggested fix.
* Mapper now gracefully handles situation where Facebook returns the not-JSON string "false" and instead of {}.
Thanks to Igor Kabiljo for the bug report and suggested fix.
* The Post type's comments field changed on the Facebook side to include a "count" field.
Thanks to Jakub Danilewicz for the bug report and suggested fix.
Thanks to Igor Kabiljo for the suggested fix.
* Fixed infinite recursion bug that was triggerable in exceptional situations in ReflectionUtils.toString().
Thanks to Igor Kabiljo for the bug report and suggested fix.
* Mapper fix for situations where Facebook returns the string "null" instead of an empty object or nothing.
Thanks to Igor Kabiljo for the bug report.
* Timezone field in User is now a Double to account for timezones with fractional offsets.
Thanks to Sam for the bug report.
* Changed Parameter's date marshaling to produce Facebook Date strings in a zero-based hour format.
Thanks to Jakub Danilewicz for the bug report and suggested fix.
* Connection<?> has getNext() and getPrevious() methods that return the next/previous URLs returned by Facebook.
* All fields in BaseFacebookClient, DefaultFacebookClient, and DefaultLegacyFacebookClient are protected for easier subclassing.
All Facebook API URLs are now overridable via protected accessor methods.
Thanks to Kalle Korhonen and bijuphilip0 for the enhancement requests.
* Added locale field to User.
1.5.2 (June 8, 2010)
* No longer require an access token for the Graph API (now have a default constructor for DefaultFacebookClient).
Thanks to Yoav Shapira for the enhancement request.
* Facebook changed the data in the Photo Tag object - updated to reflect that.
Thanks to Max for reporting.
* Facebook added fields to the User object - updated to reflect that.
Thanks to fellahst and ndimiduk for reporting.
* HTTP GET operations executed by DefaultWebRequestor now use httpUrlConnection.setUseCaches(false).
Thanks to Jumpa for reporting this.
* Special check to only URL-encode access token if it's not already URL-encoded.
1.5.1 (May 14, 2010)
* OAuth support broke in DefaultLegacyFacebookClient because Facebook changed the "token" param to "access_token".
Thanks to Antonio Casula for the initial problem report.
1.5 (May 1, 2010)
* Added support for the new Facebook Graph API
* Old REST API now has support for the new OAuth authentication tokens
* Fix for multiqueries with empty resultsets throwing a JSON mapping exception
* WebRequestor now supports POSTs which perform file uploading and GETs
* The com.restfb.json undocumented package is now gone. The org.json code is now package-private inside of com.restfb
* Many small bugfixes and enhancements
* Enhanced examples and documentation
Thanks to Ofer Fort, Ryan Wilson, and Alex Launi for their input.
1.4 (April 21, 2010)
* Added support for Java -> JSON mapping to support more complex API calls like stream.publish.
Thanks to Alex Launi and [email protected] for their input.
1.3 (March 19, 2010)
* In response to recent FB changes, JSON mapper now coerces empty JSON arrays to empty Java Strings if you're trying to map to a String field.
Thanks to Antonello Naccarato for reporting this!
1.2 (March 2, 2010)
* Fixed bug related to mapping JSON null to Java types
* Library source is now included in the JAR for easy browsing in your IDE
1.1 (February 23, 2010)
* Formal support for fql.multiquery API call
* Minor JSON mapping fixes and error message improvements
* Updated website with fql.multiquery documentation and explicit mention of non-support of session key acquisition
1.0 (February 2, 2010)
* Initial release