Greg Robbins
unread,Jun 30, 2009, 7:36:39 PM6/30/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gdata-objec...@googlegroups.com
I have submitted to the repository he API changes discussed a few months ago. This will break the build of all current applications using the API from the top-of-trunk.
Fixing your app should take roughly 5 minutes per fetch call. The changes will make your code a bit simpler and shorter as well.
The library changes are:
1. Service-specific calls (like fetchContactFeed, fetchDocsFeed, etc) have been removed. Rather, all fetch calls are now done using common methods (like fetchFeedWithURL: and fetchQueryWithURL:).
2. Non-authenticated methods in GDataServiceBase now have "public" in their names, such as "fetchPublicFeedWithURL:".
3. The fetch for updating an entry may now be called without an explicit entry URL. The edit link of the entry being updated will be used instead.
4. Each fetch call now requires a single selector for the callback, rather than two; that selector's method is invoked for both success and failure.
Fixing your app will be easy, since the compiler will flag the fetch calls in your code as errors. To make your app compatible with the revised API:
1. Look at the service class's header file for the new fetch calls to use.
For example, GDataServiceGoogleDocs no longer has a method -fetchDocsFeedWithURL:.
Instead, GDataServiceGoogleDocs.h has a comment showing the method to use instead, -fetchFeedWithURL:.
2. Combine the sucess and failure callbacks. The new callback signatures should match this for feed fetches:
- (void)ticket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedBase *)feed error:(NSError *)error;
or this for entry fetches:
- (void)ticket:(GDataServiceTicket *)ticket finishedWithEntry:(GDataEntryBase *)entry error:(NSError *)error;
The type of the object passed to the callback will be specific to the fetch. For example, for fetches of Calendar feeds, the second parameter of the callback will always be an instance of the class GDataFeedCalendar.
Typically, your callback will first test if the error is nil; if error is nil, then the fetch succeeded. For example, a Google Docs document list feed callback would look like
- (void)docListTicket:(GDataServiceTicket *)ticket
finishedWithFeed:(GDataFeedDocList *)feed
error:(NSError *)error {
if (error == nil) {
// succeeded
} else {
// failed
}
}
All of the library's example apps have been updated as well, so you can refer to those to see usage of the revised API.
These changes should both benefit client apps (with simpler code) and reduce the library size (avoiding unneeded service-specific fetch code.)
I hope these changes will be easy for every application. Please let us know if you encounter any issues.