Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply for getSubscriptionsList interpreted as a feed #7

Open
ghost opened this issue Jul 14, 2012 · 1 comment
Open

Reply for getSubscriptionsList interpreted as a feed #7

ghost opened this issue Jul 14, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 14, 2012

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

@bradpurchase
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant