Created
March 3, 2014 19:39
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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