iosobjective-cios5ios6

When using the Pocket API in an iOS app, is retrieval of articles only handled through JSON?


For those that have integrated Pocket into an app (further than just saving articles, I need to retrieve) when you go to retrieve a list of the users articles, is it only handled through JSON (as discussed here), or can you do it somehow with the Objective-C SDK directly?

If so, would I just be best off using a JSON framework to integrate it into my app?

I only ask because there appears to be a native way to save articles, and I was hoping there was a way to retrieve them as well, but I can't seem to find anything about it listed.


Solution

  • If you check out the source of the SDK on Github, you'll see there is a method to call any API. So it does appear that you can use the SDK to do more than just share.


    Edit: You'd probably need to do something like this (untested code)

    NSDictionary* argumentDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                        @"010101", @"consumer_key",
                                        @"101010", @"access_token",
                                        @"simple", @"detailType", nil]; //etc
    [[PocketAPI sharedAPI] callAPIMethod:@"get"
                          withHTTPMethod:@"POST"
                               arguments:argumentDictionary
                                 handler:^(PocketAPI *api, NSString *apiMethod, NSDictionary *response, NSError *error){
        // handle response here!
    }];