GoogleReaderAPI-iOS icon indicating copy to clipboard operation
GoogleReaderAPI-iOS copied to clipboard

Reply for getSubscriptionsList interpreted as a feed

Open ghost opened this issue 12 years ago • 1 comments

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

ghost avatar Jul 14 '12 13:07 ghost

You should submit this as a pull request so it can get merged into master if @zimok approves the code.

bradpurchase avatar Jul 14 '12 20:07 bradpurchase