ChimpKit3 icon indicating copy to clipboard operation
ChimpKit3 copied to clipboard

Sample code uses ChimpKitRequest, which no longer exists

Open lightbow opened this issue 11 years ago • 3 comments

With ChimpKit 3.1.1, the completion block to callAPIMethod is ^(NSURLResponse *response, NSData *data, NSError *error) but the sample code uses ChimpKitRequest.

lightbow avatar Nov 13 '14 04:11 lightbow

Thanks !

fabreax avatar Jan 18 '16 14:01 fabreax

This still doesn't work, can we get an update on this???

shalem93 avatar Jun 21 '16 06:06 shalem93

@shalem93 Have you given the code sample from the example app a try?

[[ChimpKit sharedKit] callApiMethod:@"lists/subscribe"
                         withParams:params
               andCompletionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
                   NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                   if (kCKDebug) NSLog(@"Response String: %@", responseString);
                   
                   id parsedResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
                   
                   if (![parsedResponse isKindOfClass:[NSDictionary class]] || ![parsedResponse[@"email"] isKindOfClass:[NSString class]] || error) {
                       // Run Error Code
                   }
               }];

jjjjjjjjjjjh avatar Jun 29 '17 22:06 jjjjjjjjjjjh