Skip to content

Instantly share code, notes, and snippets.

@cdl
Created March 3, 2014 19:39
Show Gist options
  • Save cdl/9332984 to your computer and use it in GitHub Desktop.
Save cdl/9332984 to your computer and use it in GitHub Desktop.
For some reason this doesn't seem to be deleting things from my Pocket account.
// Unsave from Pocket
// self.heldStoryPocketID – item ID for the story grabbed from the Pocket API
NSError *error;
NSArray *actions = @[@{@"action": @"delete", @"item_id": self.heldStoryPocketID}];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:actions options:kNilOptions error:&error];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSDictionary *argDictionary = @{@"actions": jsonString};
[[PocketAPI sharedAPI] callAPIMethod:@"send" withHTTPMethod:PocketAPIHTTPMethodPOST arguments:argDictionary handler:^(PocketAPI *api, NSString *apiMethod, NSDictionary *response, NSError *error) {
if (error) {
// Can't connect to Pocket
} else {
// Remove from collection view + show notificiation, things went smoothly (I think?)
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment