GoogleReaderAPI-iOS
GoogleReaderAPI-iOS copied to clipboard
Reply for getSubscriptionsList interpreted as a feed
Hello,
if you try using getSubscriptionsList method you discover it doesn't work. Google sends back the subscription list as a JSON object, but the code tries to interpret it as an RSS feed. A quick fix to connectionDidFinishLoading method did the job, most of the code was already there. Here it is:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"------------------------------- connectionDidFinishLoading: %d", [responseData length]);
// check if data is JSON parsable
NSString *JSONString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSError *jsonerr = nil;
NSDictionary *JSONdict = [JSON objectWithString:JSONString error:&jsonerr];
if (!jsonerr) {
[delegate GoogleReaderRequestDidLoadJSON:JSONdict];
return;
}
MWFeedParser *parser = [[MWFeedParser alloc] initWithData:responseData];
parser.delegate = self;
[parser parse];
//NSLog(@"responseData: %@", JSONString);
self.responseData = nil;
//response = nil;
//error = nil;
//expectedResponseLength = nil;
self.web = nil;
}
Best regards,
Gianluca
You should submit this as a pull request so it can get merged into master if @zimok approves the code.