From 876acc689ba8e6607d2bebca2b7bf8f694c2a6ae Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 13:47:26 +1000 Subject: [PATCH 01/20] Look for "file_token", not "derived_files" when parsing responses into ANKFile objects --- ADNKit/ANKClient.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index 0c8e4e3..aed6c38 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -458,7 +458,7 @@ - (id)parsedObjectFromJSON:(NSDictionary *)JSON { BOOL isMessage = sampleObject[@"channel_id"] && !sampleObject[@"canonical_url"] && !sampleObject[@"num_stars"]; BOOL isPost = sampleObject[@"num_stars"] && sampleObject[@"user"] && sampleObject[@"canonical_url"] && sampleObject[@"text"]; BOOL isChannel = sampleObject[@"has_unread"] && sampleObject[@"readers"]; - BOOL isFile = sampleObject[@"complete"] && sampleObject[@"derived_files"]; + BOOL isFile = sampleObject[@"complete"] && sampleObject[@"file_token"]; ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON]; Class resourceClass = nil; From 64ef296a9ad0c53d8d5b92ed1281e2dcd49ab443 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 13:58:45 +1000 Subject: [PATCH 02/20] Add "youMuted" property to ANKChannel --- ADNKit/ANKChannel.h | 1 + ADNKit/ANKChannel.m | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ADNKit/ANKChannel.h b/ADNKit/ANKChannel.h index 9f69f3c..eb048a4 100644 --- a/ADNKit/ANKChannel.h +++ b/ADNKit/ANKChannel.h @@ -30,6 +30,7 @@ @property (assign) BOOL isEditableByCurrentUser; @property (assign) BOOL isInactive; @property (assign) BOOL hasUnreadMessages; +@property (assign) BOOL youMuted; - (BOOL)isPrivateMessageChannel; diff --git a/ADNKit/ANKChannel.m b/ADNKit/ANKChannel.m index 3dd3ae8..71571c3 100644 --- a/ADNKit/ANKChannel.m +++ b/ADNKit/ANKChannel.m @@ -24,7 +24,8 @@ + (NSDictionary *)JSONToLocalKeyMapping { @"has_unread": @"hasUnreadMessages", @"recent_message_id": @"latestMessageID", @"recent_message": @"latestMessage", - @"is_inactive" : @"isInactive"}]; + @"is_inactive" : @"isInactive", + @"you_muted" : @"youMuted"}]; } From 179b841315aa5617b363f843eafb280c20bbddf4 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 20:00:05 +1000 Subject: [PATCH 03/20] Update to AFNetworking 2.x, XCTest, Objective-C modules This makes the project only compatible with iOS 7.x and higher, and OS X 10.9 and higher --- .gitmodules | 7 - ADNKit.xcodeproj/project.pbxproj | 422 +++++++++++----------------- ADNKit/ADNKit.h | 5 +- ADNKit/ANKAPIRequestSerializer.h | 11 + ADNKit/ANKAPIRequestSerializer.m | 21 ++ ADNKit/ANKAPIResponseSerializer.h | 9 + ADNKit/ANKAPIResponseSerializer.m | 18 ++ ADNKit/ANKClient+ANKChannel.h | 64 ++--- ADNKit/ANKClient+ANKChannel.m | 50 ++-- ADNKit/ANKClient+ANKExploreStream.h | 4 +- ADNKit/ANKClient+ANKExploreStream.m | 4 +- ADNKit/ANKClient+ANKFile.h | 26 +- ADNKit/ANKClient+ANKFile.m | 125 ++++---- ADNKit/ANKClient+ANKHandlerBlocks.h | 2 +- ADNKit/ANKClient+ANKInteraction.h | 2 +- ADNKit/ANKClient+ANKInteraction.m | 2 +- ADNKit/ANKClient+ANKMessage.h | 28 +- ADNKit/ANKClient+ANKMessage.m | 24 +- ADNKit/ANKClient+ANKPlace.h | 4 +- ADNKit/ANKClient+ANKPlace.m | 4 +- ADNKit/ANKClient+ANKPost.h | 46 +-- ADNKit/ANKClient+ANKPost.m | 46 +-- ADNKit/ANKClient+ANKPostStreams.h | 16 +- ADNKit/ANKClient+ANKPostStreams.m | 16 +- ADNKit/ANKClient+ANKRequestsAPI.h | 12 +- ADNKit/ANKClient+ANKRequestsAPI.m | 38 ++- ADNKit/ANKClient+ANKStreamMarker.h | 2 +- ADNKit/ANKClient+ANKStreamMarker.m | 2 +- ADNKit/ANKClient+ANKTokenStatus.h | 8 +- ADNKit/ANKClient+ANKTokenStatus.m | 8 +- ADNKit/ANKClient+ANKUser.h | 96 +++---- ADNKit/ANKClient+ANKUser.m | 153 +++++----- ADNKit/ANKClient.h | 8 +- ADNKit/ANKClient.m | 86 +++--- ADNKit/ANKJSONRequestOperation.h | 16 -- ADNKit/ANKJSONRequestOperation.m | 41 --- ADNKit/ANKStreamContext.h | 6 +- ADNKit/ANKStreamContext.m | 6 +- ADNKitTests/ADNKitTests.h | 4 +- ADNKitTests/ADNKitTests.m | 34 +-- External/AFNetworking | 1 - External/SocketShuttle | 1 - 42 files changed, 695 insertions(+), 783 deletions(-) create mode 100644 ADNKit/ANKAPIRequestSerializer.h create mode 100644 ADNKit/ANKAPIRequestSerializer.m create mode 100644 ADNKit/ANKAPIResponseSerializer.h create mode 100644 ADNKit/ANKAPIResponseSerializer.m delete mode 100644 ADNKit/ANKJSONRequestOperation.h delete mode 100644 ADNKit/ANKJSONRequestOperation.m delete mode 160000 External/AFNetworking delete mode 160000 External/SocketShuttle diff --git a/.gitmodules b/.gitmodules index f889196..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +0,0 @@ -[submodule "External/AFNetworking"] - path = External/AFNetworking - url = https://github.com/AFNetworking/AFNetworking - ignore = dirty -[submodule "SocketShuttle"] - path = External/SocketShuttle - url=https://github.com/joeldev/SocketShuttle.git diff --git a/ADNKit.xcodeproj/project.pbxproj b/ADNKit.xcodeproj/project.pbxproj index 9f819b6..2c07b37 100644 --- a/ADNKit.xcodeproj/project.pbxproj +++ b/ADNKit.xcodeproj/project.pbxproj @@ -61,7 +61,6 @@ 24DA12181741FBD000CAA8C5 /* ANKResourceMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2567682517153E3100C57D47 /* ANKResourceMap.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA12191741FBD000CAA8C5 /* ANKAPIResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888216F8CDB6001F3E8F /* ANKAPIResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA121A1741FBD000CAA8C5 /* ANKAPIResponseMeta.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888416F8CDB6001F3E8F /* ANKAPIResponseMeta.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA121B1741FBD000CAA8C5 /* ANKJSONRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88B816F8CDC7001F3E8F /* ANKJSONRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA121C1741FBD000CAA8C5 /* NSArray+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E616F8CDEF001F3E8F /* NSArray+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA121D1741FBD000CAA8C5 /* NSDictionary+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E816F8CDF1001F3E8F /* NSDictionary+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA121E1741FBD000CAA8C5 /* NSString+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2567680D1711539D00C57D47 /* NSString+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -69,21 +68,10 @@ 24DA12201741FBD800CAA8C5 /* ANKUsernameFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E016F8CDE8001F3E8F /* ANKUsernameFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA12211741FBF000CAA8C5 /* ADNKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC370E116E0805E00190862 /* ADNKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24DA12221741FBF500CAA8C5 /* ADNKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA357CB16EBC18B00FA21F8 /* ADNKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12231741FC1900CAA8C5 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725116E3AE1500190862 /* AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12241741FC2E00CAA8C5 /* AFHTTPClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724716E3AE1500190862 /* AFHTTPClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12251741FC2E00CAA8C5 /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724916E3AE1500190862 /* AFHTTPRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12261741FC2E00CAA8C5 /* AFImageRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724B16E3AE1500190862 /* AFImageRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12271741FC2E00CAA8C5 /* AFJSONRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724D16E3AE1500190862 /* AFJSONRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12281741FC2E00CAA8C5 /* AFPropertyListRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725216E3AE1500190862 /* AFPropertyListRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA12291741FC2E00CAA8C5 /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725416E3AE1500190862 /* AFURLConnectionOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA122A1741FC2E00CAA8C5 /* AFXMLRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725616E3AE1500190862 /* AFXMLRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA122B1741FC2E00CAA8C5 /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725816E3AE1500190862 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24DA122C1741FC2E00CAA8C5 /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724F16E3AE1500190862 /* AFNetworkActivityIndicatorManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24FC43931745F685004B5D5B /* ANKClient+ANKStreamMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 252E632317421632003143D6 /* ANKClient+ANKStreamMarker.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252A2C4516E5624700DAE393 /* ANKClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A2C4316E5624700DAE393 /* ANKClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252A2C4616E5624700DAE393 /* ANKClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A2C4416E5624700DAE393 /* ANKClient.m */; }; 252A2C4716E5624700DAE393 /* ANKClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A2C4416E5624700DAE393 /* ANKClient.m */; }; - 252A87D416F79A09001F3E8F /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 252A87D316F79A09001F3E8F /* CoreServices.framework */; }; 252A88EA16F8CDF2001F3E8F /* ANKACL.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A887B16F8CDB6001F3E8F /* ANKACL.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252A88EB16F8CDF2001F3E8F /* ANKACL.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A887C16F8CDB6001F3E8F /* ANKACL.m */; }; 252A88EC16F8CDF2001F3E8F /* ANKACL.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A887C16F8CDB6001F3E8F /* ANKACL.m */; }; @@ -175,9 +163,6 @@ 252A894216F8CDF3001F3E8F /* ANKInteraction.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88B616F8CDC6001F3E8F /* ANKInteraction.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252A894316F8CDF3001F3E8F /* ANKInteraction.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B716F8CDC6001F3E8F /* ANKInteraction.m */; }; 252A894416F8CDF3001F3E8F /* ANKInteraction.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B716F8CDC6001F3E8F /* ANKInteraction.m */; }; - 252A894516F8CDF3001F3E8F /* ANKJSONRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88B816F8CDC7001F3E8F /* ANKJSONRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 252A894616F8CDF3001F3E8F /* ANKJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B916F8CDC8001F3E8F /* ANKJSONRequestOperation.m */; }; - 252A894716F8CDF3001F3E8F /* ANKJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B916F8CDC8001F3E8F /* ANKJSONRequestOperation.m */; }; 252A894816F8CDF3001F3E8F /* ANKLinkEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88BA16F8CDC8001F3E8F /* ANKLinkEntity.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252A894916F8CDF3001F3E8F /* ANKLinkEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88BB16F8CDC9001F3E8F /* ANKLinkEntity.m */; }; 252A894A16F8CDF3001F3E8F /* ANKLinkEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88BB16F8CDC9001F3E8F /* ANKLinkEntity.m */; }; @@ -261,12 +246,9 @@ 2567682817153E3200C57D47 /* ANKResourceMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 2567682617153E3100C57D47 /* ANKResourceMap.m */; }; 2567682917153E3200C57D47 /* ANKResourceMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 2567682617153E3100C57D47 /* ANKResourceMap.m */; }; 2567682A17153E3200C57D47 /* ANKResourceMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 2567682617153E3100C57D47 /* ANKResourceMap.m */; }; - 2592B7A216FCED64004573FF /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2592B7A116FCED64004573FF /* SenTestingKit.framework */; }; - 2592B7A416FCED64004573FF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2592B7A316FCED64004573FF /* Cocoa.framework */; }; 2592B7AE16FCED64004573FF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2592B7AC16FCED64004573FF /* InfoPlist.strings */; }; 2592B7B116FCED64004573FF /* ADNKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2592B7B016FCED64004573FF /* ADNKitTests.m */; }; 2592B7B816FCED96004573FF /* ADNKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3710816E0808C00190862 /* ADNKit.framework */; }; - 2592B7B916FD2503004573FF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3728216E3AF8E00190862 /* SystemConfiguration.framework */; }; 2592B7C616FF8410004573FF /* ANKClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A2C4416E5624700DAE393 /* ANKClient.m */; }; 2592B7C716FF8410004573FF /* ANKACL.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A887C16F8CDB6001F3E8F /* ANKACL.m */; }; 2592B7C816FF8410004573FF /* ANKAnnotatableResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A887E16F8CDB6001F3E8F /* ANKAnnotatableResource.m */; }; @@ -298,7 +280,6 @@ 2592B7E216FF8410004573FF /* ANKHashtagEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B316F8CDC4001F3E8F /* ANKHashtagEntity.m */; }; 2592B7E316FF8410004573FF /* ANKImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B516F8CDC5001F3E8F /* ANKImage.m */; }; 2592B7E416FF8410004573FF /* ANKInteraction.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B716F8CDC6001F3E8F /* ANKInteraction.m */; }; - 2592B7E516FF8410004573FF /* ANKJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88B916F8CDC8001F3E8F /* ANKJSONRequestOperation.m */; }; 2592B7E616FF8410004573FF /* ANKLinkEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88BB16F8CDC9001F3E8F /* ANKLinkEntity.m */; }; 2592B7E716FF8410004573FF /* ANKMentionEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88BD16F8CDCA001F3E8F /* ANKMentionEntity.m */; }; 2592B7E816FF8410004573FF /* ANKMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88BF16F8CDCC001F3E8F /* ANKMessage.m */; }; @@ -323,29 +304,6 @@ 2592B7FB16FF8410004573FF /* ANKValueTransformations.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88E516F8CDEE001F3E8F /* ANKValueTransformations.m */; }; 2592B7FC16FF8410004573FF /* NSArray+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88E716F8CDF0001F3E8F /* NSArray+ANKAdditions.m */; }; 2592B7FD16FF8410004573FF /* NSDictionary+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88E916F8CDF2001F3E8F /* NSDictionary+ANKAdditions.m */; }; - 2592B7FF16FF8410004573FF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727D16E3AF6900190862 /* UIKit.framework */; }; - 2592B80016FF8410004573FF /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727A16E3AF4400190862 /* MobileCoreServices.framework */; }; - 2592B80116FF8410004573FF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727816E3AF4000190862 /* SystemConfiguration.framework */; }; - 2592B80216FF8410004573FF /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727616E3AF3800190862 /* CoreLocation.framework */; }; - 2592B80316FF8410004573FF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC370DC16E0805E00190862 /* Foundation.framework */; }; - 2592B80A16FF8440004573FF /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724816E3AE1500190862 /* AFHTTPClient.m */; }; - 2592B80B16FF8440004573FF /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724A16E3AE1500190862 /* AFHTTPRequestOperation.m */; }; - 2592B80C16FF8440004573FF /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724C16E3AE1500190862 /* AFImageRequestOperation.m */; }; - 2592B80D16FF8440004573FF /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724E16E3AE1500190862 /* AFJSONRequestOperation.m */; }; - 2592B80E16FF8440004573FF /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725316E3AE1500190862 /* AFPropertyListRequestOperation.m */; }; - 2592B80F16FF8440004573FF /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725516E3AE1500190862 /* AFURLConnectionOperation.m */; }; - 2592B81016FF8440004573FF /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725716E3AE1500190862 /* AFXMLRequestOperation.m */; }; - 2592B81116FF8440004573FF /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725016E3AE1500190862 /* AFNetworkActivityIndicatorManager.m */; }; - 2592B81216FF847F004573FF /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725916E3AE1500190862 /* UIImageView+AFNetworking.m */; }; - 2592B81316FF84A4004573FF /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724816E3AE1500190862 /* AFHTTPClient.m */; }; - 2592B81416FF84A4004573FF /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724A16E3AE1500190862 /* AFHTTPRequestOperation.m */; }; - 2592B81516FF84A4004573FF /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724C16E3AE1500190862 /* AFImageRequestOperation.m */; }; - 2592B81616FF84A4004573FF /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3724E16E3AE1500190862 /* AFJSONRequestOperation.m */; }; - 2592B81716FF84A4004573FF /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725316E3AE1500190862 /* AFPropertyListRequestOperation.m */; }; - 2592B81816FF84A4004573FF /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725516E3AE1500190862 /* AFURLConnectionOperation.m */; }; - 2592B81916FF84A4004573FF /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725716E3AE1500190862 /* AFXMLRequestOperation.m */; }; - 2592B81A16FF84A4004573FF /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725916E3AE1500190862 /* UIImageView+AFNetworking.m */; }; - 2592B81B16FF84A4004573FF /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC3725016E3AE1500190862 /* AFNetworkActivityIndicatorManager.m */; }; 259A5EC616F2E1EF00AF9F35 /* ADNKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC370E116E0805E00190862 /* ADNKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25C0AA45171867B8006E47B7 /* CustomPost.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C0AA44171867B8006E47B7 /* CustomPost.m */; }; 33041CE917A3760A00C4B25A /* ANKStreamContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 335AC10F176427C300AEFCFE /* ANKStreamContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -385,7 +343,6 @@ 332610B017A3B7E500665C05 /* ANKResourceMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2567682517153E3100C57D47 /* ANKResourceMap.h */; settings = {ATTRIBUTES = (Public, ); }; }; 332610B117A3B7E500665C05 /* ANKAPIResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888216F8CDB6001F3E8F /* ANKAPIResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 332610B217A3B7E500665C05 /* ANKAPIResponseMeta.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888416F8CDB6001F3E8F /* ANKAPIResponseMeta.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 332610B317A3B7E500665C05 /* ANKJSONRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88B816F8CDC7001F3E8F /* ANKJSONRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 332610B417A3B7E500665C05 /* NSArray+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E616F8CDEF001F3E8F /* NSArray+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 332610B517A3B7E500665C05 /* NSDictionary+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E816F8CDF1001F3E8F /* NSDictionary+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 332610B617A3B7E500665C05 /* NSString+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2567680D1711539D00C57D47 /* NSString+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -402,27 +359,60 @@ 5D955BEA174BD10B0077E387 /* ANKGeneralParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D955BE5174BD10B0077E387 /* ANKGeneralParameters.m */; }; 5D955BEB174BD10B0077E387 /* ANKGeneralParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D955BE5174BD10B0077E387 /* ANKGeneralParameters.m */; }; 5DA357D416EBC29600FA21F8 /* ADNKit-OSX.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA357CC16EBC18B00FA21F8 /* ADNKit-OSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC370DD16E0805E00190862 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC370DC16E0805E00190862 /* Foundation.framework */; }; - 5DC3710916E0808C00190862 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC370F016E0807000190862 /* Cocoa.framework */; }; 5DC3710F16E0808C00190862 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5DC3710D16E0808C00190862 /* InfoPlist.strings */; }; - 5DC3725A16E3AE1500190862 /* AFHTTPClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724716E3AE1500190862 /* AFHTTPClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3725D16E3AE1500190862 /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724916E3AE1500190862 /* AFHTTPRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3726016E3AE1500190862 /* AFImageRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724B16E3AE1500190862 /* AFImageRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3726316E3AE1500190862 /* AFJSONRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3724D16E3AE1500190862 /* AFJSONRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3726916E3AE1500190862 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725116E3AE1500190862 /* AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3726A16E3AE1500190862 /* AFPropertyListRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725216E3AE1500190862 /* AFPropertyListRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3726D16E3AE1500190862 /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725416E3AE1500190862 /* AFURLConnectionOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3727016E3AE1500190862 /* AFXMLRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC3725616E3AE1500190862 /* AFXMLRequestOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DC3727716E3AF3800190862 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727616E3AF3800190862 /* CoreLocation.framework */; }; - 5DC3727916E3AF4000190862 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727816E3AF4000190862 /* SystemConfiguration.framework */; }; - 5DC3727B16E3AF4400190862 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727A16E3AF4400190862 /* MobileCoreServices.framework */; }; - 5DC3727E16E3AF6900190862 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3727D16E3AF6900190862 /* UIKit.framework */; }; - 5DC3728116E3AF8900190862 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3728016E3AF8800190862 /* CoreLocation.framework */; }; - 5DC3728316E3AF8E00190862 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC3728216E3AF8E00190862 /* SystemConfiguration.framework */; }; + 905001D718F25B4C0038F8FF /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001C418F25B4C0038F8FF /* AFHTTPRequestOperation.h */; }; + 905001D818F25B4C0038F8FF /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001C418F25B4C0038F8FF /* AFHTTPRequestOperation.h */; }; + 905001D918F25B4C0038F8FF /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001C518F25B4C0038F8FF /* AFHTTPRequestOperation.m */; }; + 905001DA18F25B4C0038F8FF /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001C518F25B4C0038F8FF /* AFHTTPRequestOperation.m */; }; + 905001DB18F25B4C0038F8FF /* AFHTTPRequestOperationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001C618F25B4C0038F8FF /* AFHTTPRequestOperationManager.h */; }; + 905001DC18F25B4C0038F8FF /* AFHTTPRequestOperationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001C618F25B4C0038F8FF /* AFHTTPRequestOperationManager.h */; }; + 905001DD18F25B4C0038F8FF /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001C718F25B4C0038F8FF /* AFHTTPRequestOperationManager.m */; }; + 905001DE18F25B4C0038F8FF /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001C718F25B4C0038F8FF /* AFHTTPRequestOperationManager.m */; }; + 905001DF18F25B4C0038F8FF /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001C818F25B4C0038F8FF /* AFHTTPSessionManager.h */; }; + 905001E018F25B4C0038F8FF /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001C818F25B4C0038F8FF /* AFHTTPSessionManager.h */; }; + 905001E118F25B4C0038F8FF /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001C918F25B4C0038F8FF /* AFHTTPSessionManager.m */; }; + 905001E218F25B4C0038F8FF /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001C918F25B4C0038F8FF /* AFHTTPSessionManager.m */; }; + 905001E318F25B4C0038F8FF /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CA18F25B4C0038F8FF /* AFNetworking.h */; }; + 905001E418F25B4C0038F8FF /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CA18F25B4C0038F8FF /* AFNetworking.h */; }; + 905001E518F25B4C0038F8FF /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CB18F25B4C0038F8FF /* AFNetworkReachabilityManager.h */; }; + 905001E618F25B4C0038F8FF /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CB18F25B4C0038F8FF /* AFNetworkReachabilityManager.h */; }; + 905001E718F25B4C0038F8FF /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001CC18F25B4C0038F8FF /* AFNetworkReachabilityManager.m */; }; + 905001E818F25B4C0038F8FF /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001CC18F25B4C0038F8FF /* AFNetworkReachabilityManager.m */; }; + 905001E918F25B4C0038F8FF /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CD18F25B4C0038F8FF /* AFSecurityPolicy.h */; }; + 905001EA18F25B4C0038F8FF /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CD18F25B4C0038F8FF /* AFSecurityPolicy.h */; }; + 905001EB18F25B4C0038F8FF /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001CE18F25B4C0038F8FF /* AFSecurityPolicy.m */; }; + 905001EC18F25B4C0038F8FF /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001CE18F25B4C0038F8FF /* AFSecurityPolicy.m */; }; + 905001ED18F25B4C0038F8FF /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CF18F25B4C0038F8FF /* AFURLConnectionOperation.h */; }; + 905001EE18F25B4C0038F8FF /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001CF18F25B4C0038F8FF /* AFURLConnectionOperation.h */; }; + 905001EF18F25B4C0038F8FF /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D018F25B4C0038F8FF /* AFURLConnectionOperation.m */; }; + 905001F018F25B4C0038F8FF /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D018F25B4C0038F8FF /* AFURLConnectionOperation.m */; }; + 905001F118F25B4C0038F8FF /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001D118F25B4C0038F8FF /* AFURLRequestSerialization.h */; }; + 905001F218F25B4C0038F8FF /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001D118F25B4C0038F8FF /* AFURLRequestSerialization.h */; }; + 905001F318F25B4C0038F8FF /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D218F25B4C0038F8FF /* AFURLRequestSerialization.m */; }; + 905001F418F25B4C0038F8FF /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D218F25B4C0038F8FF /* AFURLRequestSerialization.m */; }; + 905001F518F25B4C0038F8FF /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001D318F25B4C0038F8FF /* AFURLResponseSerialization.h */; }; + 905001F618F25B4C0038F8FF /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001D318F25B4C0038F8FF /* AFURLResponseSerialization.h */; }; + 905001F718F25B4C0038F8FF /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D418F25B4C0038F8FF /* AFURLResponseSerialization.m */; }; + 905001F818F25B4C0038F8FF /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D418F25B4C0038F8FF /* AFURLResponseSerialization.m */; }; + 905001F918F25B4C0038F8FF /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001D518F25B4C0038F8FF /* AFURLSessionManager.h */; }; + 905001FA18F25B4C0038F8FF /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 905001D518F25B4C0038F8FF /* AFURLSessionManager.h */; }; + 905001FB18F25B4C0038F8FF /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D618F25B4C0038F8FF /* AFURLSessionManager.m */; }; + 905001FC18F25B4C0038F8FF /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 905001D618F25B4C0038F8FF /* AFURLSessionManager.m */; }; 905AF9D817BB41B1002FDE4E /* SocketShuttle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 905AF9D717BB41AD002FDE4E /* SocketShuttle.framework */; }; 905AF9DA17BB41CC002FDE4E /* SocketShuttle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 905AF9D717BB41AD002FDE4E /* SocketShuttle.framework */; }; 905AF9DB17BB41E3002FDE4E /* ANKStreamContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 335AC110176427C300AEFCFE /* ANKStreamContext.m */; }; - F153F9AA1773C1DE0018BC16 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F153F9A91773C1DE0018BC16 /* Security.framework */; }; + 9063DE1318F2AAB8001D09BC /* ANKAPIRequestSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9063DE0F18F2AAB8001D09BC /* ANKAPIRequestSerializer.h */; }; + 9063DE1418F2AAB8001D09BC /* ANKAPIRequestSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9063DE0F18F2AAB8001D09BC /* ANKAPIRequestSerializer.h */; }; + 9063DE1518F2AAB8001D09BC /* ANKAPIRequestSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9063DE0F18F2AAB8001D09BC /* ANKAPIRequestSerializer.h */; }; + 9063DE1618F2AAB8001D09BC /* ANKAPIRequestSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9063DE1018F2AAB8001D09BC /* ANKAPIRequestSerializer.m */; }; + 9063DE1718F2AAB8001D09BC /* ANKAPIRequestSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9063DE1018F2AAB8001D09BC /* ANKAPIRequestSerializer.m */; }; + 9063DE1818F2AAB8001D09BC /* ANKAPIRequestSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9063DE1018F2AAB8001D09BC /* ANKAPIRequestSerializer.m */; }; + 9063DE1918F2AAB8001D09BC /* ANKAPIResponseSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9063DE1118F2AAB8001D09BC /* ANKAPIResponseSerializer.h */; }; + 9063DE1A18F2AAB8001D09BC /* ANKAPIResponseSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9063DE1118F2AAB8001D09BC /* ANKAPIResponseSerializer.h */; }; + 9063DE1B18F2AAB8001D09BC /* ANKAPIResponseSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9063DE1118F2AAB8001D09BC /* ANKAPIResponseSerializer.h */; }; + 9063DE1C18F2AAB8001D09BC /* ANKAPIResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9063DE1218F2AAB8001D09BC /* ANKAPIResponseSerializer.m */; }; + 9063DE1D18F2AAB8001D09BC /* ANKAPIResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9063DE1218F2AAB8001D09BC /* ANKAPIResponseSerializer.m */; }; + 9063DE1E18F2AAB8001D09BC /* ANKAPIResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9063DE1218F2AAB8001D09BC /* ANKAPIResponseSerializer.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -504,7 +494,6 @@ /* Begin PBXFileReference section */ 252A2C4316E5624700DAE393 /* ANKClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKClient.h; sourceTree = ""; }; 252A2C4416E5624700DAE393 /* ANKClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKClient.m; sourceTree = ""; }; - 252A87D316F79A09001F3E8F /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; }; 252A887B16F8CDB6001F3E8F /* ANKACL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKACL.h; sourceTree = ""; }; 252A887C16F8CDB6001F3E8F /* ANKACL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKACL.m; sourceTree = ""; }; 252A887D16F8CDB6001F3E8F /* ANKAnnotatableResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKAnnotatableResource.h; sourceTree = ""; }; @@ -566,8 +555,6 @@ 252A88B516F8CDC5001F3E8F /* ANKImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKImage.m; sourceTree = ""; }; 252A88B616F8CDC6001F3E8F /* ANKInteraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKInteraction.h; sourceTree = ""; }; 252A88B716F8CDC6001F3E8F /* ANKInteraction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKInteraction.m; sourceTree = ""; }; - 252A88B816F8CDC7001F3E8F /* ANKJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKJSONRequestOperation.h; sourceTree = ""; }; - 252A88B916F8CDC8001F3E8F /* ANKJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKJSONRequestOperation.m; sourceTree = ""; }; 252A88BA16F8CDC8001F3E8F /* ANKLinkEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKLinkEntity.h; sourceTree = ""; }; 252A88BB16F8CDC9001F3E8F /* ANKLinkEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKLinkEntity.m; sourceTree = ""; }; 252A88BC16F8CDCA001F3E8F /* ANKMentionEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKMentionEntity.h; sourceTree = ""; }; @@ -624,12 +611,7 @@ 2567680E1711539D00C57D47 /* NSString+ANKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ANKAdditions.m"; sourceTree = ""; }; 2567682517153E3100C57D47 /* ANKResourceMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKResourceMap.h; sourceTree = ""; }; 2567682617153E3100C57D47 /* ANKResourceMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKResourceMap.m; sourceTree = ""; }; - 2592B7A016FCED64004573FF /* ADNKitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ADNKitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; - 2592B7A116FCED64004573FF /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; - 2592B7A316FCED64004573FF /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; - 2592B7A616FCED64004573FF /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - 2592B7A716FCED64004573FF /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; - 2592B7A816FCED64004573FF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 2592B7A016FCED64004573FF /* ADNKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ADNKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 2592B7AB16FCED64004573FF /* ADNKitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ADNKitTests-Info.plist"; sourceTree = ""; }; 2592B7AD16FCED64004573FF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 2592B7AF16FCED64004573FF /* ADNKitTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ADNKitTests.h; sourceTree = ""; }; @@ -650,42 +632,34 @@ 5DA357CB16EBC18B00FA21F8 /* ADNKit-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "ADNKit-iOS.h"; path = "ADNKit/ADNKit-iOS.h"; sourceTree = ""; }; 5DA357CC16EBC18B00FA21F8 /* ADNKit-OSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "ADNKit-OSX.h"; path = "ADNKit/ADNKit-OSX.h"; sourceTree = ""; }; 5DC370D916E0805E00190862 /* libADNKit-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libADNKit-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 5DC370DC16E0805E00190862 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 5DC370E016E0805E00190862 /* ADNKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ADNKit-Prefix.pch"; sourceTree = ""; }; 5DC370E116E0805E00190862 /* ADNKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ADNKit.h; path = ADNKit/ADNKit.h; sourceTree = ""; }; - 5DC370F016E0807000190862 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; - 5DC370F316E0807000190862 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - 5DC370F416E0807000190862 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; - 5DC370F516E0807000190862 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 5DC3710816E0808C00190862 /* ADNKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ADNKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5DC3710C16E0808C00190862 /* ADNKit-OSX-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ADNKit-OSX-Info.plist"; sourceTree = ""; }; 5DC3710E16E0808C00190862 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 5DC3724716E3AE1500190862 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPClient.h; sourceTree = ""; }; - 5DC3724816E3AE1500190862 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPClient.m; sourceTree = ""; }; - 5DC3724916E3AE1500190862 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperation.h; sourceTree = ""; }; - 5DC3724A16E3AE1500190862 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperation.m; sourceTree = ""; }; - 5DC3724B16E3AE1500190862 /* AFImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFImageRequestOperation.h; sourceTree = ""; }; - 5DC3724C16E3AE1500190862 /* AFImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageRequestOperation.m; sourceTree = ""; }; - 5DC3724D16E3AE1500190862 /* AFJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFJSONRequestOperation.h; sourceTree = ""; }; - 5DC3724E16E3AE1500190862 /* AFJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFJSONRequestOperation.m; sourceTree = ""; }; - 5DC3724F16E3AE1500190862 /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkActivityIndicatorManager.h; sourceTree = ""; }; - 5DC3725016E3AE1500190862 /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkActivityIndicatorManager.m; sourceTree = ""; }; - 5DC3725116E3AE1500190862 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworking.h; sourceTree = ""; }; - 5DC3725216E3AE1500190862 /* AFPropertyListRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFPropertyListRequestOperation.h; sourceTree = ""; }; - 5DC3725316E3AE1500190862 /* AFPropertyListRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFPropertyListRequestOperation.m; sourceTree = ""; }; - 5DC3725416E3AE1500190862 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLConnectionOperation.h; sourceTree = ""; }; - 5DC3725516E3AE1500190862 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLConnectionOperation.m; sourceTree = ""; }; - 5DC3725616E3AE1500190862 /* AFXMLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFXMLRequestOperation.h; sourceTree = ""; }; - 5DC3725716E3AE1500190862 /* AFXMLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLRequestOperation.m; sourceTree = ""; }; - 5DC3725816E3AE1500190862 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+AFNetworking.h"; sourceTree = ""; }; - 5DC3725916E3AE1500190862 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+AFNetworking.m"; sourceTree = ""; }; - 5DC3727616E3AF3800190862 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 5DC3727816E3AF4000190862 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 5DC3727A16E3AF4400190862 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; - 5DC3727D16E3AF6900190862 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 5DC3728016E3AF8800190862 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreLocation.framework; sourceTree = DEVELOPER_DIR; }; - 5DC3728216E3AF8E00190862 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; - F153F9A91773C1DE0018BC16 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + 905001C418F25B4C0038F8FF /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperation.h; sourceTree = ""; }; + 905001C518F25B4C0038F8FF /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperation.m; sourceTree = ""; }; + 905001C618F25B4C0038F8FF /* AFHTTPRequestOperationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperationManager.h; sourceTree = ""; }; + 905001C718F25B4C0038F8FF /* AFHTTPRequestOperationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperationManager.m; sourceTree = ""; }; + 905001C818F25B4C0038F8FF /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPSessionManager.h; sourceTree = ""; }; + 905001C918F25B4C0038F8FF /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPSessionManager.m; sourceTree = ""; }; + 905001CA18F25B4C0038F8FF /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworking.h; sourceTree = ""; }; + 905001CB18F25B4C0038F8FF /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkReachabilityManager.h; sourceTree = ""; }; + 905001CC18F25B4C0038F8FF /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkReachabilityManager.m; sourceTree = ""; }; + 905001CD18F25B4C0038F8FF /* AFSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFSecurityPolicy.h; sourceTree = ""; }; + 905001CE18F25B4C0038F8FF /* AFSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFSecurityPolicy.m; sourceTree = ""; }; + 905001CF18F25B4C0038F8FF /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLConnectionOperation.h; sourceTree = ""; }; + 905001D018F25B4C0038F8FF /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLConnectionOperation.m; sourceTree = ""; }; + 905001D118F25B4C0038F8FF /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLRequestSerialization.h; sourceTree = ""; }; + 905001D218F25B4C0038F8FF /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLRequestSerialization.m; sourceTree = ""; }; + 905001D318F25B4C0038F8FF /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLResponseSerialization.h; sourceTree = ""; }; + 905001D418F25B4C0038F8FF /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLResponseSerialization.m; sourceTree = ""; }; + 905001D518F25B4C0038F8FF /* AFURLSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLSessionManager.h; sourceTree = ""; }; + 905001D618F25B4C0038F8FF /* AFURLSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLSessionManager.m; sourceTree = ""; }; + 9063DE0F18F2AAB8001D09BC /* ANKAPIRequestSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKAPIRequestSerializer.h; sourceTree = ""; }; + 9063DE1018F2AAB8001D09BC /* ANKAPIRequestSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKAPIRequestSerializer.m; sourceTree = ""; }; + 9063DE1118F2AAB8001D09BC /* ANKAPIResponseSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKAPIResponseSerializer.h; sourceTree = ""; }; + 9063DE1218F2AAB8001D09BC /* ANKAPIResponseSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKAPIResponseSerializer.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -693,10 +667,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2592B7B916FD2503004573FF /* SystemConfiguration.framework in Frameworks */, 2592B7B816FCED96004573FF /* ADNKit.framework in Frameworks */, - 2592B7A216FCED64004573FF /* SenTestingKit.framework in Frameworks */, - 2592B7A416FCED64004573FF /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -705,11 +676,6 @@ buildActionMask = 2147483647; files = ( 33041CF017A38A0F00C4B25A /* libSocketShuttle.a in Frameworks */, - 2592B7FF16FF8410004573FF /* UIKit.framework in Frameworks */, - 2592B80016FF8410004573FF /* MobileCoreServices.framework in Frameworks */, - 2592B80116FF8410004573FF /* SystemConfiguration.framework in Frameworks */, - 2592B80216FF8410004573FF /* CoreLocation.framework in Frameworks */, - 2592B80316FF8410004573FF /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -718,11 +684,6 @@ buildActionMask = 2147483647; files = ( 330BDCAA17659465009BD559 /* libSocketShuttle.a in Frameworks */, - 5DC3727E16E3AF6900190862 /* UIKit.framework in Frameworks */, - 5DC3727B16E3AF4400190862 /* MobileCoreServices.framework in Frameworks */, - 5DC3727916E3AF4000190862 /* SystemConfiguration.framework in Frameworks */, - 5DC3727716E3AF3800190862 /* CoreLocation.framework in Frameworks */, - 5DC370DD16E0805E00190862 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -731,11 +692,6 @@ buildActionMask = 2147483647; files = ( 905AF9D817BB41B1002FDE4E /* SocketShuttle.framework in Frameworks */, - F153F9AA1773C1DE0018BC16 /* Security.framework in Frameworks */, - 252A87D416F79A09001F3E8F /* CoreServices.framework in Frameworks */, - 5DC3728316E3AF8E00190862 /* SystemConfiguration.framework in Frameworks */, - 5DC3728116E3AF8900190862 /* CoreLocation.framework in Frameworks */, - 5DC3710916E0808C00190862 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -893,16 +849,6 @@ name = "App.net API"; sourceTree = ""; }; - 2592B7A516FCED64004573FF /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 2592B7A616FCED64004573FF /* AppKit.framework */, - 2592B7A716FCED64004573FF /* CoreData.framework */, - 2592B7A816FCED64004573FF /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; 2592B7A916FCED64004573FF /* ADNKitTests */ = { isa = PBXGroup; children = ( @@ -937,7 +883,7 @@ 25D01E0C17640FFA000D365D /* External */ = { isa = PBXGroup; children = ( - 5DC3724616E3AE1500190862 /* AFNetworking */, + 905001C318F25B4C0038F8FF /* AFNetworking */, 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */, ); name = External; @@ -954,7 +900,6 @@ 5DC3710A16E0808C00190862 /* ADNKit-OSX */, 25D01E0C17640FFA000D365D /* External */, 2592B7A916FCED64004573FF /* ADNKitTests */, - 5DC370DB16E0805E00190862 /* Frameworks */, 5DC370DA16E0805E00190862 /* Products */, ); sourceTree = ""; @@ -964,24 +909,12 @@ children = ( 5DC370D916E0805E00190862 /* libADNKit-iOS.a */, 5DC3710816E0808C00190862 /* ADNKit.framework */, - 2592B7A016FCED64004573FF /* ADNKitTests.octest */, + 2592B7A016FCED64004573FF /* ADNKitTests.xctest */, 2592B80916FF8410004573FF /* libADNKit-AFNetworking-iOS.a */, ); name = Products; sourceTree = ""; }; - 5DC370DB16E0805E00190862 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 5DC3727C16E3AF6100190862 /* iOS */, - 5DC3727F16E3AF7A00190862 /* OS X */, - 2592B7A116FCED64004573FF /* SenTestingKit.framework */, - 2592B7A316FCED64004573FF /* Cocoa.framework */, - 2592B7A516FCED64004573FF /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; 5DC370DE16E0805E00190862 /* ADNKit */ = { isa = PBXGroup; children = ( @@ -995,8 +928,10 @@ 252A888316F8CDB6001F3E8F /* ANKAPIResponse.m */, 252A888416F8CDB6001F3E8F /* ANKAPIResponseMeta.h */, 252A888516F8CDB6001F3E8F /* ANKAPIResponseMeta.m */, - 252A88B816F8CDC7001F3E8F /* ANKJSONRequestOperation.h */, - 252A88B916F8CDC8001F3E8F /* ANKJSONRequestOperation.m */, + 9063DE0F18F2AAB8001D09BC /* ANKAPIRequestSerializer.h */, + 9063DE1018F2AAB8001D09BC /* ANKAPIRequestSerializer.m */, + 9063DE1118F2AAB8001D09BC /* ANKAPIResponseSerializer.h */, + 9063DE1218F2AAB8001D09BC /* ANKAPIResponseSerializer.m */, 252A88E616F8CDEF001F3E8F /* NSArray+ANKAdditions.h */, 252A88E716F8CDF0001F3E8F /* NSArray+ANKAdditions.m */, 252A88E816F8CDF1001F3E8F /* NSDictionary+ANKAdditions.h */, @@ -1033,60 +968,33 @@ name = "Supporting Files"; sourceTree = ""; }; - 5DC3724616E3AE1500190862 /* AFNetworking */ = { + 905001C318F25B4C0038F8FF /* AFNetworking */ = { isa = PBXGroup; children = ( - 5DC3725116E3AE1500190862 /* AFNetworking.h */, - 5DC3724716E3AE1500190862 /* AFHTTPClient.h */, - 5DC3724816E3AE1500190862 /* AFHTTPClient.m */, - 5DC3724916E3AE1500190862 /* AFHTTPRequestOperation.h */, - 5DC3724A16E3AE1500190862 /* AFHTTPRequestOperation.m */, - 5DC3724B16E3AE1500190862 /* AFImageRequestOperation.h */, - 5DC3724C16E3AE1500190862 /* AFImageRequestOperation.m */, - 5DC3724D16E3AE1500190862 /* AFJSONRequestOperation.h */, - 5DC3724E16E3AE1500190862 /* AFJSONRequestOperation.m */, - 5DC3725216E3AE1500190862 /* AFPropertyListRequestOperation.h */, - 5DC3725316E3AE1500190862 /* AFPropertyListRequestOperation.m */, - 5DC3725416E3AE1500190862 /* AFURLConnectionOperation.h */, - 5DC3725516E3AE1500190862 /* AFURLConnectionOperation.m */, - 5DC3725616E3AE1500190862 /* AFXMLRequestOperation.h */, - 5DC3725716E3AE1500190862 /* AFXMLRequestOperation.m */, - 5DC3725816E3AE1500190862 /* UIImageView+AFNetworking.h */, - 5DC3725916E3AE1500190862 /* UIImageView+AFNetworking.m */, - 5DC3724F16E3AE1500190862 /* AFNetworkActivityIndicatorManager.h */, - 5DC3725016E3AE1500190862 /* AFNetworkActivityIndicatorManager.m */, + 905001C418F25B4C0038F8FF /* AFHTTPRequestOperation.h */, + 905001C518F25B4C0038F8FF /* AFHTTPRequestOperation.m */, + 905001C618F25B4C0038F8FF /* AFHTTPRequestOperationManager.h */, + 905001C718F25B4C0038F8FF /* AFHTTPRequestOperationManager.m */, + 905001C818F25B4C0038F8FF /* AFHTTPSessionManager.h */, + 905001C918F25B4C0038F8FF /* AFHTTPSessionManager.m */, + 905001CA18F25B4C0038F8FF /* AFNetworking.h */, + 905001CB18F25B4C0038F8FF /* AFNetworkReachabilityManager.h */, + 905001CC18F25B4C0038F8FF /* AFNetworkReachabilityManager.m */, + 905001CD18F25B4C0038F8FF /* AFSecurityPolicy.h */, + 905001CE18F25B4C0038F8FF /* AFSecurityPolicy.m */, + 905001CF18F25B4C0038F8FF /* AFURLConnectionOperation.h */, + 905001D018F25B4C0038F8FF /* AFURLConnectionOperation.m */, + 905001D118F25B4C0038F8FF /* AFURLRequestSerialization.h */, + 905001D218F25B4C0038F8FF /* AFURLRequestSerialization.m */, + 905001D318F25B4C0038F8FF /* AFURLResponseSerialization.h */, + 905001D418F25B4C0038F8FF /* AFURLResponseSerialization.m */, + 905001D518F25B4C0038F8FF /* AFURLSessionManager.h */, + 905001D618F25B4C0038F8FF /* AFURLSessionManager.m */, ); name = AFNetworking; path = External/AFNetworking/AFNetworking; sourceTree = ""; }; - 5DC3727C16E3AF6100190862 /* iOS */ = { - isa = PBXGroup; - children = ( - 5DC3727D16E3AF6900190862 /* UIKit.framework */, - 5DC3727A16E3AF4400190862 /* MobileCoreServices.framework */, - 5DC3727816E3AF4000190862 /* SystemConfiguration.framework */, - 5DC3727616E3AF3800190862 /* CoreLocation.framework */, - 5DC370DC16E0805E00190862 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 5DC3727F16E3AF7A00190862 /* OS X */ = { - isa = PBXGroup; - children = ( - 5DC370F016E0807000190862 /* Cocoa.framework */, - 5DC370F316E0807000190862 /* AppKit.framework */, - 5DC370F416E0807000190862 /* CoreData.framework */, - 5DC370F516E0807000190862 /* Foundation.framework */, - F153F9A91773C1DE0018BC16 /* Security.framework */, - 252A87D316F79A09001F3E8F /* CoreServices.framework */, - 5DC3728216E3AF8E00190862 /* SystemConfiguration.framework */, - 5DC3728016E3AF8800190862 /* CoreLocation.framework */, - ); - name = "OS X"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1094,20 +1002,24 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 905001F918F25B4C0038F8FF /* AFURLSessionManager.h in Headers */, 24DA11E51741FB8E00CAA8C5 /* ANKClient.h in Headers */, 24DA11E61741FB8E00CAA8C5 /* ANKClient+ANKChannel.h in Headers */, + 905001DB18F25B4C0038F8FF /* AFHTTPRequestOperationManager.h in Headers */, 24DA11E71741FB8E00CAA8C5 /* ANKClient+ANKExploreStream.h in Headers */, 24DA11E81741FB8E00CAA8C5 /* ANKClient+ANKFile.h in Headers */, 24DA11E91741FB8E00CAA8C5 /* ANKClient+ANKFilter.h in Headers */, 24DA11EA1741FB8E00CAA8C5 /* ANKClient+ANKInteraction.h in Headers */, 24DA11EB1741FB8E00CAA8C5 /* ANKClient+ANKMessage.h in Headers */, 24DA11EC1741FB8E00CAA8C5 /* ANKClient+ANKPlace.h in Headers */, + 905001E518F25B4C0038F8FF /* AFNetworkReachabilityManager.h in Headers */, 24DA11ED1741FB8E00CAA8C5 /* ANKClient+ANKPost.h in Headers */, 24DA11EE1741FB8E00CAA8C5 /* ANKClient+ANKPostStreams.h in Headers */, 24DA11EF1741FB8E00CAA8C5 /* ANKClient+ANKStream.h in Headers */, 24DA11F01741FB8E00CAA8C5 /* ANKClient+ANKTokenStatus.h in Headers */, 24DA11F11741FB8E00CAA8C5 /* ANKClient+ANKUser.h in Headers */, 24DA11F21741FB8E00CAA8C5 /* ANKClient+ANKHandlerBlocks.h in Headers */, + 905001E318F25B4C0038F8FF /* AFNetworking.h in Headers */, 24DA11F31741FB8E00CAA8C5 /* ANKACL.h in Headers */, 24DA11F41741FB8E00CAA8C5 /* ANKAnnotatableResource.h in Headers */, 24DA11F51741FB8E00CAA8C5 /* ANKAnnotation.h in Headers */, @@ -1124,15 +1036,20 @@ 24DA12001741FB8E00CAA8C5 /* ANKHashtagEntity.h in Headers */, 24DA12011741FB8E00CAA8C5 /* ANKImage.h in Headers */, 24DA12021741FB8E00CAA8C5 /* ANKInteraction.h in Headers */, + 905001F518F25B4C0038F8FF /* AFURLResponseSerialization.h in Headers */, 24DA12031741FB8E00CAA8C5 /* ANKLinkEntity.h in Headers */, + 905001DF18F25B4C0038F8FF /* AFHTTPSessionManager.h in Headers */, 24DA12041741FB8E00CAA8C5 /* ANKMentionEntity.h in Headers */, 24DA12051741FB8E00CAA8C5 /* ANKMessage.h in Headers */, 24DA12061741FB8E00CAA8C5 /* ANKObjectSource.h in Headers */, 24DA12071741FB8E00CAA8C5 /* ANKOEmbed.h in Headers */, + 9063DE1A18F2AAB8001D09BC /* ANKAPIResponseSerializer.h in Headers */, 24DA12081741FBB500CAA8C5 /* ANKPaginationSettings.h in Headers */, + 9063DE1418F2AAB8001D09BC /* ANKAPIRequestSerializer.h in Headers */, 24DA12091741FBB500CAA8C5 /* ANKPlace.h in Headers */, 24DA120A1741FBB500CAA8C5 /* ANKPlaceCategory.h in Headers */, 24DA120B1741FBB500CAA8C5 /* ANKPost.h in Headers */, + 905001D718F25B4C0038F8FF /* AFHTTPRequestOperation.h in Headers */, 24DA120C1741FBB500CAA8C5 /* ANKResource.h in Headers */, 24DA120D1741FBB500CAA8C5 /* ANKStorage.h in Headers */, 24DA120E1741FBB500CAA8C5 /* ANKStream.h in Headers */, @@ -1145,10 +1062,10 @@ 24DA12151741FBC500CAA8C5 /* ANKOAuthViewController.h in Headers */, 24DA12161741FBC500CAA8C5 /* ANKTextFieldCell.h in Headers */, 24DA12171741FBC500CAA8C5 /* ANKUsernamePasswordAuthViewController.h in Headers */, + 905001E918F25B4C0038F8FF /* AFSecurityPolicy.h in Headers */, 24DA12181741FBD000CAA8C5 /* ANKResourceMap.h in Headers */, 24DA12191741FBD000CAA8C5 /* ANKAPIResponse.h in Headers */, 24DA121A1741FBD000CAA8C5 /* ANKAPIResponseMeta.h in Headers */, - 24DA121B1741FBD000CAA8C5 /* ANKJSONRequestOperation.h in Headers */, 24DA121C1741FBD000CAA8C5 /* NSArray+ANKAdditions.h in Headers */, 24DA121D1741FBD000CAA8C5 /* NSDictionary+ANKAdditions.h in Headers */, 24DA121E1741FBD000CAA8C5 /* NSString+ANKAdditions.h in Headers */, @@ -1156,21 +1073,13 @@ 24DA12201741FBD800CAA8C5 /* ANKUsernameFormatter.h in Headers */, 24DA12211741FBF000CAA8C5 /* ADNKit.h in Headers */, 24DA12221741FBF500CAA8C5 /* ADNKit-iOS.h in Headers */, - 24DA12231741FC1900CAA8C5 /* AFNetworking.h in Headers */, - 24DA12241741FC2E00CAA8C5 /* AFHTTPClient.h in Headers */, - 24DA12251741FC2E00CAA8C5 /* AFHTTPRequestOperation.h in Headers */, - 24DA12261741FC2E00CAA8C5 /* AFImageRequestOperation.h in Headers */, - 24DA12271741FC2E00CAA8C5 /* AFJSONRequestOperation.h in Headers */, - 24DA12281741FC2E00CAA8C5 /* AFPropertyListRequestOperation.h in Headers */, - 24DA12291741FC2E00CAA8C5 /* AFURLConnectionOperation.h in Headers */, - 24DA122A1741FC2E00CAA8C5 /* AFXMLRequestOperation.h in Headers */, - 24DA122B1741FC2E00CAA8C5 /* UIImageView+AFNetworking.h in Headers */, - 24DA122C1741FC2E00CAA8C5 /* AFNetworkActivityIndicatorManager.h in Headers */, 24FC43931745F685004B5D5B /* ANKClient+ANKStreamMarker.h in Headers */, 252AD7151745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */, 33041CE917A3760A00C4B25A /* ANKStreamContext.h in Headers */, 3326109617A3B75B00665C05 /* ANKSearchQuery.h in Headers */, + 905001F118F25B4C0038F8FF /* AFURLRequestSerialization.h in Headers */, 5D955BE7174BD10B0077E387 /* ANKGeneralParameters.h in Headers */, + 905001ED18F25B4C0038F8FF /* AFURLConnectionOperation.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1178,6 +1087,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 9063DE1318F2AAB8001D09BC /* ANKAPIRequestSerializer.h in Headers */, 331B250F17A247DF000E553E /* ANKSearchQuery.h in Headers */, 5D955BE6174BD10B0077E387 /* ANKGeneralParameters.h in Headers */, 335AC111176427C300AEFCFE /* ANKStreamContext.h in Headers */, @@ -1208,8 +1118,8 @@ 332610B017A3B7E500665C05 /* ANKResourceMap.h in Headers */, 332610B117A3B7E500665C05 /* ANKAPIResponse.h in Headers */, 332610B217A3B7E500665C05 /* ANKAPIResponseMeta.h in Headers */, - 332610B317A3B7E500665C05 /* ANKJSONRequestOperation.h in Headers */, 332610B417A3B7E500665C05 /* NSArray+ANKAdditions.h in Headers */, + 9063DE1918F2AAB8001D09BC /* ANKAPIResponseSerializer.h in Headers */, 332610B517A3B7E500665C05 /* NSDictionary+ANKAdditions.h in Headers */, 332610B617A3B7E500665C05 /* NSString+ANKAdditions.h in Headers */, ); @@ -1219,33 +1129,32 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 5DC3725A16E3AE1500190862 /* AFHTTPClient.h in Headers */, - 5DC3725D16E3AE1500190862 /* AFHTTPRequestOperation.h in Headers */, - 5DC3726016E3AE1500190862 /* AFImageRequestOperation.h in Headers */, - 5DC3726316E3AE1500190862 /* AFJSONRequestOperation.h in Headers */, - 5DC3726916E3AE1500190862 /* AFNetworking.h in Headers */, - 5DC3726A16E3AE1500190862 /* AFPropertyListRequestOperation.h in Headers */, - 5DC3726D16E3AE1500190862 /* AFURLConnectionOperation.h in Headers */, - 5DC3727016E3AE1500190862 /* AFXMLRequestOperation.h in Headers */, 252A2C4516E5624700DAE393 /* ANKClient.h in Headers */, 5DA357D416EBC29600FA21F8 /* ADNKit-OSX.h in Headers */, + 905001E418F25B4C0038F8FF /* AFNetworking.h in Headers */, + 905001E018F25B4C0038F8FF /* AFHTTPSessionManager.h in Headers */, 259A5EC616F2E1EF00AF9F35 /* ADNKit.h in Headers */, + 905001F218F25B4C0038F8FF /* AFURLRequestSerialization.h in Headers */, 252A88EA16F8CDF2001F3E8F /* ANKACL.h in Headers */, 252A88ED16F8CDF2001F3E8F /* ANKAnnotatableResource.h in Headers */, 252A88F016F8CDF2001F3E8F /* ANKAnnotation.h in Headers */, 252A88F316F8CDF2001F3E8F /* ANKAnnotationReplacement.h in Headers */, + 905001E618F25B4C0038F8FF /* AFNetworkReachabilityManager.h in Headers */, 252A88F416F8CDF2001F3E8F /* ANKAPIResponse.h in Headers */, 252A88F716F8CDF2001F3E8F /* ANKAPIResponseMeta.h in Headers */, 252A88FA16F8CDF2001F3E8F /* ANKChannel.h in Headers */, 252A88FD16F8CDF2001F3E8F /* ANKChannelCounts.h in Headers */, 252A890016F8CDF2001F3E8F /* ANKClient+ANKChannel.h in Headers */, + 905001DC18F25B4C0038F8FF /* AFHTTPRequestOperationManager.h in Headers */, 252A890316F8CDF2001F3E8F /* ANKClient+ANKExploreStream.h in Headers */, 252A890616F8CDF2001F3E8F /* ANKClient+ANKFile.h in Headers */, 252A890916F8CDF2001F3E8F /* ANKClient+ANKFilter.h in Headers */, + 905001D818F25B4C0038F8FF /* AFHTTPRequestOperation.h in Headers */, 252A890C16F8CDF2001F3E8F /* ANKClient+ANKHandlerBlocks.h in Headers */, 252A890F16F8CDF2001F3E8F /* ANKClient+ANKInteraction.h in Headers */, 252A891216F8CDF2001F3E8F /* ANKClient+ANKMessage.h in Headers */, 252A891516F8CDF2001F3E8F /* ANKClient+ANKPlace.h in Headers */, + 905001EA18F25B4C0038F8FF /* AFSecurityPolicy.h in Headers */, 252A891816F8CDF2001F3E8F /* ANKClient+ANKPost.h in Headers */, 252A891B16F8CDF2001F3E8F /* ANKClient+ANKPostStreams.h in Headers */, 252A891E16F8CDF2001F3E8F /* ANKClient+ANKStream.h in Headers */, @@ -1253,17 +1162,19 @@ 252A892116F8CDF2001F3E8F /* ANKClient+ANKTokenStatus.h in Headers */, 252A892416F8CDF2001F3E8F /* ANKClient+ANKUser.h in Headers */, 252A892716F8CDF2001F3E8F /* ANKEntities.h in Headers */, + 905001F618F25B4C0038F8FF /* AFURLResponseSerialization.h in Headers */, 252A892A16F8CDF2001F3E8F /* ANKEntity.h in Headers */, 252A892D16F8CDF2001F3E8F /* ANKExploreStream.h in Headers */, + 9063DE1518F2AAB8001D09BC /* ANKAPIRequestSerializer.h in Headers */, 252A893016F8CDF2001F3E8F /* ANKFile.h in Headers */, 252A893316F8CDF2001F3E8F /* ANKFilter.h in Headers */, 252A893616F8CDF2001F3E8F /* ANKFilterClause.h in Headers */, 5D955BE8174BD10B0077E387 /* ANKGeneralParameters.h in Headers */, 252A893916F8CDF2001F3E8F /* ANKGeolocation.h in Headers */, + 9063DE1B18F2AAB8001D09BC /* ANKAPIResponseSerializer.h in Headers */, 252A893C16F8CDF2001F3E8F /* ANKHashtagEntity.h in Headers */, 252A893F16F8CDF2001F3E8F /* ANKImage.h in Headers */, 252A894216F8CDF3001F3E8F /* ANKInteraction.h in Headers */, - 252A894516F8CDF3001F3E8F /* ANKJSONRequestOperation.h in Headers */, 252A894816F8CDF3001F3E8F /* ANKLinkEntity.h in Headers */, 252A894B16F8CDF3001F3E8F /* ANKMentionEntity.h in Headers */, 252A894E16F8CDF3001F3E8F /* ANKMessage.h in Headers */, @@ -1280,6 +1191,7 @@ 252A897516F8CDF3001F3E8F /* ANKTokenStatus.h in Headers */, 252A897816F8CDF3001F3E8F /* ANKUser.h in Headers */, 252A897B16F8CDF3001F3E8F /* ANKUserCounts.h in Headers */, + 905001EE18F25B4C0038F8FF /* AFURLConnectionOperation.h in Headers */, 252A897E16F8CDF3001F3E8F /* ANKUserDescription.h in Headers */, 252A898116F8CDF3001F3E8F /* ANKUsernameFormatter.h in Headers */, 252A898716F8CDF3001F3E8F /* ANKValueTransformations.h in Headers */, @@ -1289,6 +1201,7 @@ 2567682717153E3200C57D47 /* ANKResourceMap.h in Headers */, 331B251017A247DF000E553E /* ANKSearchQuery.h in Headers */, 252AD7161745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */, + 905001FA18F25B4C0038F8FF /* AFURLSessionManager.h in Headers */, 2567680F1711539D00C57D47 /* NSString+ANKAdditions.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1312,7 +1225,7 @@ ); name = ADNKitTests; productName = ADNKitTests; - productReference = 2592B7A016FCED64004573FF /* ADNKitTests.octest */; + productReference = 2592B7A016FCED64004573FF /* ADNKitTests.xctest */; productType = "com.apple.product-type.bundle"; }; 2592B7C416FF8410004573FF /* ADNKit-AFNetworking-iOS */ = { @@ -1379,7 +1292,8 @@ 5DC370D116E0805E00190862 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastTestingUpgradeCheck = 0510; + LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Afterwork Studios"; }; buildConfigurationList = 5DC370D416E0805E00190862 /* Build configuration list for PBXProject "ADNKit" */; @@ -1487,6 +1401,8 @@ 2592B7CF16FF8410004573FF /* ANKClient+ANKExploreStream.m in Sources */, 2592B7D016FF8410004573FF /* ANKClient+ANKFile.m in Sources */, 2592B7D116FF8410004573FF /* ANKClient+ANKFilter.m in Sources */, + 905001E118F25B4C0038F8FF /* AFHTTPSessionManager.m in Sources */, + 905001EF18F25B4C0038F8FF /* AFURLConnectionOperation.m in Sources */, 2592B7D216FF8410004573FF /* ANKClient+ANKHandlerBlocks.m in Sources */, 2592B7D316FF8410004573FF /* ANKClient+ANKInteraction.m in Sources */, 2592B7D416FF8410004573FF /* ANKClient+ANKMessage.m in Sources */, @@ -1498,6 +1414,7 @@ 2592B7DA16FF8410004573FF /* ANKClient+ANKUser.m in Sources */, 2592B7DB16FF8410004573FF /* ANKEntities.m in Sources */, 2592B7DC16FF8410004573FF /* ANKEntity.m in Sources */, + 905001EB18F25B4C0038F8FF /* AFSecurityPolicy.m in Sources */, 2592B7DD16FF8410004573FF /* ANKExploreStream.m in Sources */, 2592B7DE16FF8410004573FF /* ANKFile.m in Sources */, 2592B7DF16FF8410004573FF /* ANKFilter.m in Sources */, @@ -1506,16 +1423,18 @@ 2592B7E216FF8410004573FF /* ANKHashtagEntity.m in Sources */, 2592B7E316FF8410004573FF /* ANKImage.m in Sources */, 2592B7E416FF8410004573FF /* ANKInteraction.m in Sources */, - 2592B7E516FF8410004573FF /* ANKJSONRequestOperation.m in Sources */, 2592B7E616FF8410004573FF /* ANKLinkEntity.m in Sources */, 2592B7E716FF8410004573FF /* ANKMentionEntity.m in Sources */, 2592B7E816FF8410004573FF /* ANKMessage.m in Sources */, 2592B7E916FF8410004573FF /* ANKOAuthViewController.m in Sources */, 2592B7EA16FF8410004573FF /* ANKObjectSource.m in Sources */, + 905001DD18F25B4C0038F8FF /* AFHTTPRequestOperationManager.m in Sources */, 2592B7EB16FF8410004573FF /* ANKOEmbed.m in Sources */, + 905001FB18F25B4C0038F8FF /* AFURLSessionManager.m in Sources */, 2592B7EC16FF8410004573FF /* ANKPaginationSettings.m in Sources */, 2592B7ED16FF8410004573FF /* ANKPlace.m in Sources */, 2592B7EE16FF8410004573FF /* ANKPlaceCategory.m in Sources */, + 905001F718F25B4C0038F8FF /* AFURLResponseSerialization.m in Sources */, 2592B7EF16FF8410004573FF /* ANKPost.m in Sources */, 2592B7F016FF8410004573FF /* ANKResource.m in Sources */, 2592B7F116FF8410004573FF /* ANKStorage.m in Sources */, @@ -1526,22 +1445,18 @@ 2592B7F616FF8410004573FF /* ANKUser.m in Sources */, 2592B7F716FF8410004573FF /* ANKUserCounts.m in Sources */, 2592B7F816FF8410004573FF /* ANKUserDescription.m in Sources */, + 905001D918F25B4C0038F8FF /* AFHTTPRequestOperation.m in Sources */, 2592B7F916FF8410004573FF /* ANKUsernameFormatter.m in Sources */, + 905001F318F25B4C0038F8FF /* AFURLRequestSerialization.m in Sources */, 2592B7FA16FF8410004573FF /* ANKUsernamePasswordAuthViewController.m in Sources */, 2592B7FB16FF8410004573FF /* ANKValueTransformations.m in Sources */, 2592B7FC16FF8410004573FF /* NSArray+ANKAdditions.m in Sources */, 2592B7FD16FF8410004573FF /* NSDictionary+ANKAdditions.m in Sources */, - 2592B80A16FF8440004573FF /* AFHTTPClient.m in Sources */, - 2592B80B16FF8440004573FF /* AFHTTPRequestOperation.m in Sources */, - 2592B80C16FF8440004573FF /* AFImageRequestOperation.m in Sources */, - 2592B80D16FF8440004573FF /* AFJSONRequestOperation.m in Sources */, - 2592B80E16FF8440004573FF /* AFPropertyListRequestOperation.m in Sources */, - 2592B80F16FF8440004573FF /* AFURLConnectionOperation.m in Sources */, - 2592B81016FF8440004573FF /* AFXMLRequestOperation.m in Sources */, - 2592B81116FF8440004573FF /* AFNetworkActivityIndicatorManager.m in Sources */, 33041CEA17A3760D00C4B25A /* ANKStreamContext.m in Sources */, - 2592B81216FF847F004573FF /* UIImageView+AFNetworking.m in Sources */, 5D2CFEE81703E8F200086FBD /* ANKTokenLimits.m in Sources */, + 9063DE1D18F2AAB8001D09BC /* ANKAPIResponseSerializer.m in Sources */, + 9063DE1718F2AAB8001D09BC /* ANKAPIRequestSerializer.m in Sources */, + 905001E718F25B4C0038F8FF /* AFNetworkReachabilityManager.m in Sources */, 256768111711539D00C57D47 /* NSString+ANKAdditions.m in Sources */, 2567682917153E3200C57D47 /* ANKResourceMap.m in Sources */, 252E632717421632003143D6 /* ANKClient+ANKStreamMarker.m in Sources */, @@ -1559,6 +1474,7 @@ 252A88EE16F8CDF2001F3E8F /* ANKAnnotatableResource.m in Sources */, 252A88F116F8CDF2001F3E8F /* ANKAnnotation.m in Sources */, 252A88F516F8CDF2001F3E8F /* ANKAPIResponse.m in Sources */, + 9063DE1618F2AAB8001D09BC /* ANKAPIRequestSerializer.m in Sources */, 252A88F816F8CDF2001F3E8F /* ANKAPIResponseMeta.m in Sources */, 252A88FB16F8CDF2001F3E8F /* ANKChannel.m in Sources */, 252A88FE16F8CDF2001F3E8F /* ANKChannelCounts.m in Sources */, @@ -1569,6 +1485,7 @@ 252A890D16F8CDF2001F3E8F /* ANKClient+ANKHandlerBlocks.m in Sources */, 252A891016F8CDF2001F3E8F /* ANKClient+ANKInteraction.m in Sources */, 252A891316F8CDF2001F3E8F /* ANKClient+ANKMessage.m in Sources */, + 9063DE1C18F2AAB8001D09BC /* ANKAPIResponseSerializer.m in Sources */, 252A891616F8CDF2001F3E8F /* ANKClient+ANKPlace.m in Sources */, 252A891916F8CDF2001F3E8F /* ANKClient+ANKPost.m in Sources */, 252A891C16F8CDF2001F3E8F /* ANKClient+ANKPostStreams.m in Sources */, @@ -1586,7 +1503,6 @@ 252A893D16F8CDF2001F3E8F /* ANKHashtagEntity.m in Sources */, 252A894016F8CDF2001F3E8F /* ANKImage.m in Sources */, 252A894316F8CDF3001F3E8F /* ANKInteraction.m in Sources */, - 252A894616F8CDF3001F3E8F /* ANKJSONRequestOperation.m in Sources */, 252A894916F8CDF3001F3E8F /* ANKLinkEntity.m in Sources */, 252A894C16F8CDF3001F3E8F /* ANKMentionEntity.m in Sources */, 252A894F16F8CDF3001F3E8F /* ANKMessage.m in Sources */, @@ -1644,28 +1560,33 @@ 252A891A16F8CDF2001F3E8F /* ANKClient+ANKPost.m in Sources */, 252A891D16F8CDF2001F3E8F /* ANKClient+ANKPostStreams.m in Sources */, 252A892016F8CDF2001F3E8F /* ANKClient+ANKStream.m in Sources */, + 905001F018F25B4C0038F8FF /* AFURLConnectionOperation.m in Sources */, 252A892316F8CDF2001F3E8F /* ANKClient+ANKTokenStatus.m in Sources */, 252A892616F8CDF2001F3E8F /* ANKClient+ANKUser.m in Sources */, + 905001F818F25B4C0038F8FF /* AFURLResponseSerialization.m in Sources */, 252A892916F8CDF2001F3E8F /* ANKEntities.m in Sources */, 252A892C16F8CDF2001F3E8F /* ANKEntity.m in Sources */, + 905001E218F25B4C0038F8FF /* AFHTTPSessionManager.m in Sources */, 252A892F16F8CDF2001F3E8F /* ANKExploreStream.m in Sources */, 252A893216F8CDF2001F3E8F /* ANKFile.m in Sources */, 252A893516F8CDF2001F3E8F /* ANKFilter.m in Sources */, + 905001E818F25B4C0038F8FF /* AFNetworkReachabilityManager.m in Sources */, 252A893816F8CDF2001F3E8F /* ANKFilterClause.m in Sources */, 252A893B16F8CDF2001F3E8F /* ANKGeolocation.m in Sources */, 252A893E16F8CDF2001F3E8F /* ANKHashtagEntity.m in Sources */, 252A894116F8CDF3001F3E8F /* ANKImage.m in Sources */, 252A894416F8CDF3001F3E8F /* ANKInteraction.m in Sources */, - 252A894716F8CDF3001F3E8F /* ANKJSONRequestOperation.m in Sources */, 252A894A16F8CDF3001F3E8F /* ANKLinkEntity.m in Sources */, 252A894D16F8CDF3001F3E8F /* ANKMentionEntity.m in Sources */, 252A895016F8CDF3001F3E8F /* ANKMessage.m in Sources */, 252A895616F8CDF3001F3E8F /* ANKObjectSource.m in Sources */, 252A895916F8CDF3001F3E8F /* ANKOEmbed.m in Sources */, 252A895C16F8CDF3001F3E8F /* ANKPaginationSettings.m in Sources */, + 9063DE1818F2AAB8001D09BC /* ANKAPIRequestSerializer.m in Sources */, 252A895F16F8CDF3001F3E8F /* ANKPlace.m in Sources */, 252A896216F8CDF3001F3E8F /* ANKPlaceCategory.m in Sources */, 252A896516F8CDF3001F3E8F /* ANKPost.m in Sources */, + 905001FC18F25B4C0038F8FF /* AFURLSessionManager.m in Sources */, 331B251217A247DF000E553E /* ANKSearchQuery.m in Sources */, 252A896816F8CDF3001F3E8F /* ANKResource.m in Sources */, 252A896B16F8CDF3001F3E8F /* ANKStorage.m in Sources */, @@ -1677,23 +1598,19 @@ 252A898016F8CDF3001F3E8F /* ANKUserDescription.m in Sources */, 252A898316F8CDF3001F3E8F /* ANKUsernameFormatter.m in Sources */, 252A898916F8CDF3001F3E8F /* ANKValueTransformations.m in Sources */, + 9063DE1E18F2AAB8001D09BC /* ANKAPIResponseSerializer.m in Sources */, 252A898C16F8CDF3001F3E8F /* NSArray+ANKAdditions.m in Sources */, + 905001DE18F25B4C0038F8FF /* AFHTTPRequestOperationManager.m in Sources */, 252A898F16F8CDF3001F3E8F /* NSDictionary+ANKAdditions.m in Sources */, - 2592B81316FF84A4004573FF /* AFHTTPClient.m in Sources */, - 2592B81416FF84A4004573FF /* AFHTTPRequestOperation.m in Sources */, - 2592B81516FF84A4004573FF /* AFImageRequestOperation.m in Sources */, - 2592B81616FF84A4004573FF /* AFJSONRequestOperation.m in Sources */, - 2592B81716FF84A4004573FF /* AFPropertyListRequestOperation.m in Sources */, - 2592B81816FF84A4004573FF /* AFURLConnectionOperation.m in Sources */, - 2592B81916FF84A4004573FF /* AFXMLRequestOperation.m in Sources */, - 2592B81A16FF84A4004573FF /* UIImageView+AFNetworking.m in Sources */, 905AF9DB17BB41E3002FDE4E /* ANKStreamContext.m in Sources */, - 2592B81B16FF84A4004573FF /* AFNetworkActivityIndicatorManager.m in Sources */, 5D2CFEE91703E8F200086FBD /* ANKTokenLimits.m in Sources */, 256768121711539D00C57D47 /* NSString+ANKAdditions.m in Sources */, 2567682A17153E3200C57D47 /* ANKResourceMap.m in Sources */, + 905001DA18F25B4C0038F8FF /* AFHTTPRequestOperation.m in Sources */, + 905001F418F25B4C0038F8FF /* AFURLRequestSerialization.m in Sources */, 252E632817421632003143D6 /* ANKClient+ANKStreamMarker.m in Sources */, 252AD7191745C76600E12492 /* ANKClient+ANKRequestsAPI.m in Sources */, + 905001EC18F25B4C0038F8FF /* AFSecurityPolicy.m in Sources */, 5D955BEB174BD10B0077E387 /* ANKGeneralParameters.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1746,9 +1663,8 @@ 2592B7B316FCED64004573FF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; + FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_FRAMEWORKS_DIR)"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKitTests/ADNKitTests-Prefix.pch"; @@ -1757,17 +1673,16 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - WRAPPER_EXTENSION = octest; + WRAPPER_EXTENSION = xctest; }; name = Debug; }; 2592B7B416FCED64004573FF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; + FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_FRAMEWORKS_DIR)"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKitTests/ADNKitTests-Prefix.pch"; @@ -1776,7 +1691,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - WRAPPER_EXTENSION = octest; + WRAPPER_EXTENSION = xctest; }; name = Release; }; @@ -1822,6 +1737,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -1845,7 +1761,7 @@ "\"$(SRCROOT)/External/SocketShuttle\"", "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -1899,7 +1815,6 @@ 331FA3CD1773E7FB0011DF8E /* TestFlight */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1914,7 +1829,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; INFOPLIST_FILE = "ADNKit-OSX/ADNKit-OSX-Info.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = ADNKit; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -1924,9 +1839,8 @@ 331FA3CE1773E7FB0011DF8E /* TestFlight */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; + FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_FRAMEWORKS_DIR)"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKitTests/ADNKitTests-Prefix.pch"; @@ -1935,7 +1849,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - WRAPPER_EXTENSION = octest; + WRAPPER_EXTENSION = xctest; }; name = TestFlight; }; @@ -1945,6 +1859,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -1968,7 +1883,7 @@ "\"$(SRCROOT)/External/SocketShuttle\"", "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -1984,6 +1899,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -2000,7 +1916,7 @@ "\"$(SRCROOT)/External/SocketShuttle\"", "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_LDFLAGS = ( "-ObjC", "-all_load", @@ -2055,7 +1971,6 @@ 5DC3711516E0808C00190862 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2070,7 +1985,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; INFOPLIST_FILE = "ADNKit-OSX/ADNKit-OSX-Info.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = ADNKit; SDKROOT = macosx; WRAPPER_EXTENSION = framework; @@ -2080,7 +1995,6 @@ 5DC3711616E0808C00190862 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; @@ -2096,7 +2010,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; INFOPLIST_FILE = "ADNKit-OSX/ADNKit-OSX-Info.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = ADNKit; SDKROOT = macosx; WRAPPER_EXTENSION = framework; diff --git a/ADNKit/ADNKit.h b/ADNKit/ADNKit.h index 84656d9..e1b601e 100644 --- a/ADNKit/ADNKit.h +++ b/ADNKit/ADNKit.h @@ -69,14 +69,15 @@ #import #import -#import #import #import -#import #import #import #import +#import +#import + #import #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED diff --git a/ADNKit/ANKAPIRequestSerializer.h b/ADNKit/ANKAPIRequestSerializer.h new file mode 100644 index 0000000..952382f --- /dev/null +++ b/ADNKit/ANKAPIRequestSerializer.h @@ -0,0 +1,11 @@ +// +// Created by Tony Arnold on 7/04/2014. +// + +#import "AFURLRequestSerialization.h" + +@interface ANKAPIRequestSerializer : AFJSONRequestSerializer + +@property (strong) NSDictionary *defaultParameters; + +@end diff --git a/ADNKit/ANKAPIRequestSerializer.m b/ADNKit/ANKAPIRequestSerializer.m new file mode 100644 index 0000000..7d0944f --- /dev/null +++ b/ADNKit/ANKAPIRequestSerializer.m @@ -0,0 +1,21 @@ +// +// Created by Tony Arnold on 7/04/2014. +// + +#import "ANKAPIRequestSerializer.h" +#import "ADNKit.h" + +@implementation ANKAPIRequestSerializer + +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(id)parameters + error:(NSError * __autoreleasing *)error +{ + return [super requestWithMethod:method + URLString:URLString + parameters:[parameters ?: @{} ank_dictionaryByAppendingDictionary:self.defaultParameters] + error:error]; +} + +@end diff --git a/ADNKit/ANKAPIResponseSerializer.h b/ADNKit/ANKAPIResponseSerializer.h new file mode 100644 index 0000000..085044c --- /dev/null +++ b/ADNKit/ANKAPIResponseSerializer.h @@ -0,0 +1,9 @@ +// +// Created by Tony Arnold on 7/04/2014. +// + +#import "AFURLResponseSerialization.h" + +@interface ANKAPIResponseSerializer : AFJSONResponseSerializer + +@end diff --git a/ADNKit/ANKAPIResponseSerializer.m b/ADNKit/ANKAPIResponseSerializer.m new file mode 100644 index 0000000..f025f09 --- /dev/null +++ b/ADNKit/ANKAPIResponseSerializer.m @@ -0,0 +1,18 @@ +// +// Created by Tony Arnold on 7/04/2014. +// + +#import "ANKAPIResponseSerializer.h" +#import "ADNKit.h" + +@implementation ANKAPIResponseSerializer + +- (id)responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error +{ + id originalResponse = [super responseObjectForResponse:response data:data error:error]; + return [[ANKAPIResponse alloc] initWithResponseObject:originalResponse]; +} + +@end diff --git a/ADNKit/ANKClient+ANKChannel.h b/ADNKit/ANKClient+ANKChannel.h index 38fd442..93f2030 100644 --- a/ADNKit/ANKClient+ANKChannel.h +++ b/ADNKit/ANKClient+ANKChannel.h @@ -17,37 +17,37 @@ @interface ANKClient (ANKChannel) -- (ANKJSONRequestOperation *)fetchCurrentUserSubscribedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchCurrentUserSubscribedChannelsWithTypes:(NSArray *)types completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchCurrentUserPrivateMessageChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchCurrentUserCreatedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUnreadPMChannelsCountWithCompletion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchChannelsWithIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchUsersSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannelIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchMutedChannelsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)createChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createChannelWithType:(NSString *)type readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)updateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)updateChannelWithID:(NSString *)channelID readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)subscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)subscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unsubscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unsubscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)muteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)muteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unmuteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchCurrentUserSubscribedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchCurrentUserSubscribedChannelsWithTypes:(NSArray *)types completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchCurrentUserPrivateMessageChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchCurrentUserCreatedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUnreadPMChannelsCountWithCompletion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchChannelsWithIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchUsersSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserIDsSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserIDsSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserIDsSubscribedToChannelIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchMutedChannelsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)createChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createChannelWithType:(NSString *)type readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)updateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)updateChannelWithID:(NSString *)channelID readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)subscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)subscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unsubscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unsubscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)muteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)muteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unmuteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKChannel.m b/ADNKit/ANKClient+ANKChannel.m index 4a66a0e..70fe52e 100644 --- a/ADNKit/ANKClient+ANKChannel.m +++ b/ADNKit/ANKClient+ANKChannel.m @@ -20,14 +20,14 @@ @implementation ANKClient (ANKChannel) // http://developers.app.net/docs/resources/channel/subscriptions/#get-current-users-subscribed-channels -- (ANKJSONRequestOperation *)fetchCurrentUserSubscribedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchCurrentUserSubscribedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"channels" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKChannel class] clientHandler:completionHandler] failure:[self failureHandlerForClientHandler:completionHandler]]; } -- (ANKJSONRequestOperation *)fetchCurrentUserSubscribedChannelsWithTypes:(NSArray *)types completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchCurrentUserSubscribedChannelsWithTypes:(NSArray *)types completion:(ANKClientCompletionBlock)completionHandler { if (!types) { types = @[]; } @@ -39,7 +39,7 @@ - (ANKJSONRequestOperation *)fetchCurrentUserSubscribedChannelsWithTypes:(NSArra } -- (ANKJSONRequestOperation *)fetchCurrentUserPrivateMessageChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchCurrentUserPrivateMessageChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"channels" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKChannel class] clientHandler:completionHandler filteredWith:^BOOL(id object) { return [(ANKChannel *)object isPrivateMessageChannel]; }] failure:[self failureHandlerForClientHandler:completionHandler]]; @@ -48,7 +48,7 @@ - (ANKJSONRequestOperation *)fetchCurrentUserPrivateMessageChannelsWithCompletio // http://developers.app.net/docs/resources/channel/lookup/#retrieve-my-channels -- (ANKJSONRequestOperation *)fetchCurrentUserCreatedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchCurrentUserCreatedChannelsWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/me/channels" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -58,7 +58,7 @@ - (ANKJSONRequestOperation *)fetchCurrentUserCreatedChannelsWithCompletion:(ANKC // http://developers.app.net/docs/resources/channel/lookup/#retrieve-number-of-unread-pm-channels -- (ANKJSONRequestOperation *)fetchUnreadPMChannelsCountWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUnreadPMChannelsCountWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/me/channels/pm/num_unread" parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -68,7 +68,7 @@ - (ANKJSONRequestOperation *)fetchUnreadPMChannelsCountWithCompletion:(ANKClient // http://developers.app.net/docs/resources/channel/lookup/#retrieve-a-channel -- (ANKJSONRequestOperation *)fetchChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"channels/%@", channelID] parameters:nil success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -78,7 +78,7 @@ - (ANKJSONRequestOperation *)fetchChannelWithID:(NSString *)channelID completion // http://developers.app.net/docs/resources/channel/lookup/#retrieve-multiple-channels -- (ANKJSONRequestOperation *)fetchChannelsWithIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchChannelsWithIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"channels" parameters:@{@"ids": [channelIDs componentsJoinedByString:@","]} success:[self successHandlerForCollectionOfResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -88,12 +88,12 @@ - (ANKJSONRequestOperation *)fetchChannelsWithIDs:(NSArray *)channelIDs completi // http://developers.app.net/docs/resources/channel/subscriptions/#retrieve-users-subscribed-to-a-channel -- (ANKJSONRequestOperation *)fetchUsersSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUsersSubscribedToChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUsersSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"channels/%@/subscribers", channelID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -103,12 +103,12 @@ - (ANKJSONRequestOperation *)fetchUsersSubscribedToChannelWithID:(NSString *)cha // http://developers.app.net/docs/resources/channel/subscriptions/#retrieve-user-ids-subscribed-to-a-channel -- (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsSubscribedToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUserIDsSubscribedToChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsSubscribedToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"channels/%@/subscribers/ids", channelID] parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -118,7 +118,7 @@ - (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannelWithID:(NSString *)c // http://developers.app.net/docs/resources/channel/subscriptions/#retrieve-user-ids-subscribed-to-a-channel -- (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannelIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsSubscribedToChannelIDs:(NSArray *)channelIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"channels/subscribers/ids" parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -128,7 +128,7 @@ - (ANKJSONRequestOperation *)fetchUserIDsSubscribedToChannelIDs:(NSArray *)chann // http://developers.app.net/docs/resources/channel/muting/#get-current-users-muted-channels -- (ANKJSONRequestOperation *)fetchMutedChannelsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMutedChannelsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/me/channels/muted" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -138,7 +138,7 @@ - (ANKJSONRequestOperation *)fetchMutedChannelsForCurrentUserWithCompletion:(ANK // http://developers.app.net/docs/resources/channel/lifecycle/#create-a-channel -- (ANKJSONRequestOperation *)createChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:@"channels" parameters:[channel JSONDictionary] success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -146,7 +146,7 @@ - (ANKJSONRequestOperation *)createChannel:(ANKChannel *)channel completion:(ANK } -- (ANKJSONRequestOperation *)createChannelWithType:(NSString *)type readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createChannelWithType:(NSString *)type readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler { NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObject:type forKey:@"type"]; if (readersACL) { parameters[@"readers"] = [readersACL JSONDictionary]; @@ -164,7 +164,7 @@ - (ANKJSONRequestOperation *)createChannelWithType:(NSString *)type readers:(ANK // http://developers.app.net/docs/resources/channel/lifecycle/#update-a-channel -- (ANKJSONRequestOperation *)updateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)updateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePUTPath:[NSString stringWithFormat:@"channels/%@", channel.channelID] parameters:[channel JSONDictionary] success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -172,7 +172,7 @@ - (ANKJSONRequestOperation *)updateChannel:(ANKChannel *)channel completion:(ANK } -- (ANKJSONRequestOperation *)updateChannelWithID:(NSString *)channelID readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)updateChannelWithID:(NSString *)channelID readers:(ANKACL *)readersACL writers:(ANKACL *)writersACL completion:(ANKClientCompletionBlock)completionHandler { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; if (readersACL) { parameters[@"readers"] = [readersACL JSONDictionary]; @@ -190,12 +190,12 @@ - (ANKJSONRequestOperation *)updateChannelWithID:(NSString *)channelID readers:( // http://developers.app.net/docs/resources/channel/subscriptions/#subscribe-to-a-channel -- (ANKJSONRequestOperation *)subscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)subscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self subscribeToChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)subscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)subscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[NSString stringWithFormat:@"channels/%@/subscribe", channelID] parameters:nil success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -205,12 +205,12 @@ - (ANKJSONRequestOperation *)subscribeToChannelWithID:(NSString *)channelID comp // http://developers.app.net/docs/resources/channel/subscriptions/#unsubscribe-from-a-channel -- (ANKJSONRequestOperation *)unsubscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unsubscribeToChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self unsubscribeToChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unsubscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unsubscribeToChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"channels/%@/subscribe", channelID] parameters:nil success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -220,12 +220,12 @@ - (ANKJSONRequestOperation *)unsubscribeToChannelWithID:(NSString *)channelID co // http://developers.app.net/docs/resources/channel/muting/#mute-a-channel -- (ANKJSONRequestOperation *)muteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)muteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self muteChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)muteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)muteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[NSString stringWithFormat:@"channels/%@/mute", channelID] parameters:nil success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] @@ -235,12 +235,12 @@ - (ANKJSONRequestOperation *)muteChannelWithID:(NSString *)channelID completion: // http://developers.app.net/docs/resources/channel/muting/#unmute-a-channel -- (ANKJSONRequestOperation *)unmuteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unmuteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self unmuteChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"channels/%@/mute", channelID] parameters:nil success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKExploreStream.h b/ADNKit/ANKClient+ANKExploreStream.h index 14a7e7b..64dc997 100644 --- a/ADNKit/ANKClient+ANKExploreStream.h +++ b/ADNKit/ANKClient+ANKExploreStream.h @@ -17,7 +17,7 @@ @interface ANKClient (ANKExploreStream) -- (ANKJSONRequestOperation *)fetchExploreStreamsWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchExploreStreamWithSlug:(NSString *)slug completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchExploreStreamsWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchExploreStreamWithSlug:(NSString *)slug completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKExploreStream.m b/ADNKit/ANKClient+ANKExploreStream.m index 4be6efa..e45cb75 100644 --- a/ADNKit/ANKClient+ANKExploreStream.m +++ b/ADNKit/ANKClient+ANKExploreStream.m @@ -18,7 +18,7 @@ @implementation ANKClient (ANKExploreStream) // http://developers.app.net/docs/resources/explore/#retrieve-all-explore-streams -- (ANKJSONRequestOperation *)fetchExploreStreamsWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchExploreStreamsWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"posts/stream/explore" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKExploreStream class] clientHandler:completionHandler] @@ -28,7 +28,7 @@ - (ANKJSONRequestOperation *)fetchExploreStreamsWithCompletion:(ANKClientComplet // http://developers.app.net/docs/resources/explore/#retrieve-an-explore-stream -- (ANKJSONRequestOperation *)fetchExploreStreamWithSlug:(NSString *)slug completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchExploreStreamWithSlug:(NSString *)slug completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts/stream/explore/%@", slug] parameters:nil success:[self successHandlerForResourceClass:[ANKExploreStream class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKFile.h b/ADNKit/ANKClient+ANKFile.h index 1a53737..496234e 100644 --- a/ADNKit/ANKClient+ANKFile.h +++ b/ADNKit/ANKClient+ANKFile.h @@ -17,26 +17,26 @@ @interface ANKClient (ANKFile) -- (ANKJSONRequestOperation *)fetchFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchFilesWithIDs:(NSArray *)fileIDs completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchCurrentUserFilesWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchFilesWithIDs:(NSArray *)fileIDs completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchCurrentUserFilesWithCompletion:(ANKClientCompletionBlock)completionHandler; - (AFHTTPRequestOperation *)fetchContentsOfFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler; - (AFHTTPRequestOperation *)fetchContentsOfFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler; - (AFHTTPRequestOperation *)fetchContentsOfFileWithID:(NSString *)fileID withReadToken:(NSString *)readToken completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createFile:(ANKFile *)file withData:(NSData *)fileData completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createFile:(ANKFile *)file withContentsOfURL:(NSURL *)fileURL progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createFile:(ANKFile *)file withData:(NSData *)fileData completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createFile:(ANKFile *)file withContentsOfURL:(NSURL *)fileURL progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createFileWithData:(NSData *)fileData mimeType:(NSString *)mimeType filename:(NSString *)filename metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createFileWithContentsOfURL:(NSURL *)fileURL metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createFileWithData:(NSData *)fileData mimeType:(NSString *)mimeType filename:(NSString *)filename metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createFileWithContentsOfURL:(NSURL *)fileURL metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)updateFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)updateFileWithID:(NSString *)fileID name:(NSString *)updatedName isPublic:(BOOL)updatedPublicFlag completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)updateFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)updateFileWithID:(NSString *)fileID name:(NSString *)updatedName isPublic:(BOOL)updatedPublicFlag completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)deleteFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)deleteFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deleteFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deleteFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)setContentOfFile:(ANKFile *)file fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)setContentOfFileWithID:(NSString *)fileID fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)setContentOfFile:(ANKFile *)file fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)setContentOfFileWithID:(NSString *)fileID fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKFile.m b/ADNKit/ANKClient+ANKFile.m index df89853..3139be8 100644 --- a/ADNKit/ANKClient+ANKFile.m +++ b/ADNKit/ANKClient+ANKFile.m @@ -12,14 +12,14 @@ #import "ANKClient+ANKFile.h" #import "ANKFile.h" -#import "ANKJSONRequestOperation.h" +#import "AFHTTPRequestOperation.h" @implementation ANKClient (ANKFile) // http://developers.app.net/docs/resources/file/lookup/#retrieve-a-file -- (ANKJSONRequestOperation *)fetchFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"files/%@", fileID] parameters:nil success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] @@ -29,7 +29,7 @@ - (ANKJSONRequestOperation *)fetchFileWithID:(NSString *)fileID completion:(ANKC // http://developers.app.net/docs/resources/file/lookup/#retrieve-multiple-files -- (ANKJSONRequestOperation *)fetchFilesWithIDs:(NSArray *)fileIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchFilesWithIDs:(NSArray *)fileIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"files?ids=%@", [fileIDs componentsJoinedByString:@","]] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKFile class] clientHandler:completionHandler] @@ -39,7 +39,7 @@ - (ANKJSONRequestOperation *)fetchFilesWithIDs:(NSArray *)fileIDs completion:(AN // http://developers.app.net/docs/resources/file/lookup/#retrieve-my-files -- (ANKJSONRequestOperation *)fetchCurrentUserFilesWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchCurrentUserFilesWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/me/files" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKFile class] clientHandler:completionHandler] @@ -64,26 +64,22 @@ - (AFHTTPRequestOperation *)fetchContentsOfFileWithID:(NSString *)fileID withRea parameters[@"file_token"] = readToken; } - NSURLRequest *request = [self requestWithMethod:@"GET" path:[NSString stringWithFormat:@"files/%@/content", fileID] parameters:[parameters copy]]; - AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; - [requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { + return [self.requestManager GET:[NSString stringWithFormat:@"files/%@/content", fileID] parameters:[parameters copy] success:^(AFHTTPRequestOperation *operation, id responseObject) { if (completionHandler) { completionHandler(responseObject, nil, nil); } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (completionHandler) { completionHandler(nil, nil, error); } - }]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; + }]; } // http://developers.app.net/docs/resources/file/lifecycle/#create-a-file -- (ANKJSONRequestOperation *)createFile:(ANKFile *)file withData:(NSData *)fileData completion:(ANKClientCompletionBlock)completionHandler { - ANKJSONRequestOperation *request = nil; +- (AFHTTPRequestOperation *)createFile:(ANKFile *)file withData:(NSData *)fileData completion:(ANKClientCompletionBlock)completionHandler { + AFHTTPRequestOperation *request = nil; if (!fileData) { request = [self enqueuePOSTPath:@"files" @@ -98,22 +94,22 @@ - (ANKJSONRequestOperation *)createFile:(ANKFile *)file withData:(NSData *)fileD } -- (ANKJSONRequestOperation *)createFileWithData:(NSData *)fileData mimeType:(NSString *)mimeType filename:(NSString *)filename metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createFileWithData:(NSData *)fileData mimeType:(NSString *)mimeType filename:(NSString *)filename metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler { return [self createFileWithData:fileData mimeType:mimeType filename:filename fileURL:nil kind:([mimeType hasPrefix:@"image"] ? @"image" : @"other") metadata:metadata progress:progressHandler completion:completionHandler]; } -- (ANKJSONRequestOperation *)createFile:(ANKFile *)file withContentsOfURL:(NSURL *)fileURL progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createFile:(ANKFile *)file withContentsOfURL:(NSURL *)fileURL progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler { return [self createFileWithData:nil mimeType:nil filename:nil fileURL:fileURL kind:@"other" metadata:[file JSONDictionary] progress:progressHandler completion:completionHandler]; } -- (ANKJSONRequestOperation *)createFileWithContentsOfURL:(NSURL *)fileURL metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createFileWithContentsOfURL:(NSURL *)fileURL metadata:(NSDictionary *)metadata progress:(ANKClientFileUploadProgressBlock)progressHandler completion:(ANKClientCompletionBlock)completionHandler { return [self createFileWithData:nil mimeType:nil filename:nil fileURL:fileURL kind:nil metadata:metadata progress:progressHandler completion:completionHandler]; } -- (ANKJSONRequestOperation *)createFileWithData:(NSData *)fileData +- (AFHTTPRequestOperation *)createFileWithData:(NSData *)fileData mimeType:(NSString *)mimeType filename:(NSString *)filename fileURL:(NSURL *)fileURL @@ -126,43 +122,50 @@ - (ANKJSONRequestOperation *)createFileWithData:(NSData *)fileData if (fileKind) { modifiedMetadata[@"kind"] = fileKind; } - - NSMutableURLRequest *request = [self multipartFormRequestWithMethod:@"POST" path:@"files" parameters:nil constructingBodyWithBlock:^(id formData) { - if (fileURL) { - [formData appendPartWithFileURL:fileURL name:@"content" error:&multipartEncodeError]; - } else { - [formData appendPartWithFileData:fileData name:@"content" fileName:filename mimeType:mimeType]; - } - - if (metadata.count > 0) { - [formData appendPartWithFileData:[NSJSONSerialization dataWithJSONObject:modifiedMetadata options:0 error:&multipartEncodeError] name:@"metadata" fileName:@"metadata.json" mimeType:@"application/json"]; - } - }]; - - if (multipartEncodeError) { - if (completionHandler) { - completionHandler(nil, nil, multipartEncodeError); - } - return nil; - } - - ANKJSONRequestOperation *requestOperation = (ANKJSONRequestOperation *)[self HTTPRequestOperationWithRequest:request - success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] - failure:[self failureHandlerForClientHandler:completionHandler]]; + AFHTTPRequestOperationManager *manager = self.requestManager; + AFHTTPRequestSerializer *serializer = self.requestManager.requestSerializer; + + NSURL *URL = [manager.baseURL URLByAppendingPathComponent:@"files"]; + + NSMutableURLRequest *request = [serializer multipartFormRequestWithMethod:@"POST" + URLString:[URL absoluteString] + parameters:nil + constructingBodyWithBlock:^(id < AFMultipartFormData > formData) { + if (fileURL) { + [formData appendPartWithFileURL:fileURL name:@"content" error:&multipartEncodeError]; + } else { + [formData appendPartWithFileData:fileData name:@"content" fileName:filename mimeType:mimeType]; + } + + if (metadata.count > 0) { + [formData appendPartWithFileData:[NSJSONSerialization dataWithJSONObject:modifiedMetadata options:0 error:&multipartEncodeError] name:@"metadata" fileName:@"metadata.json" mimeType:@"application/json"]; + } + } error:&multipartEncodeError]; + + if (multipartEncodeError && completionHandler) { + completionHandler(nil, nil, multipartEncodeError); + } + + AFHTTPRequestOperation *requestOperation = [manager HTTPRequestOperationWithRequest:request + success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] + failure:[self failureHandlerForClientHandler:completionHandler]]; + [requestOperation setUploadProgressBlock:progressHandler]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; + + [manager.operationQueue addOperation:requestOperation]; + + return requestOperation; } // http://developers.app.net/docs/resources/file/lifecycle/#update-a-file -- (ANKJSONRequestOperation *)updateFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)updateFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler { return [self updateFileWithID:file.fileID name:file.name isPublic:file.isPublic completion:completionHandler]; } -- (ANKJSONRequestOperation *)updateFileWithID:(NSString *)fileID name:(NSString *)updatedName isPublic:(BOOL)updatedPublicFlag completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)updateFileWithID:(NSString *)fileID name:(NSString *)updatedName isPublic:(BOOL)updatedPublicFlag completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePUTPath:[NSString stringWithFormat:@"files/%@", fileID] parameters:@{@"name": updatedName, @"public": (updatedPublicFlag ? @"true" : @"false")} success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] @@ -172,12 +175,12 @@ - (ANKJSONRequestOperation *)updateFileWithID:(NSString *)fileID name:(NSString // http://developers.app.net/docs/resources/file/lifecycle/#delete-a-file -- (ANKJSONRequestOperation *)deleteFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deleteFile:(ANKFile *)file completion:(ANKClientCompletionBlock)completionHandler { return [self deleteFileWithID:file.fileID completion:completionHandler]; } -- (ANKJSONRequestOperation *)deleteFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deleteFileWithID:(NSString *)fileID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"files/%@", fileID] parameters:nil success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] @@ -187,21 +190,33 @@ - (ANKJSONRequestOperation *)deleteFileWithID:(NSString *)fileID completion:(ANK // http://developers.app.net/docs/resources/file/content/#set-file-content -- (ANKJSONRequestOperation *)setContentOfFile:(ANKFile *)file fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)setContentOfFile:(ANKFile *)file fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { return [self setContentOfFileWithID:file.fileID fileData:fileData mimeType:mimeType completion:completionHandler]; } -- (ANKJSONRequestOperation *)setContentOfFileWithID:(NSString *)fileID fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { - NSMutableURLRequest *request = [self requestWithMethod:@"PUT" path:[NSString stringWithFormat:@"files/%@/content", fileID] parameters:nil]; +- (AFHTTPRequestOperation *)setContentOfFileWithID:(NSString *)fileID fileData:(NSData *)fileData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { + AFHTTPRequestOperationManager *manager = self.requestManager; + AFHTTPRequestSerializer *serializer = self.requestManager.requestSerializer; + + NSURL *URL = [self.requestManager.baseURL URLByAppendingPathComponent:[NSString stringWithFormat:@"files/%@/content", fileID]]; + + NSError *requestError; + NSMutableURLRequest *request = [serializer requestWithMethod:@"POST" URLString:[URL absoluteString] parameters:nil error:&requestError]; + [request setValue:mimeType forHTTPHeaderField:@"Content-Type"]; [request setHTTPBody:fileData]; - - ANKJSONRequestOperation *requestOperation = (ANKJSONRequestOperation *)[self HTTPRequestOperationWithRequest:request - success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] - failure:[self failureHandlerForClientHandler:completionHandler]]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; + + if (requestError && completionHandler) { + completionHandler(nil, nil, requestError); + } + + AFHTTPRequestOperation *requestOperation = [manager HTTPRequestOperationWithRequest:request + success:[self successHandlerForResourceClass:[ANKFile class] clientHandler:completionHandler] + failure:[self failureHandlerForClientHandler:completionHandler]]; + [manager.operationQueue addOperation:requestOperation]; + + return requestOperation; } diff --git a/ADNKit/ANKClient+ANKHandlerBlocks.h b/ADNKit/ANKClient+ANKHandlerBlocks.h index eec7c81..c05eff1 100644 --- a/ADNKit/ANKClient+ANKHandlerBlocks.h +++ b/ADNKit/ANKClient+ANKHandlerBlocks.h @@ -17,7 +17,7 @@ typedef void (^AFNetworkingSuccessBlock)(AFHTTPRequestOperation *operation, id responseObject); typedef void (^AFNetworkingFailureBlock)(AFHTTPRequestOperation *operation, NSError *error); -typedef void (^ANKClientFileUploadProgressBlock)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite); +typedef void (^ANKClientFileUploadProgressBlock)(NSUInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite); @interface ANKClient (ANKHandlerBlocks) diff --git a/ADNKit/ANKClient+ANKInteraction.h b/ADNKit/ANKClient+ANKInteraction.h index cb313f5..8e5e321 100644 --- a/ADNKit/ANKClient+ANKInteraction.h +++ b/ADNKit/ANKClient+ANKInteraction.h @@ -15,6 +15,6 @@ @interface ANKClient (ANKInteraction) -- (ANKJSONRequestOperation *)fetchInteractionsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchInteractionsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKInteraction.m b/ADNKit/ANKClient+ANKInteraction.m index e187225..414dba6 100644 --- a/ADNKit/ANKClient+ANKInteraction.m +++ b/ADNKit/ANKClient+ANKInteraction.m @@ -16,7 +16,7 @@ @implementation ANKClient (ANKInteraction) -- (ANKJSONRequestOperation *)fetchInteractionsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchInteractionsForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/me/interactions" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKInteraction class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKMessage.h b/ADNKit/ANKClient+ANKMessage.h index 396fe41..a3b128c 100644 --- a/ADNKit/ANKClient+ANKMessage.h +++ b/ADNKit/ANKClient+ANKMessage.h @@ -17,19 +17,19 @@ @interface ANKClient (ANKMessage) -- (ANKJSONRequestOperation *)fetchMessagesInChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMessagesInChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMessagesWithIDs:(NSArray *)messageIDs completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMessagesCreatedByCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)createMessage:(ANKMessage *)message inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createMessage:(ANKMessage *)message inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)deleteMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)deleteMessage:(ANKMessage *)message completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMessagesInChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMessagesInChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMessagesWithIDs:(NSArray *)messageIDs completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMessagesCreatedByCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)createMessage:(ANKMessage *)message inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createMessage:(ANKMessage *)message inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)deleteMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deleteMessage:(ANKMessage *)message completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKMessage.m b/ADNKit/ANKClient+ANKMessage.m index 3697f1d..82d61bf 100644 --- a/ADNKit/ANKClient+ANKMessage.m +++ b/ADNKit/ANKClient+ANKMessage.m @@ -19,12 +19,12 @@ @implementation ANKClient (ANKMessage) // http://developers.app.net/docs/resources/message/lifecycle/#retrieve-the-messages-in-a-channel -- (ANKJSONRequestOperation *)fetchMessagesInChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMessagesInChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self fetchMessagesInChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchMessagesInChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMessagesInChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"channels/%@/messages", channelID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKMessage class] clientHandler:completionHandler] @@ -34,12 +34,12 @@ - (ANKJSONRequestOperation *)fetchMessagesInChannelWithID:(NSString *)channelID // http://developers.app.net/docs/resources/message/lookup/#retrieve-a-message -- (ANKJSONRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self fetchMessageWithID:messageID inChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"channels/%@/messages/%@", channelID, messageID] parameters:nil success:[self successHandlerForResourceClass:[ANKMessage class] clientHandler:completionHandler] @@ -49,7 +49,7 @@ - (ANKJSONRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannelW // http://developers.app.net/docs/resources/message/lookup/#retrieve-multiple-messages -- (ANKJSONRequestOperation *)fetchMessagesWithIDs:(NSArray *)messageIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMessagesWithIDs:(NSArray *)messageIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"channels/messages" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKMessage class] clientHandler:completionHandler] @@ -59,7 +59,7 @@ - (ANKJSONRequestOperation *)fetchMessagesWithIDs:(NSArray *)messageIDs completi // http://developers.app.net/docs/resources/message/lookup/#retrieve-my-messages -- (ANKJSONRequestOperation *)fetchMessagesCreatedByCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMessagesCreatedByCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/me/messages" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKMessage class] clientHandler:completionHandler] @@ -69,12 +69,12 @@ - (ANKJSONRequestOperation *)fetchMessagesCreatedByCurrentUserWithCompletion:(AN // http://developers.app.net/docs/resources/message/lifecycle/#create-a-message -- (ANKJSONRequestOperation *)createMessage:(ANKMessage *)message inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createMessage:(ANKMessage *)message inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self createMessage:message inChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)createMessage:(ANKMessage *)message inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createMessage:(ANKMessage *)message inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[NSString stringWithFormat:@"channels/%@/messages", channelID] parameters:[message JSONDictionary] success:[self successHandlerForResourceClass:[ANKMessage class] clientHandler:completionHandler] @@ -82,12 +82,12 @@ - (ANKJSONRequestOperation *)createMessage:(ANKMessage *)message inChannelWithID } -- (ANKJSONRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler { return [self createMessageWithText:messageText inReplyToMessageWithID:messageID inChannelWithID:channel.channelID completion:completionHandler]; } -- (ANKJSONRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createMessageWithText:(NSString *)messageText inReplyToMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { ANKMessage *message = [[ANKMessage alloc] init]; message.text = messageText; message.inReplyToMessageID = messageID ?: nil; @@ -95,7 +95,7 @@ - (ANKJSONRequestOperation *)createMessageWithText:(NSString *)messageText inRep } -- (ANKJSONRequestOperation *)deleteMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deleteMessageWithID:(NSString *)messageID inChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"channels/%@/messages/%@",channelID,messageID] parameters:nil success:[self successHandlerForResourceClass:[ANKMessage class] clientHandler:completionHandler] @@ -103,7 +103,7 @@ - (ANKJSONRequestOperation *)deleteMessageWithID:(NSString *)messageID inChannel } -- (ANKJSONRequestOperation *)deleteMessage:(ANKMessage *)message completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deleteMessage:(ANKMessage *)message completion:(ANKClientCompletionBlock)completionHandler { return [self deleteMessageWithID:message.messageID inChannelWithID:message.channelID completion:completionHandler]; } diff --git a/ADNKit/ANKClient+ANKPlace.h b/ADNKit/ANKClient+ANKPlace.h index 5b41965..9816b05 100644 --- a/ADNKit/ANKClient+ANKPlace.h +++ b/ADNKit/ANKClient+ANKPlace.h @@ -15,9 +15,9 @@ @interface ANKClient (ANKPlace) -- (ANKJSONRequestOperation *)fetchPlaceWithFactualID:(NSString *)factualID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPlaceWithFactualID:(NSString *)factualID completion:(ANKClientCompletionBlock)completionHandler; // parameters contains keys located in ANKPlace.h -- (ANKJSONRequestOperation *)searchForPlacesWithParameters:(NSDictionary *)params completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)searchForPlacesWithParameters:(NSDictionary *)params completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKPlace.m b/ADNKit/ANKClient+ANKPlace.m index 098a9ae..740a197 100644 --- a/ADNKit/ANKClient+ANKPlace.m +++ b/ADNKit/ANKClient+ANKPlace.m @@ -18,7 +18,7 @@ @implementation ANKClient (ANKPlace) // http://developers.app.net/docs/resources/place/#retrieve-a-place -- (ANKJSONRequestOperation *)fetchPlaceWithFactualID:(NSString *)factualID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPlaceWithFactualID:(NSString *)factualID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"places/%@", factualID] parameters:nil success:[self successHandlerForResourceClass:[ANKPlace class] clientHandler:completionHandler] @@ -29,7 +29,7 @@ - (ANKJSONRequestOperation *)fetchPlaceWithFactualID:(NSString *)factualID compl // parameters contains keys located in ANKPlace.h // http://developers.app.net/docs/resources/place/#search-for-a-place -- (ANKJSONRequestOperation *)searchForPlacesWithParameters:(NSDictionary *)params completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)searchForPlacesWithParameters:(NSDictionary *)params completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"places/search" parameters:params success:[self successHandlerForCollectionOfResourceClass:[ANKPlace class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKPost.h b/ADNKit/ANKClient+ANKPost.h index b393def..0628022 100644 --- a/ADNKit/ANKClient+ANKPost.h +++ b/ADNKit/ANKClient+ANKPost.h @@ -17,35 +17,35 @@ @interface ANKClient (ANKPost) -- (ANKJSONRequestOperation *)fetchPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsWithIDs:(NSArray *)postIDs completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsWithIDs:(NSArray *)postIDs completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchRepliesToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchRepliesToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchRepliesToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchRepliesToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsStarredByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsStarredByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsStarredByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsStarredByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createPostWithText:(NSString *)text completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createPostWithText:(NSString *)text inReplyToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)createPostWithText:(NSString *)text inReplyToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)deletePost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)deletePostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createPostWithText:(NSString *)text completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createPostWithText:(NSString *)text inReplyToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)createPostWithText:(NSString *)text inReplyToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deletePost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deletePostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)repostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)repostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unrepostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unrepostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)repostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)repostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unrepostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unrepostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)starPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)starPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unstarPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unstarPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)starPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)starPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unstarPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unstarPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)reportPostAsSpam:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)reportPostWithIDAsSpam:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)reportPostAsSpam:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)reportPostWithIDAsSpam:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)searchForPostsWithQuery:(ANKSearchQuery *)query completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)searchForPostsWithQuery:(ANKSearchQuery *)query completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKPost.m b/ADNKit/ANKClient+ANKPost.m index 7e6e28e..df92e3b 100644 --- a/ADNKit/ANKClient+ANKPost.m +++ b/ADNKit/ANKClient+ANKPost.m @@ -20,7 +20,7 @@ @implementation ANKClient (ANKPost) // http://developers.app.net/docs/resources/post/lookup/#retrieve-a-post -- (ANKJSONRequestOperation *)fetchPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts/%@", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -30,7 +30,7 @@ - (ANKJSONRequestOperation *)fetchPostWithID:(NSString *)postID completion:(ANKC // http://developers.app.net/docs/resources/post/lookup/#retrieve-multiple-posts -- (ANKJSONRequestOperation *)fetchPostsWithIDs:(NSArray *)postIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsWithIDs:(NSArray *)postIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts"] parameters:@{@"ids": [postIDs componentsJoinedByString:@","]} success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -40,12 +40,12 @@ - (ANKJSONRequestOperation *)fetchPostsWithIDs:(NSArray *)postIDs completion:(AN // http://developers.app.net/docs/resources/post/replies/#retrieve-the-replies-to-a-post -- (ANKJSONRequestOperation *)fetchRepliesToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchRepliesToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self fetchRepliesToPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchRepliesToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchRepliesToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts/%@/replies", postID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -55,12 +55,12 @@ - (ANKJSONRequestOperation *)fetchRepliesToPostWithID:(NSString *)postID complet // http://developers.app.net/docs/resources/post/stars/#retrieve-posts-starred-by-a-user -- (ANKJSONRequestOperation *)fetchPostsStarredByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsStarredByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchPostsStarredByUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchPostsStarredByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsStarredByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"users/%@/stars", userID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -70,7 +70,7 @@ - (ANKJSONRequestOperation *)fetchPostsStarredByUserWithID:(NSString *)userID co // http://developers.app.net/docs/resources/post/lifecycle/#create-a-post -- (ANKJSONRequestOperation *)createPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:@"posts" parameters:[post JSONDictionary] success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -78,17 +78,17 @@ - (ANKJSONRequestOperation *)createPost:(ANKPost *)post completion:(ANKClientCom } -- (ANKJSONRequestOperation *)createPostWithText:(NSString *)text completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createPostWithText:(NSString *)text completion:(ANKClientCompletionBlock)completionHandler { return [self createPostWithText:text inReplyToPostWithID:nil completion:completionHandler]; } -- (ANKJSONRequestOperation *)createPostWithText:(NSString *)text inReplyToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createPostWithText:(NSString *)text inReplyToPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self createPostWithText:text inReplyToPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)createPostWithText:(NSString *)text inReplyToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)createPostWithText:(NSString *)text inReplyToPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:@"posts" parameters:(postID ? @{@"text": text, @"reply_to": postID} : @{@"text": text}) success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -98,12 +98,12 @@ - (ANKJSONRequestOperation *)createPostWithText:(NSString *)text inReplyToPostWi // http://developers.app.net/docs/resources/post/lifecycle/#delete-a-post -- (ANKJSONRequestOperation *)deletePost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deletePost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self deletePostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)deletePostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deletePostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"posts/%@", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -113,12 +113,12 @@ - (ANKJSONRequestOperation *)deletePostWithID:(NSString *)postID completion:(ANK // http://developers.app.net/docs/resources/post/reposts/#repost-a-post -- (ANKJSONRequestOperation *)repostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)repostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self repostPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)repostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)repostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[NSString stringWithFormat:@"posts/%@/repost", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -128,12 +128,12 @@ - (ANKJSONRequestOperation *)repostPostWithID:(NSString *)postID completion:(ANK // http://developers.app.net/docs/resources/post/reposts/#unrepost-a-post -- (ANKJSONRequestOperation *)unrepostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unrepostPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self unrepostPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unrepostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unrepostPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"posts/%@/repost", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -143,12 +143,12 @@ - (ANKJSONRequestOperation *)unrepostPostWithID:(NSString *)postID completion:(A // http://developers.app.net/docs/resources/post/stars/#star-a-post -- (ANKJSONRequestOperation *)starPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)starPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self starPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)starPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)starPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[NSString stringWithFormat:@"posts/%@/star", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -158,12 +158,12 @@ - (ANKJSONRequestOperation *)starPostWithID:(NSString *)postID completion:(ANKCl // http://developers.app.net/docs/resources/post/stars/#unstar-a-post -- (ANKJSONRequestOperation *)unstarPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unstarPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self unstarPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unstarPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unstarPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[NSString stringWithFormat:@"posts/%@/star", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -173,12 +173,12 @@ - (ANKJSONRequestOperation *)unstarPostWithID:(NSString *)postID completion:(ANK // http://developers.app.net/docs/resources/post/report/#report-a-post -- (ANKJSONRequestOperation *)reportPostAsSpam:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)reportPostAsSpam:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self reportPostWithIDAsSpam:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)reportPostWithIDAsSpam:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)reportPostWithIDAsSpam:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[NSString stringWithFormat:@"posts/%@/report", postID] parameters:nil success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -188,7 +188,7 @@ - (ANKJSONRequestOperation *)reportPostWithIDAsSpam:(NSString *)postID completio // http://developers.app.net/docs/resources/post/search/ -- (ANKJSONRequestOperation *)searchForPostsWithQuery:(ANKSearchQuery *)query completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)searchForPostsWithQuery:(ANKSearchQuery *)query completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"posts/search" parameters:[query JSONDictionary] success:[self successHandlerForResourceClass:[ANKPost class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKPostStreams.h b/ADNKit/ANKClient+ANKPostStreams.h index 18a8b11..bced825 100644 --- a/ADNKit/ANKClient+ANKPostStreams.h +++ b/ADNKit/ANKClient+ANKPostStreams.h @@ -17,16 +17,16 @@ @interface ANKClient (ANKPostStreams) -- (ANKJSONRequestOperation *)fetchGlobalStreamWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsWithHashtag:(NSString *)hashtag completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchGlobalStreamWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsWithHashtag:(NSString *)hashtag completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsCreatedByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsCreatedByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsCreatedByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsCreatedByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsMentioningUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchPostsMentioningUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsMentioningUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchPostsMentioningUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUnifiedStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUnifiedStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKPostStreams.m b/ADNKit/ANKClient+ANKPostStreams.m index d9b4565..ce894f1 100644 --- a/ADNKit/ANKClient+ANKPostStreams.m +++ b/ADNKit/ANKClient+ANKPostStreams.m @@ -19,7 +19,7 @@ @implementation ANKClient (ANKPostStreams) // http://developers.app.net/docs/resources/post/streams/#retrieve-the-global-stream -- (ANKJSONRequestOperation *)fetchGlobalStreamWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchGlobalStreamWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"posts/stream/global" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -29,7 +29,7 @@ - (ANKJSONRequestOperation *)fetchGlobalStreamWithCompletion:(ANKClientCompletio // http://developers.app.net/docs/resources/post/streams/#retrieve-tagged-posts -- (ANKJSONRequestOperation *)fetchPostsWithHashtag:(NSString *)hashtag completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsWithHashtag:(NSString *)hashtag completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts/tag/%@", hashtag] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -39,12 +39,12 @@ - (ANKJSONRequestOperation *)fetchPostsWithHashtag:(NSString *)hashtag completio // http://developers.app.net/docs/resources/post/streams/#retrieve-posts-created-by-a-user -- (ANKJSONRequestOperation *)fetchPostsCreatedByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsCreatedByUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchPostsCreatedByUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchPostsCreatedByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsCreatedByUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"users/%@/posts", userID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -54,12 +54,12 @@ - (ANKJSONRequestOperation *)fetchPostsCreatedByUserWithID:(NSString *)userID co // http://developers.app.net/docs/resources/post/streams/#retrieve-posts-mentioning-a-user -- (ANKJSONRequestOperation *)fetchPostsMentioningUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsMentioningUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchPostsMentioningUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchPostsMentioningUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchPostsMentioningUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"users/%@/mentions", userID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -69,7 +69,7 @@ - (ANKJSONRequestOperation *)fetchPostsMentioningUserWithID:(NSString *)userID c // http://developers.app.net/docs/resources/post/streams/#retrieve-a-users-personalized-stream -- (ANKJSONRequestOperation *)fetchStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"posts/stream" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] @@ -79,7 +79,7 @@ - (ANKJSONRequestOperation *)fetchStreamForCurrentUserWithCompletion:(ANKClientC // http://developers.app.net/docs/resources/post/streams/#retrieve-a-users-unified-stream -- (ANKJSONRequestOperation *)fetchUnifiedStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUnifiedStreamForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"posts/stream/unified" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKPost class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKRequestsAPI.h b/ADNKit/ANKClient+ANKRequestsAPI.h index 13ef815..2c81ec4 100644 --- a/ADNKit/ANKClient+ANKRequestsAPI.h +++ b/ADNKit/ANKClient+ANKRequestsAPI.h @@ -14,20 +14,18 @@ #import "ANKClient+ANKHandlerBlocks.h" -@class ANKJSONRequestOperation; - @interface ANKClient (ANKRequestsAPI) // These exist to return the request that is enqueued, which allows for cancellation. AFNetworking is too stubborn to add this to their existing convenience methods, and too stubborn to write news ones to do this. -- (ANKJSONRequestOperation *)enqueueRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; +- (AFHTTPRequestOperation *)enqueueRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; -- (ANKJSONRequestOperation *)enqueueGETPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; +- (AFHTTPRequestOperation *)enqueueGETPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; -- (ANKJSONRequestOperation *)enqueuePOSTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; +- (AFHTTPRequestOperation *)enqueuePOSTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; -- (ANKJSONRequestOperation *)enqueuePUTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; +- (AFHTTPRequestOperation *)enqueuePUTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; -- (ANKJSONRequestOperation *)enqueueDELETEPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; +- (AFHTTPRequestOperation *)enqueueDELETEPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock; @end diff --git a/ADNKit/ANKClient+ANKRequestsAPI.m b/ADNKit/ANKClient+ANKRequestsAPI.m index 70550b1..db7bfbc 100644 --- a/ADNKit/ANKClient+ANKRequestsAPI.m +++ b/ADNKit/ANKClient+ANKRequestsAPI.m @@ -11,38 +11,52 @@ */ #import "ANKClient+ANKRequestsAPI.h" -#import "ANKJSONRequestOperation.h" +#import "AFHTTPRequestOperation.h" @implementation ANKClient (ANKRequestsAPI) -- (ANKJSONRequestOperation *)enqueueRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { - NSURLRequest *request = [self requestWithMethod:method path:path parameters:parameters]; - ANKJSONRequestOperation *operation = (ANKJSONRequestOperation *)[self HTTPRequestOperationWithRequest:request success:successBlock failure:failureBlock]; - [self enqueueHTTPRequestOperation:operation]; - operation.successCallbackQueue = self.successCallbackQueue; - operation.failureCallbackQueue = self.failureCallbackQueue; +- (AFHTTPRequestOperation *)enqueueRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { + AFHTTPRequestOperationManager *manager = self.requestManager; + AFHTTPRequestSerializer *serializer = self.requestManager.requestSerializer; - return operation; + NSURL *URL = [manager.baseURL URLByAppendingPathComponent:path]; + + NSError *requestError; + NSURLRequest *request = [serializer requestWithMethod:method URLString:[URL absoluteString] parameters:nil error:&requestError]; + + if (requestError && failureBlock) { + failureBlock(nil, requestError); + } + + AFHTTPRequestOperation *operation = [manager HTTPRequestOperationWithRequest:request + success:successBlock + failure:failureBlock]; + + operation.completionQueue = self.successCallbackQueue; + + [manager.operationQueue addOperation:operation]; + + return operation; } -- (ANKJSONRequestOperation *)enqueueGETPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { +- (AFHTTPRequestOperation *)enqueueGETPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { return [self enqueueRequestWithMethod:@"GET" path:path parameters:parameters success:successBlock failure:failureBlock]; } -- (ANKJSONRequestOperation *)enqueuePOSTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { +- (AFHTTPRequestOperation *)enqueuePOSTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { return [self enqueueRequestWithMethod:@"POST" path:path parameters:parameters success:successBlock failure:failureBlock]; } -- (ANKJSONRequestOperation *)enqueuePUTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { +- (AFHTTPRequestOperation *)enqueuePUTPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { return [self enqueueRequestWithMethod:@"PUT" path:path parameters:parameters success:successBlock failure:failureBlock]; } -- (ANKJSONRequestOperation *)enqueueDELETEPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { +- (AFHTTPRequestOperation *)enqueueDELETEPath:(NSString *)path parameters:(NSDictionary *)parameters success:(AFNetworkingSuccessBlock)successBlock failure:(AFNetworkingFailureBlock)failureBlock { return [self enqueueRequestWithMethod:@"DELETE" path:path parameters:parameters success:successBlock failure:failureBlock]; } diff --git a/ADNKit/ANKClient+ANKStreamMarker.h b/ADNKit/ANKClient+ANKStreamMarker.h index 1353749..bad81fd 100644 --- a/ADNKit/ANKClient+ANKStreamMarker.h +++ b/ADNKit/ANKClient+ANKStreamMarker.h @@ -17,6 +17,6 @@ @interface ANKClient (ANKStreamMarker) -- (ANKJSONRequestOperation *)updateStreamMarker:(ANKStreamMarker *)streamMarker completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)updateStreamMarker:(ANKStreamMarker *)streamMarker completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKStreamMarker.m b/ADNKit/ANKClient+ANKStreamMarker.m index 9fae809..a6627ad 100644 --- a/ADNKit/ANKClient+ANKStreamMarker.m +++ b/ADNKit/ANKClient+ANKStreamMarker.m @@ -18,7 +18,7 @@ @implementation ANKClient (ANKStreamMarker) // http://developers.app.net/docs/resources/stream-marker/#update-a-stream-marker -- (ANKJSONRequestOperation *)updateStreamMarker:(ANKStreamMarker *)streamMarker completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)updateStreamMarker:(ANKStreamMarker *)streamMarker completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:@"posts/marker" parameters:[streamMarker JSONDictionary] success:[self successHandlerForResourceClass:[ANKStreamMarker class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKTokenStatus.h b/ADNKit/ANKClient+ANKTokenStatus.h index 359e424..f558dca 100644 --- a/ADNKit/ANKClient+ANKTokenStatus.h +++ b/ADNKit/ANKClient+ANKTokenStatus.h @@ -15,9 +15,9 @@ @interface ANKClient (ANKTokenStatus) -- (ANKJSONRequestOperation *)fetchTokenStatusForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchTokenStatusesForAuthorizedUsersWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchAuthorizedUserIDsWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)deauthorizeCurrentUserTokenWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchTokenStatusForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchTokenStatusesForAuthorizedUsersWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchAuthorizedUserIDsWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deauthorizeCurrentUserTokenWithCompletion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKTokenStatus.m b/ADNKit/ANKClient+ANKTokenStatus.m index 05a5823..dbe35bb 100644 --- a/ADNKit/ANKClient+ANKTokenStatus.m +++ b/ADNKit/ANKClient+ANKTokenStatus.m @@ -16,7 +16,7 @@ @implementation ANKClient (ANKTokenStatus) -- (ANKJSONRequestOperation *)fetchTokenStatusForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchTokenStatusForCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"token" parameters:nil success:[self successHandlerForResourceClass:[ANKTokenStatus class] clientHandler:completionHandler] @@ -24,7 +24,7 @@ - (ANKJSONRequestOperation *)fetchTokenStatusForCurrentUserWithCompletion:(ANKCl } -- (ANKJSONRequestOperation *)fetchTokenStatusesForAuthorizedUsersWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchTokenStatusesForAuthorizedUsersWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"apps/me/tokens" parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKTokenStatus class] clientHandler:completionHandler] @@ -32,7 +32,7 @@ - (ANKJSONRequestOperation *)fetchTokenStatusesForAuthorizedUsersWithCompletion: } -- (ANKJSONRequestOperation *)fetchAuthorizedUserIDsWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchAuthorizedUserIDsWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"apps/me/tokens/user_ids" parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -40,7 +40,7 @@ - (ANKJSONRequestOperation *)fetchAuthorizedUserIDsWithCompletion:(ANKClientComp } -- (ANKJSONRequestOperation *)deauthorizeCurrentUserTokenWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)deauthorizeCurrentUserTokenWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:@"token" parameters:nil success:[self successHandlerForResourceClass:[ANKTokenStatus class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient+ANKUser.h b/ADNKit/ANKClient+ANKUser.h index 75aa792..caecd55 100644 --- a/ADNKit/ANKClient+ANKUser.h +++ b/ADNKit/ANKClient+ANKUser.h @@ -17,57 +17,57 @@ @interface ANKClient (ANKUser) -- (ANKJSONRequestOperation *)fetchCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersWithIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)searchForUsersWithQuery:(NSString *)query completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersWithIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)searchForUsersWithQuery:(NSString *)query completion:(ANKClientCompletionBlock)completionHandler; - (AFHTTPRequestOperation *)fetchAvatarImageURLForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; - (AFHTTPRequestOperation *)fetchCoverImageURLForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchUserIDsUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserIDsUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserIDsFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUserIDsFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchMutedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMutedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMutedUserIDsForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchMutedUserIDsForUserIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchBlockedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchBlockedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchBlockedUsersForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchBlockedUsersForUserIDs:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)fetchUsersRepostedForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersRepostedForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersStarredForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)fetchUsersStarredForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)updateCurrentUser:(ANKUser *)user fullName:(NSString *)fullName descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)updateCurrentUserName:(NSString *)fullName locale:(NSString *)locale timezone:(NSString *)timezone descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHander; -- (ANKJSONRequestOperation *)updateCurrentUserAvatarWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)updateCurrentUserCoverImageWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)followUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)followUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unfollowUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unfollowUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)muteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)muteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unmuteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unmuteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; - -- (ANKJSONRequestOperation *)blockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)blockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unblockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; -- (ANKJSONRequestOperation *)unblockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchUserIDsUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserIDsUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserIDsFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUserIDsFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchMutedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMutedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMutedUserIDsForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchMutedUserIDsForUserIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchBlockedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchBlockedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchBlockedUsersForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchBlockedUsersForUserIDs:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)fetchUsersRepostedForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersRepostedForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersStarredForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)fetchUsersStarredForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)updateCurrentUser:(ANKUser *)user fullName:(NSString *)fullName descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)updateCurrentUserName:(NSString *)fullName locale:(NSString *)locale timezone:(NSString *)timezone descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHander; +- (AFHTTPRequestOperation *)updateCurrentUserAvatarWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)updateCurrentUserCoverImageWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)followUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)followUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unfollowUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unfollowUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)muteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)muteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unmuteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unmuteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; + +- (AFHTTPRequestOperation *)blockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)blockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unblockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)unblockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler; @end diff --git a/ADNKit/ANKClient+ANKUser.m b/ADNKit/ANKClient+ANKUser.m index f4c72a5..695c18f 100644 --- a/ADNKit/ANKClient+ANKUser.m +++ b/ADNKit/ANKClient+ANKUser.m @@ -13,7 +13,7 @@ #import "ANKClient+ANKUser.h" #import "ANKUser.h" #import "ANKPost.h" -#import "ANKJSONRequestOperation.h" +#import "AFHTTPRequestOperation.h" @interface ANKClient (ANKUserPrivate) @@ -41,12 +41,12 @@ - (ANKUser *)userForID:(NSString *)userID { // GET /stream/0/users/[user_id] // http://developers.app.net/docs/resources/user/lookup/#retrieve-a-user -- (ANKJSONRequestOperation *)fetchCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchCurrentUserWithCompletion:(ANKClientCompletionBlock)completionHandler { return [self fetchUserWithID:@"me" completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:nil] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -57,12 +57,12 @@ - (ANKJSONRequestOperation *)fetchUserWithID:(NSString *)userID completion:(ANKC // PUT /stream/0/users/me // http://developers.app.net/docs/resources/user/profile/#update-a-user -- (ANKJSONRequestOperation *)updateCurrentUser:(ANKUser *)user fullName:(NSString *)fullName descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)updateCurrentUser:(ANKUser *)user fullName:(NSString *)fullName descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHandler { return [self updateCurrentUserName:fullName locale:user.locale timezone:user.timezone descriptionText:descriptionText completion:completionHandler]; } -- (ANKJSONRequestOperation *)updateCurrentUserName:(NSString *)fullName locale:(NSString *)locale timezone:(NSString *)timezone descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHander { +- (AFHTTPRequestOperation *)updateCurrentUserName:(NSString *)fullName locale:(NSString *)locale timezone:(NSString *)timezone descriptionText:(NSString *)descriptionText completion:(ANKClientCompletionBlock)completionHander { return [self enqueuePUTPath:@"users/me" parameters:@{@"name": fullName, @"locale": locale, @"timezone": timezone, @"description": @{@"text": descriptionText}} success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHander] @@ -74,34 +74,30 @@ - (ANKJSONRequestOperation *)updateCurrentUserName:(NSString *)fullName locale:( // http://developers.app.net/docs/resources/user/profile/#retrieve-a-users-avatar-image - (AFHTTPRequestOperation *)fetchAvatarImageURLForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { - NSURLRequest *URLRequest = [self requestWithMethod:@"HEAD" path:[self endpointPathForUserID:userID endpoint:@"avatar"] parameters:nil]; - AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:URLRequest]; - [requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { - if (completionHandler) { - completionHandler([operation.response URL], nil, nil); - } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { - if (completionHandler) { - completionHandler(nil, nil, error); - } - }]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; + return [self.requestManager HEAD:[self endpointPathForUserID:userID endpoint:@"avatar"] parameters:nil success:^(AFHTTPRequestOperation *operation) { + if (completionHandler) { + completionHandler([operation.response URL], nil, nil); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completionHandler) { + completionHandler(nil, nil, error); + } + }]; } // POST /stream/0/users/me/avatar // http://developers.app.net/docs/resources/user/profile/#update-a-users-avatar-image -- (ANKJSONRequestOperation *)updateCurrentUserAvatarWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { - NSURLRequest *URLRequest = [self multipartFormRequestWithMethod:@"POST" path:[self endpointPathForUserID:@"me" endpoint:@"avatar"] parameters:nil constructingBodyWithBlock:^(id formData) { +- (AFHTTPRequestOperation *)updateCurrentUserAvatarWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { + NSURL *URL = [self.requestManager.baseURL URLByAppendingPathComponent:[self endpointPathForUserID:@"me" endpoint:@"avatar"]]; + NSMutableURLRequest *URLRequest = [self.requestManager.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[URL absoluteString] parameters:nil constructingBodyWithBlock:^(id formData) { [formData appendPartWithFileData:imageData name:@"avatar" fileName:@"avatar" mimeType:mimeType]; - }]; - ANKJSONRequestOperation *requestOperation = (ANKJSONRequestOperation *)[self HTTPRequestOperationWithRequest:URLRequest - success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] - failure:[self failureHandlerForClientHandler:completionHandler]]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; + } error:nil]; + + return [self.requestManager HTTPRequestOperationWithRequest:URLRequest + success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] + failure:[self failureHandlerForClientHandler:completionHandler]]; } @@ -109,46 +105,39 @@ - (ANKJSONRequestOperation *)updateCurrentUserAvatarWithImageData:(NSData *)imag // http://developers.app.net/docs/resources/user/profile/#retrieve-a-users-cover-image - (AFHTTPRequestOperation *)fetchCoverImageURLForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { - NSURLRequest *URLRequest = [self requestWithMethod:@"HEAD" path:[self endpointPathForUserID:userID endpoint:@"cover"] parameters:nil]; - AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:URLRequest]; - [requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { - if (completionHandler) { - completionHandler([operation.response URL], nil, nil); - } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { - if (completionHandler) { - completionHandler(nil, nil, error); - } - }]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; + return [self.requestManager HEAD:[self endpointPathForUserID:userID endpoint:@"cover"] parameters:nil success:^(AFHTTPRequestOperation *operation) { + if (completionHandler) { + completionHandler([operation.response URL], nil, nil); + } + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + if (completionHandler) { + completionHandler(nil, nil, error); + } + }]; } // POST /stream/0/users/me/cover // http://developers.app.net/docs/resources/user/profile/#update-a-users-cover-image -- (ANKJSONRequestOperation *)updateCurrentUserCoverImageWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler { - NSURLRequest *URLRequest = [self multipartFormRequestWithMethod:@"POST" path:[self endpointPathForUserID:@"me" endpoint:@"cover"] parameters:nil constructingBodyWithBlock:^(id formData) { - [formData appendPartWithFileData:imageData name:@"cover" fileName:@"cover" mimeType:mimeType]; - }]; - ANKJSONRequestOperation *requestOperation = (ANKJSONRequestOperation *)[self HTTPRequestOperationWithRequest:URLRequest - success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] - failure:[self failureHandlerForClientHandler:completionHandler]]; - [self enqueueHTTPRequestOperation:requestOperation]; - return requestOperation; +- (AFHTTPRequestOperation *)updateCurrentUserCoverImageWithImageData:(NSData *)imageData mimeType:(NSString *)mimeType completion:(ANKClientCompletionBlock)completionHandler +{ + return [self.requestManager POST:[self endpointPathForUserID:@"me" endpoint:@"cover"] parameters:nil constructingBodyWithBlock:^(id formData) { + [formData appendPartWithFileData:imageData name:@"cover" fileName:@"cover" mimeType:mimeType]; + } success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] + failure:[self failureHandlerForClientHandler:completionHandler]]; } // POST /stream/0/users/[user_id]/follow // http://developers.app.net/docs/resources/user/following/#follow-a-user -- (ANKJSONRequestOperation *)followUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)followUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self followUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)followUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)followUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[self endpointPathForUserID:userID endpoint:@"follow"] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -159,12 +148,12 @@ - (ANKJSONRequestOperation *)followUserWithID:(NSString *)userID completion:(ANK // DELETE /stream/0/users/[user_id]/follow // http://developers.app.net/docs/resources/user/following/#unfollow-a-user -- (ANKJSONRequestOperation *)unfollowUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unfollowUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self unfollowUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unfollowUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unfollowUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[self endpointPathForUserID:userID endpoint:@"follow"] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -175,12 +164,12 @@ - (ANKJSONRequestOperation *)unfollowUserWithID:(NSString *)userID completion:(A // POST /stream/0/users/[user_id]/mute // http://developers.app.net/docs/resources/user/muting/#mute-a-user -- (ANKJSONRequestOperation *)muteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)muteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self muteUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)muteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)muteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[self endpointPathForUserID:userID endpoint:@"mute"] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -191,12 +180,12 @@ - (ANKJSONRequestOperation *)muteUserWithID:(NSString *)userID completion:(ANKCl // DELETE /stream/0/users/[user_id]/mute // http://developers.app.net/docs/resources/user/muting/#unmute-a-user -- (ANKJSONRequestOperation *)unmuteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unmuteUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self unmuteUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unmuteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unmuteUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[self endpointPathForUserID:userID endpoint:@"mute"] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -207,7 +196,7 @@ - (ANKJSONRequestOperation *)unmuteUserWithID:(NSString *)userID completion:(ANK // GET /stream/0/users // http://developers.app.net/docs/resources/user/lookup/#retrieve-multiple-users -- (ANKJSONRequestOperation *)fetchUsersWithIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersWithIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users" parameters:@{@"ids": [userIDs componentsJoinedByString:@","]} success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -218,7 +207,7 @@ - (ANKJSONRequestOperation *)fetchUsersWithIDs:(NSArray *)userIDs completion:(AN // GET /stream/0/users/search // http://developers.app.net/docs/resources/user/lookup/#search-for-users -- (ANKJSONRequestOperation *)searchForUsersWithQuery:(NSString *)query completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)searchForUsersWithQuery:(NSString *)query completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/search" parameters:@{@"q": query} success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -229,12 +218,12 @@ - (ANKJSONRequestOperation *)searchForUsersWithQuery:(NSString *)query completio // GET /stream/0/users/[user_id]/following // http://developers.app.net/docs/resources/user/following/#list-users-a-user-is-following -- (ANKJSONRequestOperation *)fetchUsersUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUsersUserWithIDFollowing:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUsersUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:@"following"] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -245,12 +234,12 @@ - (ANKJSONRequestOperation *)fetchUsersUserWithIDFollowing:(NSString *)userID co // GET /stream/0/users/[user_id]/followers // http://developers.app.net/docs/resources/user/following/#list-users-following-a-user -- (ANKJSONRequestOperation *)fetchUsersFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUsersFollowingUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUsersFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:@"followers"] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -261,12 +250,12 @@ - (ANKJSONRequestOperation *)fetchUsersFollowingUserWithID:(NSString *)userID co // GET /stream/0/users/[user_id]/following/ids // http://developers.app.net/docs/resources/user/following/#list-user-ids-a-user-is-following -- (ANKJSONRequestOperation *)fetchUserIDsUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsUserFollowing:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUserIDsUserWithIDFollowing:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUserIDsUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsUserWithIDFollowing:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:@"following/ids"] parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -277,12 +266,12 @@ - (ANKJSONRequestOperation *)fetchUserIDsUserWithIDFollowing:(NSString *)userID // GET /stream/0/users/[user_id]/followers/ids // http://developers.app.net/docs/resources/user/following/#list-user-ids-following-a-user -- (ANKJSONRequestOperation *)fetchUserIDsFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsFollowingUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUserIDsFollowingUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUserIDsFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUserIDsFollowingUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:@"followers/ids"] parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -293,12 +282,12 @@ - (ANKJSONRequestOperation *)fetchUserIDsFollowingUserWithID:(NSString *)userID // GET /stream/0/users/[user_id]/muted // http://developers.app.net/docs/resources/user/muting/#list-muted-users -- (ANKJSONRequestOperation *)fetchMutedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMutedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchMutedUsersForUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchMutedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMutedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:completionHandler] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -309,12 +298,12 @@ - (ANKJSONRequestOperation *)fetchMutedUsersForUserWithID:(NSString *)userID com // GET /stream/0/users/[user_id]/muted // http://developers.app.net/docs/resources/user/muting/#retrieve-muted-user-ids-for-multiple-users -- (ANKJSONRequestOperation *)fetchMutedUserIDsForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMutedUserIDsForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler { return [self fetchMutedUserIDsForUserIDs:[users valueForKeyPath:@"userID"] completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchMutedUserIDsForUserIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchMutedUserIDsForUserIDs:(NSArray *)userIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"muted/ids" parameters:@{@"ids": [userIDs componentsJoinedByString:@","]} success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -324,12 +313,12 @@ - (ANKJSONRequestOperation *)fetchMutedUserIDsForUserIDs:(NSArray *)userIDs comp // http://developers.app.net/docs/resources/user/blocking/#list-blocked-users -- (ANKJSONRequestOperation *)fetchBlockedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchBlockedUsersForUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self fetchBlockedUsersForUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchBlockedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchBlockedUsersForUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[self endpointPathForUserID:userID endpoint:@"blocked"] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -339,12 +328,12 @@ - (ANKJSONRequestOperation *)fetchBlockedUsersForUserWithID:(NSString *)userID c // http://developers.app.net/docs/resources/user/blocking/#retrieve-blocked-user-ids-for-multiple-users -- (ANKJSONRequestOperation *)fetchBlockedUsersForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchBlockedUsersForUsers:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler { return [self fetchBlockedUsersForUserIDs:[users valueForKeyPath:@"userID"] completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchBlockedUsersForUserIDs:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchBlockedUsersForUserIDs:(NSArray *)users completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"users/blocked/ids" parameters:nil success:[self successHandlerForPrimitiveResponseWithClientHandler:completionHandler] @@ -355,12 +344,12 @@ - (ANKJSONRequestOperation *)fetchBlockedUsersForUserIDs:(NSArray *)users comple // GET /stream/0/posts/[post_id]/reposters // http://developers.app.net/docs/resources/user/post-interactions/#list-users-who-have-reposted-a-post -- (ANKJSONRequestOperation *)fetchUsersRepostedForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersRepostedForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUsersRepostedForPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUsersRepostedForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersRepostedForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts/%@/reposters", postID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -371,12 +360,12 @@ - (ANKJSONRequestOperation *)fetchUsersRepostedForPostWithID:(NSString *)postID // GET /stream/0/posts/[post_id]/stars // http://developers.app.net/docs/resources/user/post-interactions/#list-users-who-have-starred-a-post -- (ANKJSONRequestOperation *)fetchUsersStarredForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersStarredForPost:(ANKPost *)post completion:(ANKClientCompletionBlock)completionHandler { return [self fetchUsersStarredForPostWithID:post.postID completion:completionHandler]; } -- (ANKJSONRequestOperation *)fetchUsersStarredForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)fetchUsersStarredForPostWithID:(NSString *)postID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:[NSString stringWithFormat:@"posts/%@/stars", postID] parameters:nil success:[self successHandlerForCollectionOfResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -386,12 +375,12 @@ - (ANKJSONRequestOperation *)fetchUsersStarredForPostWithID:(NSString *)postID c // http://developers.app.net/docs/resources/user/blocking/#block-a-user -- (ANKJSONRequestOperation *)blockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)blockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self blockUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)blockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)blockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueuePOSTPath:[self endpointPathForUserID:userID endpoint:@"block"] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] @@ -401,12 +390,12 @@ - (ANKJSONRequestOperation *)blockUserWithID:(NSString *)userID completion:(ANKC // http://developers.app.net/docs/resources/user/blocking/#unblock-a-user -- (ANKJSONRequestOperation *)unblockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unblockUser:(ANKUser *)user completion:(ANKClientCompletionBlock)completionHandler { return [self unblockUserWithID:user.userID completion:completionHandler]; } -- (ANKJSONRequestOperation *)unblockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { +- (AFHTTPRequestOperation *)unblockUserWithID:(NSString *)userID completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueDELETEPath:[self endpointPathForUserID:userID endpoint:@"block"] parameters:nil success:[self successHandlerForResourceClass:[ANKUser class] clientHandler:completionHandler] diff --git a/ADNKit/ANKClient.h b/ADNKit/ANKClient.h index 47115f5..e975b67 100644 --- a/ADNKit/ANKClient.h +++ b/ADNKit/ANKClient.h @@ -11,7 +11,7 @@ */ #import "AFNetworking.h" -#import "ANKJSONRequestOperation.h" +#import "AFHTTPRequestOperation.h" typedef NS_ENUM(NSUInteger, ANKAuthScope) { @@ -65,16 +65,18 @@ typedef void (^ANKClientCompletionBlock)(id responseObject, ANKAPIResponseMeta * @class ANKPaginationSettings, ANKGeneralParameters, ANKUser, ANKAPIResponseMeta; -@interface ANKClient : AFHTTPClient +@interface ANKClient : NSObject + (NSURL *)APIBaseURL; // defaults to @"https://alpha-api.app.net/stream/0/" -- subclass and override to change it + (instancetype)sharedClient; +@property (readonly, strong) AFHTTPRequestOperationManager *requestManager; @property (readonly, strong) ANKUser *authenticatedUser; // the authenticated user object @property (strong) NSString *accessToken; // access token acquired by auth or persisted across launches and set directly @property (strong) ANKPaginationSettings *pagination; @property (strong) ANKGeneralParameters *generalParameters; @property (assign) ANKResponseDecodingType responseDecodingType; +@property (readonly) NSDictionary *defaultQueryParameters; @property (assign) BOOL shouldUseSharedUserDefaultsController; // default NO - uses [NSUserDefaults standardUserDefaults] when NO, [[NSUserDefaultsController sharedUserDefaultsController] defaults] when YES. @property (assign) BOOL shouldSynchronizeOnUserDefaultsWrite; // default NO - if set to YES, will call synchronize on each write to make sure that user defaults are written to disk immediately @@ -138,7 +140,7 @@ typedef void (^ANKClientCompletionBlock)(id responseObject, ANKAPIResponseMeta * #pragma mark - #pragma mark - Streams -- (void)requestStreamingUpdatesForOperation:(ANKJSONRequestOperation *)operation withDelegate:(id)delegate; +- (void)requestStreamingUpdatesForOperation:(AFHTTPRequestOperation *)operation withDelegate:(id)delegate; #pragma mark - #pragma mark Operation Queues diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index aed6c38..66483ed 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -11,7 +11,7 @@ */ #import "ANKClient.h" -#import "ANKJSONRequestOperation.h" +#import "AFHTTPRequestOperation.h" #import "ANKPaginationSettings.h" #import "ANKGeneralParameters.h" #import "ANKAPIResponseMeta.h" @@ -25,6 +25,8 @@ #import "ANKChannel.h" #import "ANKClient+ANKTokenStatus.h" #import "ANKStreamContext.h" +#import "ANKAPIRequestSerializer.h" +#import "ANKAPIResponseSerializer.h" #import @@ -33,8 +35,8 @@ @interface ANKClient () -@property (strong) AFHTTPClient *authHTTPClient; @property (strong) NSString *webAuthRedirectURI; +@property (readwrite, strong) AFHTTPRequestOperationManager *requestManager; @property (readwrite, strong) ANKUser *authenticatedUser; @property (nonatomic, strong) KATSocketShuttle *socketShuttle; @@ -42,7 +44,6 @@ @interface ANKClient () @property (nonatomic, copy) NSString *lastSuccessfulStreamingConnectionID; @property (nonatomic, strong) NSMutableSet *streamContexts; -- (void)initializeHTTPAuthClient; - (void)HTTPAuthDidCompleteSuccessfully:(BOOL)wasSuccessful error:(NSError *)error handler:(void (^)(BOOL successful, NSError *error))handler; - (void)authenticateWithParameters:(NSDictionary *)params handler:(void (^)(BOOL successful, NSError *error))handler; @@ -68,16 +69,18 @@ + (NSURL *)APIBaseURL { - (id)init { - if ((self = [super initWithBaseURL:[[self class] APIBaseURL]])) { - self.parameterEncoding = AFJSONParameterEncoding; + if ((self = [super init])) { + self.requestManager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[[self class] APIBaseURL]]; + self.requestManager.requestSerializer = [ANKAPIRequestSerializer serializer]; + self.requestManager.responseSerializer = [ANKAPIResponseSerializer serializer]; + self.pagination = [[ANKPaginationSettings alloc] init]; self.generalParameters = [[ANKGeneralParameters alloc] init]; self.generalParameters.includeHTML = NO; - [self setDefaultHeader:@"Accept" value:@"application/json"]; - [self registerHTTPOperationClass:[ANKJSONRequestOperation class]]; - [self addObserver:self forKeyPath:@"accessToken" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"generalParameters" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"pagination" options:NSKeyValueObservingOptionNew context:nil]; self.streamContexts = [[NSMutableSet alloc] init]; self.streamingAvailbility = ANKStreamingAvailabilityWiFi; @@ -89,6 +92,8 @@ - (id)init { - (void)dealloc { [self removeObserver:self forKeyPath:@"accessToken"]; + [self removeObserver:self forKeyPath:@"generalParameters"]; + [self removeObserver:self forKeyPath:@"pagination"]; } @@ -109,39 +114,27 @@ - (id)copyWithZone:(NSZone *)zone { - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqualToString:@"accessToken"]) { - [self setDefaultHeader:@"Authorization" value:self.accessToken ? [@"Bearer " stringByAppendingString:self.accessToken] : nil]; - } -} - - -- (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters { - NSMutableURLRequest *request = [super requestWithMethod:method path:path parameters:parameters]; + [self.requestManager.requestSerializer clearAuthorizationHeader]; - NSMutableDictionary *commonParameters = [NSMutableDictionary dictionary]; - - if (self.generalParameters) { - [commonParameters addEntriesFromDictionary:[self.generalParameters JSONDictionary]]; - } - - if (self.pagination) { - [commonParameters addEntriesFromDictionary:[self.pagination JSONDictionary]]; - } + if ([self.accessToken length] > 0) { + [self.requestManager.requestSerializer setValue:[@"Bearer " stringByAppendingString:self.accessToken] forHTTPHeaderField:@"Authorization"]; + } + } else if ([keyPath isEqualToString:@"generalParameters"] || [keyPath isEqualToString:@"pagination"]) { + ANKAPIRequestSerializer *requestSerializer = (ANKAPIRequestSerializer *)self.requestManager.requestSerializer; - if (commonParameters.count) { - NSString *encodedParameters = AFQueryStringFromParametersWithEncoding(commonParameters, self.stringEncoding); - NSString *URLString = [request.URL absoluteString]; - request.URL = [NSURL URLWithString:[URLString stringByAppendingFormat:[URLString rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", encodedParameters]]; + requestSerializer.defaultParameters = [self defaultQueryParameters]; } - - return request; } -- (void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation { - [super enqueueHTTPRequestOperation:operation]; +- (NSDictionary *)defaultQueryParameters +{ + NSMutableDictionary *defaultQueryParameters = [NSMutableDictionary new]; - [self.operationQueue setSuspended:NO]; -} + [defaultQueryParameters addEntriesFromDictionary:[self.generalParameters JSONDictionary]]; + [defaultQueryParameters addEntriesFromDictionary:[self.pagination JSONDictionary]]; + return [defaultQueryParameters copy]; +} #pragma mark - #pragma mark Authentication @@ -344,17 +337,10 @@ - (void)setSuccessCallbackQueue:(dispatch_queue_t)successCallbackQueue failureCa #pragma mark - #pragma mark Internal API -- (void)initializeHTTPAuthClient { - self.authHTTPClient = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"https://account.app.net/oauth"]]; - self.authHTTPClient.parameterEncoding = AFFormURLParameterEncoding; - [self.authHTTPClient registerHTTPOperationClass:[AFJSONRequestOperation class]]; -} - - - (void)authenticateWithParameters:(NSDictionary *)params handler:(void (^)(BOOL successful, NSError *error))handler { - [self initializeHTTPAuthClient]; - [self.authHTTPClient postPath:@"access_token" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { - NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil]; + AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; + + [manager POST:@"https://account.app.net/oauth/access_token" parameters:params success:^(AFHTTPRequestOperation *operation, NSDictionary * responseDictionary) { if (responseDictionary[@"access_token"]) { if (responseDictionary[@"token"]) { ANKTokenStatus *token = [ANKResolve(ANKTokenStatus) objectFromJSONDictionary:responseDictionary[@"token"]]; @@ -366,9 +352,9 @@ - (void)authenticateWithParameters:(NSDictionary *)params handler:(void (^)(BOOL NSError *error = [NSError errorWithDomain:kANKErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey: @"Could not find key access_token in response", NSLocalizedFailureReasonErrorKey: responseDictionary}]; [self HTTPAuthDidCompleteSuccessfully:NO error:error handler:handler]; } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { [self HTTPAuthDidCompleteSuccessfully:NO error:error handler:handler]; - }]; + }]; } @@ -384,7 +370,6 @@ - (void)HTTPAuthDidCompleteSuccessfully:(BOOL)wasSuccessful error:(NSError *)err handler(wasSuccessful, error); } - self.authHTTPClient = nil; self.webAuthCompletionHandler = nil; self.webAuthRedirectURI = nil; } @@ -399,13 +384,14 @@ - (NSURLRequest *)streamingRequest { } NSMutableURLRequest *streamingRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[(NSString *)kANKUserStreamEndpointURL stringByAppendingFormat:@"?connection_id=%@", self.streamingConnectionID]]]; - [streamingRequest setValue:[self defaultValueForHeader:@"Authorization"] forHTTPHeaderField:@"Authorization"]; + + [streamingRequest setValue:self.requestManager.requestSerializer.HTTPRequestHeaders[@"Authorization"] forHTTPHeaderField:@"Authorization"]; return streamingRequest; } -- (void)requestStreamingUpdatesForOperation:(ANKJSONRequestOperation *)operation withDelegate:(id)delegate { +- (void)requestStreamingUpdatesForOperation:(AFHTTPRequestOperation *)operation withDelegate:(id)delegate { NSString *subscriptionID = nil; if (!self.streamingConnectionID) { @@ -430,7 +416,7 @@ - (void)requestStreamingUpdatesForOperation:(ANKJSONRequestOperation *)operation } -- (void)reconfigureOperationForStreaming:(ANKJSONRequestOperation *)operation subscriptionID:(NSString **)subscriptionID { +- (void)reconfigureOperationForStreaming:(AFHTTPRequestOperation *)operation subscriptionID:(NSString **)subscriptionID { NSString *uniqueString = [[NSProcessInfo processInfo] globallyUniqueString]; *subscriptionID = uniqueString; diff --git a/ADNKit/ANKJSONRequestOperation.h b/ADNKit/ANKJSONRequestOperation.h deleted file mode 100644 index 7257799..0000000 --- a/ADNKit/ANKJSONRequestOperation.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 2013, Joel Levin - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of ADNKit nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@interface ANKJSONRequestOperation : AFJSONRequestOperation - -@end diff --git a/ADNKit/ANKJSONRequestOperation.m b/ADNKit/ANKJSONRequestOperation.m deleted file mode 100644 index 69759e6..0000000 --- a/ADNKit/ANKJSONRequestOperation.m +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (c) 2013, Joel Levin - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of ADNKit nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import "ANKJSONRequestOperation.h" -#import "ANKAPIResponse.h" -#import "ANKAPIResponseMeta.h" - - -@implementation ANKJSONRequestOperation - -- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *, id))success failure:(void (^)(AFHTTPRequestOperation *, NSError *))failure { - [super setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { - ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:responseObject]; - - if (success) { - success(operation, response); - } - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { - ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:((AFJSONRequestOperation *)operation).responseJSON]; - - NSMutableDictionary *modifiedUserInfo = [error.userInfo mutableCopy]; - modifiedUserInfo[kANKAPIResponseKey] = response; - NSError *modifiedError = [NSError errorWithDomain:error.domain code:error.code userInfo:modifiedUserInfo]; - - if (failure) { - failure(operation, modifiedError); - } - }]; -} - - -@end diff --git a/ADNKit/ANKStreamContext.h b/ADNKit/ANKStreamContext.h index 86d6d49..fcfe0ab 100644 --- a/ADNKit/ANKStreamContext.h +++ b/ADNKit/ANKStreamContext.h @@ -12,13 +12,13 @@ #pragma mark - Designated Initializer -+ (instancetype)streamContextWithOperation:(ANKJSONRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate; -- (instancetype)initWithOperation:(ANKJSONRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate; ++ (instancetype)streamContextWithOperation:(AFHTTPRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate; +- (instancetype)initWithOperation:(AFHTTPRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate; #pragma mark - Internal @property (nonatomic, weak, readonly) id delegate; -@property (nonatomic, strong, readonly) ANKJSONRequestOperation *operation; +@property (nonatomic, strong, readonly) AFHTTPRequestOperation *operation; #pragma mark - API Level diff --git a/ADNKit/ANKStreamContext.m b/ADNKit/ANKStreamContext.m index f60b2a1..94591ff 100644 --- a/ADNKit/ANKStreamContext.m +++ b/ADNKit/ANKStreamContext.m @@ -11,7 +11,7 @@ @interface ANKStreamContext () @property (nonatomic, weak) id delegate; -@property (nonatomic, strong) ANKJSONRequestOperation *operation; +@property (nonatomic, strong) AFHTTPRequestOperation *operation; @end @@ -20,11 +20,11 @@ @implementation ANKStreamContext #pragma mark - #pragma mark Designated Initializer -+ (instancetype)streamContextWithOperation:(ANKJSONRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate { ++ (instancetype)streamContextWithOperation:(AFHTTPRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate { return [[[self class] alloc] initWithOperation:operation identifier:identifier delegate:delegate]; } -- (instancetype)initWithOperation:(ANKJSONRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate { +- (instancetype)initWithOperation:(AFHTTPRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate { if ((self = [super init])) { self.operation = operation; self.identifier = identifier; diff --git a/ADNKitTests/ADNKitTests.h b/ADNKitTests/ADNKitTests.h index 196dab1..e2c7790 100644 --- a/ADNKitTests/ADNKitTests.h +++ b/ADNKitTests/ADNKitTests.h @@ -6,9 +6,9 @@ // Copyright (c) 2013 Afterwork Studios. All rights reserved. // -#import +#import -@interface ADNKitTests : SenTestCase +@interface ADNKitTests : XCTestCase @end diff --git a/ADNKitTests/ADNKitTests.m b/ADNKitTests/ADNKitTests.m index 51078e3..ded67ef 100644 --- a/ADNKitTests/ADNKitTests.m +++ b/ADNKitTests/ADNKitTests.m @@ -30,18 +30,18 @@ - (void)testCopying { ANKUser *userCopy = [user copy]; ANKPost *postCopy = [post copy]; - STAssertEqualObjects(user.userID, userCopy.userID, @"Copy failed"); - STAssertEqualObjects(user.username, userCopy.username, @"Copy failed"); - STAssertEqualObjects(user.name, userCopy.name, @"Copy failed"); + XCTAssertEqualObjects(user.userID, userCopy.userID, @"Copy failed"); + XCTAssertEqualObjects(user.username, userCopy.username, @"Copy failed"); + XCTAssertEqualObjects(user.name, userCopy.name, @"Copy failed"); - STAssertEqualObjects(post.text, postCopy.text, @"Copy failed"); - STAssertEqualObjects(post.repliedToPostID, postCopy.repliedToPostID, @"Copy failed"); - STAssertEqualObjects(post.user, postCopy.user, @"Copy failed"); + XCTAssertEqualObjects(post.text, postCopy.text, @"Copy failed"); + XCTAssertEqualObjects(post.repliedToPostID, postCopy.repliedToPostID, @"Copy failed"); + XCTAssertEqualObjects(post.user, postCopy.user, @"Copy failed"); - STAssertEquals(post.repliesCount, postCopy.repliesCount, @"Copy failed"); - STAssertEquals(post.isStarredByCurrentUser, postCopy.isStarredByCurrentUser, @"Copy failed"); + XCTAssertEqual(post.repliesCount, postCopy.repliesCount, @"Copy failed"); + XCTAssertEqual(post.isStarredByCurrentUser, postCopy.isStarredByCurrentUser, @"Copy failed"); - STAssertEqualObjects(post.annotations[0], postCopy.annotations[0], @"Copy failed"); + XCTAssertEqualObjects(post.annotations[0], postCopy.annotations[0], @"Copy failed"); } @@ -62,23 +62,23 @@ - (void)testCoding { NSData *postData = [NSKeyedArchiver archivedDataWithRootObject:post]; ANKPost *unarchivedData = [NSKeyedUnarchiver unarchiveObjectWithData:postData]; - STAssertEqualObjects(post.text, unarchivedData.text, @"Archiving failed"); - STAssertEqualObjects(post.repliedToPostID, unarchivedData.repliedToPostID, @"Archiving failed"); - STAssertEqualObjects(post.user.userID, unarchivedData.user.userID, @"Archiving failed"); + XCTAssertEqualObjects(post.text, unarchivedData.text, @"Archiving failed"); + XCTAssertEqualObjects(post.repliedToPostID, unarchivedData.repliedToPostID, @"Archiving failed"); + XCTAssertEqualObjects(post.user.userID, unarchivedData.user.userID, @"Archiving failed"); - STAssertEquals(post.repliesCount, unarchivedData.repliesCount, @"Archiving failed"); - STAssertEquals(post.isStarredByCurrentUser, unarchivedData.isStarredByCurrentUser, @"Archiving failed"); + XCTAssertEqual(post.repliesCount, unarchivedData.repliesCount, @"Archiving failed"); + XCTAssertEqual(post.isStarredByCurrentUser, unarchivedData.isStarredByCurrentUser, @"Archiving failed"); - STAssertEqualObjects([(ANKAnnotation *)post.annotations[0] type], [(ANKAnnotation *)unarchivedData.annotations[0] type], @"Archiving failed"); + XCTAssertEqualObjects([(ANKAnnotation *)post.annotations[0] type], [(ANKAnnotation *)unarchivedData.annotations[0] type], @"Archiving failed"); } - (void)testResourceReplacement { [ANKResourceMap setCustomResourceClass:[CustomPost class] forResourceClass:[ANKPost class]]; - STAssertEquals(ANKResolve([ANKPost class]), [CustomPost class], @"Setting custom resource class failed"); + XCTAssertEqual(ANKResolve([ANKPost class]), [CustomPost class], @"Setting custom resource class failed"); [ANKResourceMap setCustomResourceClass:nil forResourceClass:[ANKPost class]]; - STAssertEquals(ANKResolve([ANKPost class]), [ANKPost class], @"Removing custom resource class failed"); + XCTAssertEqual(ANKResolve([ANKPost class]), [ANKPost class], @"Removing custom resource class failed"); } diff --git a/External/AFNetworking b/External/AFNetworking deleted file mode 160000 index 5c74140..0000000 --- a/External/AFNetworking +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5c7414032e1e622e81c2b9a14fed7525487f9c9d diff --git a/External/SocketShuttle b/External/SocketShuttle deleted file mode 160000 index 2e2f37a..0000000 --- a/External/SocketShuttle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2e2f37af20c6662f23a3140c0b933d0acd26c388 From 2658e6ee69062f5a3746a1aca7a814f0dbb8220a Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 20:42:17 +1000 Subject: [PATCH 04/20] Latest AFNetworking and SocketShuttle --- .gitmodules | 6 ++++++ External/AFNetworking | 1 + External/SocketShuttle | 1 + 3 files changed, 8 insertions(+) create mode 160000 External/AFNetworking create mode 160000 External/SocketShuttle diff --git a/.gitmodules b/.gitmodules index e69de29..907cf24 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "External/AFNetworking"] + path = External/AFNetworking + url = https://github.com/AFNetworking/AFNetworking.git +[submodule "External/SocketShuttle"] + path = External/SocketShuttle + url = https://github.com/tonyarnold/SocketShuttle.git diff --git a/External/AFNetworking b/External/AFNetworking new file mode 160000 index 0000000..31746cc --- /dev/null +++ b/External/AFNetworking @@ -0,0 +1 @@ +Subproject commit 31746cc6d10fded6c6babf9ffd9799cddac0bbed diff --git a/External/SocketShuttle b/External/SocketShuttle new file mode 160000 index 0000000..b4f6a97 --- /dev/null +++ b/External/SocketShuttle @@ -0,0 +1 @@ +Subproject commit b4f6a97ed636b8702860408af61ccc41417628e5 From b773a0728c290a647043f4e7d3c0b7c1400c7cae Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 20:46:12 +1000 Subject: [PATCH 05/20] Bump to version 1.9.99 --- ADNKit-OSX/ADNKit-OSX-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNKit-OSX/ADNKit-OSX-Info.plist b/ADNKit-OSX/ADNKit-OSX-Info.plist index 7478afe..83e696c 100644 --- a/ADNKit-OSX/ADNKit-OSX-Info.plist +++ b/ADNKit-OSX/ADNKit-OSX-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2 + 1.9.99 CFBundleSignature ???? CFBundleVersion From f46a3794840bd3511d046d6768cec2b11a6d04d3 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 21:15:14 +1000 Subject: [PATCH 06/20] Set default parameters on client initialization --- ADNKit/ANKAPIRequestSerializer.m | 12 +++++++++++- ADNKit/ANKClient.m | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ADNKit/ANKAPIRequestSerializer.m b/ADNKit/ANKAPIRequestSerializer.m index 7d0944f..ed38e13 100644 --- a/ADNKit/ANKAPIRequestSerializer.m +++ b/ADNKit/ANKAPIRequestSerializer.m @@ -12,9 +12,19 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method parameters:(id)parameters error:(NSError * __autoreleasing *)error { + NSMutableDictionary *modifiedParameters = [NSMutableDictionary new]; + + if ([parameters isKindOfClass:[NSDictionary class]]) { + [modifiedParameters addEntriesFromDictionary:parameters]; + } + + if ([self.defaultParameters count] > 0) { + [modifiedParameters addEntriesFromDictionary:self.defaultParameters]; + } + return [super requestWithMethod:method URLString:URLString - parameters:[parameters ?: @{} ank_dictionaryByAppendingDictionary:self.defaultParameters] + parameters:modifiedParameters error:error]; } diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index 66483ed..1ef2169 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -84,6 +84,10 @@ - (id)init { self.streamContexts = [[NSMutableSet alloc] init]; self.streamingAvailbility = ANKStreamingAvailabilityWiFi; + + ANKAPIRequestSerializer *requestSerializer = (ANKAPIRequestSerializer *)self.requestManager.requestSerializer; + + requestSerializer.defaultParameters = self.defaultQueryParameters; } return self; From 82c2bc472eb462fc157ae5748835e3eb68e3d742 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 7 Apr 2014 21:49:08 +1000 Subject: [PATCH 07/20] =?UTF-8?q?Whoops,=20forgot=20to=20pass=20along=20th?= =?UTF-8?q?e=20parameters=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ADNKit/ANKClient+ANKRequestsAPI.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNKit/ANKClient+ANKRequestsAPI.m b/ADNKit/ANKClient+ANKRequestsAPI.m index db7bfbc..fd201b3 100644 --- a/ADNKit/ANKClient+ANKRequestsAPI.m +++ b/ADNKit/ANKClient+ANKRequestsAPI.m @@ -23,7 +23,7 @@ - (AFHTTPRequestOperation *)enqueueRequestWithMethod:(NSString *)method path:(NS NSURL *URL = [manager.baseURL URLByAppendingPathComponent:path]; NSError *requestError; - NSURLRequest *request = [serializer requestWithMethod:method URLString:[URL absoluteString] parameters:nil error:&requestError]; + NSURLRequest *request = [serializer requestWithMethod:method URLString:[URL absoluteString] parameters:parameters error:&requestError]; if (requestError && failureBlock) { failureBlock(nil, requestError); From 2199b4fa576deb8ae046fb869734ecaeee43c868 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Sun, 13 Apr 2014 23:32:02 +1000 Subject: [PATCH 08/20] Add auto_subscribe parameter to channel object --- ADNKit/ANKChannel.h | 1 + ADNKit/ANKChannel.m | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ADNKit/ANKChannel.h b/ADNKit/ANKChannel.h index eb048a4..a9781c8 100644 --- a/ADNKit/ANKChannel.h +++ b/ADNKit/ANKChannel.h @@ -31,6 +31,7 @@ @property (assign) BOOL isInactive; @property (assign) BOOL hasUnreadMessages; @property (assign) BOOL youMuted; +@property (assign) BOOL autoSubscribe; - (BOOL)isPrivateMessageChannel; diff --git a/ADNKit/ANKChannel.m b/ADNKit/ANKChannel.m index 71571c3..bb72078 100644 --- a/ADNKit/ANKChannel.m +++ b/ADNKit/ANKChannel.m @@ -25,7 +25,8 @@ + (NSDictionary *)JSONToLocalKeyMapping { @"recent_message_id": @"latestMessageID", @"recent_message": @"latestMessage", @"is_inactive" : @"isInactive", - @"you_muted" : @"youMuted"}]; + @"you_muted" : @"youMuted", + @"auto_subscribe" : @"autoSubscribe"}]; } From 384c666fe89dc5e3d8207426e9399572c6663656 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Sun, 13 Apr 2014 23:32:13 +1000 Subject: [PATCH 09/20] Add support for deactivating a channel --- ADNKit/ANKClient+ANKChannel.h | 3 +++ ADNKit/ANKClient+ANKChannel.m | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ADNKit/ANKClient+ANKChannel.h b/ADNKit/ANKClient+ANKChannel.h index 93f2030..f26bf93 100644 --- a/ADNKit/ANKClient+ANKChannel.h +++ b/ADNKit/ANKClient+ANKChannel.h @@ -50,4 +50,7 @@ - (AFHTTPRequestOperation *)unmuteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; - (AFHTTPRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deactivateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler; +- (AFHTTPRequestOperation *)deactivateChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler; + @end diff --git a/ADNKit/ANKClient+ANKChannel.m b/ADNKit/ANKClient+ANKChannel.m index 70fe52e..b9fd1d8 100644 --- a/ADNKit/ANKClient+ANKChannel.m +++ b/ADNKit/ANKClient+ANKChannel.m @@ -247,5 +247,17 @@ - (AFHTTPRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion failure:[self failureHandlerForClientHandler:completionHandler]]; } +- (AFHTTPRequestOperation *)deactivateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler +{ + return [self deactivateChannelWithID:channel.channelID completion:completionHandler]; +} + +- (AFHTTPRequestOperation *)deactivateChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler +{ + return [self enqueueDELETEPath:[NSString stringWithFormat:@"channels/%@", channelID] + parameters:nil + success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler] + failure:[self failureHandlerForClientHandler:completionHandler]]; +} @end From dc0fa828b92b6cd3d28bf1bb58b2413ac459a5ab Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 14 Apr 2014 11:24:06 +1000 Subject: [PATCH 10/20] Lock submodule to AFNetworking 2.2.1 --- External/AFNetworking | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/External/AFNetworking b/External/AFNetworking index 31746cc..d103c94 160000 --- a/External/AFNetworking +++ b/External/AFNetworking @@ -1 +1 @@ -Subproject commit 31746cc6d10fded6c6babf9ffd9799cddac0bbed +Subproject commit d103c9401fba9e5ebe4f930fedc826dc0100d0a0 From e1f5a2a996f0f4167d846bb904085eb8472fb315 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 14 Apr 2014 11:26:39 +1000 Subject: [PATCH 11/20] Add method to pass parameters to the initial streaming request This allows the user to specify if they want to include annotations and other things from the streamed messages --- ADNKit/ANKClient.h | 2 +- ADNKit/ANKClient.m | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ADNKit/ANKClient.h b/ADNKit/ANKClient.h index e975b67..eaacd16 100644 --- a/ADNKit/ANKClient.h +++ b/ADNKit/ANKClient.h @@ -140,7 +140,7 @@ typedef void (^ANKClientCompletionBlock)(id responseObject, ANKAPIResponseMeta * #pragma mark - #pragma mark - Streams -- (void)requestStreamingUpdatesForOperation:(AFHTTPRequestOperation *)operation withDelegate:(id)delegate; +- (void)requestStreamingUpdatesForOperation:(AFHTTPRequestOperation *)operation parameters:(ANKGeneralParameters *)parameters withDelegate:(id)delegate; #pragma mark - #pragma mark Operation Queues diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index 1ef2169..b592de3 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -382,12 +382,20 @@ - (void)HTTPAuthDidCompleteSuccessfully:(BOOL)wasSuccessful error:(NSError *)err #pragma mark - #pragma mark Streams -- (NSURLRequest *)streamingRequest { +- (NSURLRequest *)streamingRequestWithParameters:(ANKGeneralParameters *)parameters { if (!self.streamingConnectionID) { self.streamingConnectionID = [[NSProcessInfo processInfo] globallyUniqueString]; } - NSMutableURLRequest *streamingRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[(NSString *)kANKUserStreamEndpointURL stringByAppendingFormat:@"?connection_id=%@", self.streamingConnectionID]]]; + NSMutableString *endpointURLString = [[(NSString *)kANKUserStreamEndpointURL stringByAppendingFormat:@"?connection_id=%@&include_annotations=1", self.streamingConnectionID] mutableCopy]; + + NSDictionary *parameterDict = [parameters JSONDictionary]; + + [parameterDict enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) { + [endpointURLString appendFormat:@"&%@=%@", key, value]; + }]; + + NSMutableURLRequest *streamingRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:endpointURLString]]; [streamingRequest setValue:self.requestManager.requestSerializer.HTTPRequestHeaders[@"Authorization"] forHTTPHeaderField:@"Authorization"]; @@ -395,13 +403,13 @@ - (NSURLRequest *)streamingRequest { } -- (void)requestStreamingUpdatesForOperation:(AFHTTPRequestOperation *)operation withDelegate:(id)delegate { +- (void)requestStreamingUpdatesForOperation:(AFHTTPRequestOperation *)operation parameters:(ANKGeneralParameters *)parameters withDelegate:(id)delegate { NSString *subscriptionID = nil; if (!self.streamingConnectionID) { [operation pause]; - self.socketShuttle = [[KATSocketShuttle alloc] initWithRequest:[self streamingRequest] delegate:self connectConditions:self.streamingAvailbility == ANKStreamingAvailabilityWiFi ? KATSocketConnectConditionWLAN : KATSocketConnectConditionAlways]; + self.socketShuttle = [[KATSocketShuttle alloc] initWithRequest:[self streamingRequestWithParameters:parameters] delegate:self connectConditions:self.streamingAvailbility == ANKStreamingAvailabilityWiFi ? KATSocketConnectConditionWLAN : KATSocketConnectConditionAlways]; } if (self.socketShuttle.socketState == KATSocketStateConnected) { @@ -493,7 +501,7 @@ - (void)iterateOverStreamingDelegatesImplementingDelegateMethod:(SEL)delegateMet - (void)socketShuttleDisconnectCommon { - self.socketShuttle = [[KATSocketShuttle alloc] initWithRequest:[self streamingRequest] delegate:self connectConditions:self.streamingAvailbility == ANKStreamingAvailabilityWiFi ? KATSocketConnectConditionWLAN : KATSocketConnectConditionAlways]; + self.socketShuttle = [[KATSocketShuttle alloc] initWithRequest:[self streamingRequestWithParameters:nil] delegate:self connectConditions:self.streamingAvailbility == ANKStreamingAvailabilityWiFi ? KATSocketConnectConditionWLAN : KATSocketConnectConditionAlways]; } From f4487d21eeb13c2abbc8a5dbeb6c070de836dcb6 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 14 Apr 2014 11:26:53 +1000 Subject: [PATCH 12/20] Add support for the various annotation types to the general parameters object --- ADNKit/ANKGeneralParameters.h | 4 +++- ADNKit/ANKGeneralParameters.m | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ADNKit/ANKGeneralParameters.h b/ADNKit/ANKGeneralParameters.h index 60b1105..dc8468f 100644 --- a/ADNKit/ANKGeneralParameters.h +++ b/ADNKit/ANKGeneralParameters.h @@ -23,9 +23,11 @@ @property (assign) BOOL includeStarredBy; @property (assign) BOOL includeReposters; @property (assign) BOOL includeAnnotations; +@property (assign) BOOL includeChannelAnnotations; +@property (assign) BOOL includeFileAnnotations; +@property (assign) BOOL includeMessageAnnotations; @property (assign) BOOL includePostAnnotations; @property (assign) BOOL includeUserAnnotations; -@property (assign) BOOL includeMessageAnnotations; @property (assign) BOOL includeHTML; @property (assign) BOOL includeMarker; @property (assign) BOOL includeRead; diff --git a/ADNKit/ANKGeneralParameters.m b/ADNKit/ANKGeneralParameters.m index 531d116..5fda2e8 100644 --- a/ADNKit/ANKGeneralParameters.m +++ b/ADNKit/ANKGeneralParameters.m @@ -25,9 +25,11 @@ + (NSDictionary *)JSONToLocalKeyMapping { @"include_starred_by": @"includeStarredBy", @"include_reposters": @"includeReposters", @"include_annotations": @"includeAnnotations", + @"include_channel_annotations": @"includeChannelAnnotations", + @"include_file_annotations": @"includeFileAnnotations", + @"include_message_annotations": @"includeMessageAnnotations", @"include_post_annotations": @"includePostAnnotations", @"include_user_annotations": @"includeUserAnnotations", - @"include_message_annotations": @"includeMessageAnnotations", @"include_html": @"includeHTML", @"include_marker": @"includeMarker", @"include_read": @"includeRead", From 85086ef850a3df5b12b96c64c97762bd440e3b4a Mon Sep 17 00:00:00 2001 From: Rob Brambley Date: Sun, 13 Apr 2014 09:53:14 -0700 Subject: [PATCH 13/20] Fix busted fetchMessagesWithIDs method --- ADNKit/ANKClient+ANKMessage.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNKit/ANKClient+ANKMessage.m b/ADNKit/ANKClient+ANKMessage.m index 82d61bf..dbc80a8 100644 --- a/ADNKit/ANKClient+ANKMessage.m +++ b/ADNKit/ANKClient+ANKMessage.m @@ -51,7 +51,7 @@ - (AFHTTPRequestOperation *)fetchMessageWithID:(NSString *)messageID inChannelWi - (AFHTTPRequestOperation *)fetchMessagesWithIDs:(NSArray *)messageIDs completion:(ANKClientCompletionBlock)completionHandler { return [self enqueueGETPath:@"channels/messages" - parameters:nil + parameters:@{@"ids": [messageIDs componentsJoinedByString:@","]} success:[self successHandlerForCollectionOfResourceClass:[ANKMessage class] clientHandler:completionHandler] failure:[self failureHandlerForClientHandler:completionHandler]]; } From e84c95633389ac213596e1aba547938282c7c60b Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 14 Apr 2014 11:31:09 +1000 Subject: [PATCH 14/20] Ensure that the default parameters are always present in the request URL --- ADNKit/ANKAPIRequestSerializer.m | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ADNKit/ANKAPIRequestSerializer.m b/ADNKit/ANKAPIRequestSerializer.m index ed38e13..caa0cfd 100644 --- a/ADNKit/ANKAPIRequestSerializer.m +++ b/ADNKit/ANKAPIRequestSerializer.m @@ -10,21 +10,22 @@ @implementation ANKAPIRequestSerializer - (NSMutableURLRequest *)requestWithMethod:(NSString *)method URLString:(NSString *)URLString parameters:(id)parameters - error:(NSError * __autoreleasing *)error + error:(NSError *__autoreleasing *)error { - NSMutableDictionary *modifiedParameters = [NSMutableDictionary new]; - - if ([parameters isKindOfClass:[NSDictionary class]]) { - [modifiedParameters addEntriesFromDictionary:parameters]; + if ((self.defaultParameters.count > 0) && [parameters isKindOfClass:[NSDictionary class]]) { + parameters = [(NSDictionary *)parameters ank_dictionaryByAppendingDictionary : self.defaultParameters]; } - if ([self.defaultParameters count] > 0) { - [modifiedParameters addEntriesFromDictionary:self.defaultParameters]; - } + NSMutableString *modifiedURLString = [URLString mutableCopy]; + + [self.defaultParameters enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *obj, BOOL *stop) { + NSString *delimiter = (NSNotFound == [modifiedURLString rangeOfString:@"?"].location) ? @"?" : @"&"; + [modifiedURLString appendFormat:@"%@%@=%@", delimiter, key, obj]; + }]; return [super requestWithMethod:method - URLString:URLString - parameters:modifiedParameters + URLString:modifiedURLString + parameters:parameters error:error]; } From cc6b4ecddb8d868ea095c53332435cd2bd0b34b3 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 14 Apr 2014 12:05:35 +1000 Subject: [PATCH 15/20] Respect the include_annotation request sent through from the parameters --- ADNKit/ANKClient.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index b592de3..2ace37f 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -387,7 +387,7 @@ - (NSURLRequest *)streamingRequestWithParameters:(ANKGeneralParameters *)paramet self.streamingConnectionID = [[NSProcessInfo processInfo] globallyUniqueString]; } - NSMutableString *endpointURLString = [[(NSString *)kANKUserStreamEndpointURL stringByAppendingFormat:@"?connection_id=%@&include_annotations=1", self.streamingConnectionID] mutableCopy]; + NSMutableString *endpointURLString = [[(NSString *)kANKUserStreamEndpointURL stringByAppendingFormat:@"?connection_id=%@", self.streamingConnectionID] mutableCopy]; NSDictionary *parameterDict = [parameters JSONDictionary]; From f0d26a5556f23cfa0a911017d0aef23e488d4586 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 14 Apr 2014 13:40:47 +1000 Subject: [PATCH 16/20] Add rate limiting information, and serialise responses properly (including errors) --- ADNKit/ANKAPIResponse.h | 6 +++--- ADNKit/ANKAPIResponse.m | 17 +++++++++++++---- ADNKit/ANKAPIResponseMeta.h | 6 ++++++ ADNKit/ANKAPIResponseSerializer.m | 20 ++++++++++++++++++-- ADNKit/ANKClient.m | 5 +++-- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/ADNKit/ANKAPIResponse.h b/ADNKit/ANKAPIResponse.h index 874d1df..828e2ea 100644 --- a/ADNKit/ANKAPIResponse.h +++ b/ADNKit/ANKAPIResponse.h @@ -1,9 +1,9 @@ /* Copyright (c) 2013, Joel Levin All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of ADNKit nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -23,6 +23,6 @@ static NSString *const kANKAPIResponseKey = @"ANKAPIResponse"; @property (readonly, strong) id data; @property (readonly, strong) ANKAPIResponseMeta *meta; -- (id)initWithResponseObject:(id)responseObject; +- (id)initWithResponseObject:(id)responseObject andHeaders:(NSDictionary*)headers; @end diff --git a/ADNKit/ANKAPIResponse.m b/ADNKit/ANKAPIResponse.m index d4ee683..dcf8ac1 100644 --- a/ADNKit/ANKAPIResponse.m +++ b/ADNKit/ANKAPIResponse.m @@ -1,9 +1,9 @@ /* Copyright (c) 2013, Joel Levin All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of ADNKit nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -11,6 +11,7 @@ */ #import "ANKAPIResponse.h" +#import "ANKResourceMap.h" #import "ANKAPIResponseMeta.h" @@ -24,12 +25,20 @@ @interface ANKAPIResponse () @implementation ANKAPIResponse -- (id)initWithResponseObject:(id)responseObject { +- (id)initWithResponseObject:(id)responseObject andHeaders:(NSDictionary*)headers{ if ((self = [super init])) { if ([responseObject isKindOfClass:[NSDictionary class]]) { NSDictionary *responseDictionary = (NSDictionary *)responseObject; self.data = responseDictionary[@"data"]; - self.meta = [ANKAPIResponseMeta objectFromJSONDictionary:responseDictionary[@"meta"]]; + self.meta = [ANKResolve(ANKAPIResponseMeta) objectFromJSONDictionary:responseDictionary[@"meta"]]; + + if (headers) + { + self.meta.rateLimitReset = [headers objectForKey:@"X-RateLimit-Reset"]; + self.meta.rateLimitRemaining = [headers objectForKey:@"X-RateLimit-Remaining"]; + self.meta.rateLimitLimit = [headers objectForKey:@"X-RateLimit-Limit"]; + self.meta.rateLimitRetryAfter = [headers objectForKey:@"Retry-After"]; + } } } return self; diff --git a/ADNKit/ANKAPIResponseMeta.h b/ADNKit/ANKAPIResponseMeta.h index b88c1ea..a3db9f6 100644 --- a/ADNKit/ANKAPIResponseMeta.h +++ b/ADNKit/ANKAPIResponseMeta.h @@ -59,6 +59,12 @@ static NSString *const kANKErrorIDKey = @"ANKErrorID"; @property (strong) NSString *errorSlug; @property (strong) NSString *errorID; +// rate limits +@property (strong) NSString *rateLimitRemaining; +@property (strong) NSString *rateLimitLimit; +@property (strong) NSString *rateLimitReset; +@property (strong) NSString *rateLimitRetryAfter; + // user streaming properties @property (assign) BOOL isDeleted; @property (strong) NSString *deletedID; diff --git a/ADNKit/ANKAPIResponseSerializer.m b/ADNKit/ANKAPIResponseSerializer.m index f025f09..040853d 100644 --- a/ADNKit/ANKAPIResponseSerializer.m +++ b/ADNKit/ANKAPIResponseSerializer.m @@ -11,8 +11,24 @@ - (id)responseObjectForResponse:(NSURLResponse *)response data:(NSData *)data error:(NSError *__autoreleasing *)error { - id originalResponse = [super responseObjectForResponse:response data:data error:error]; - return [[ANKAPIResponse alloc] initWithResponseObject:originalResponse]; + NSError *responseError; + + id originalResponse = [super responseObjectForResponse:response data:data error:&responseError]; + + NSDictionary* headers = [(NSHTTPURLResponse *)response allHeaderFields]; + ANKAPIResponse *apiResponse = [[ANKAPIResponse alloc] initWithResponseObject:originalResponse andHeaders:headers]; + + if (responseError) { + NSMutableDictionary *modifiedUserInfo = [responseError.userInfo mutableCopy]; + modifiedUserInfo[kANKAPIResponseKey] = apiResponse; + responseError = [NSError errorWithDomain:responseError.domain code:responseError.code userInfo:modifiedUserInfo]; + } + + if (error && responseError) { + *error = responseError; + } + + return apiResponse; } @end diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index 2ace37f..f4d3bcc 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -458,7 +458,8 @@ - (id)parsedObjectFromJSON:(NSDictionary *)JSON { BOOL isChannel = sampleObject[@"has_unread"] && sampleObject[@"readers"]; BOOL isFile = sampleObject[@"complete"] && sampleObject[@"file_token"]; - ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON]; + ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON andHeaders:nil]; + Class resourceClass = nil; if (isUser) @@ -527,7 +528,7 @@ - (void)socket:(KATSocketShuttle *)socket didReceiveMessage:(id)message { NSString *connectionID = metaDict[@"connection_id"]; NSArray *subscriptionIDs = metaDict[@"subscription_ids"]; BOOL isInitialConnectionResponse = (JSON.count == 1 && connectionID); - ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON]; + ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON andHeaders:nil]; if (isInitialConnectionResponse) { BOOL connectionWasRevived = [self.streamingConnectionID isEqualToString:self.lastSuccessfulStreamingConnectionID]; From 9b94cd9094594e5df8d00326fda63e1b9d1dea31 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Sun, 20 Apr 2014 08:52:56 +1000 Subject: [PATCH 17/20] Update submodule to AFNetworking 2.2.3 --- External/AFNetworking | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/External/AFNetworking b/External/AFNetworking index d103c94..c66282b 160000 --- a/External/AFNetworking +++ b/External/AFNetworking @@ -1 +1 @@ -Subproject commit d103c9401fba9e5ebe4f930fedc826dc0100d0a0 +Subproject commit c66282b09855bbf8f83cb0b49df69349a07134d9 From 69a67612d9b810e5915bd7b996a2ee5d35c61366 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Sun, 20 Apr 2014 08:54:03 +1000 Subject: [PATCH 18/20] Update `ANKClientFileUploadProgressBlock` to use `long long` in place of `NSInteger` (as per the updated API in AFNetworking 2.2.3) --- ADNKit/ANKClient+ANKHandlerBlocks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNKit/ANKClient+ANKHandlerBlocks.h b/ADNKit/ANKClient+ANKHandlerBlocks.h index c05eff1..eec7c81 100644 --- a/ADNKit/ANKClient+ANKHandlerBlocks.h +++ b/ADNKit/ANKClient+ANKHandlerBlocks.h @@ -17,7 +17,7 @@ typedef void (^AFNetworkingSuccessBlock)(AFHTTPRequestOperation *operation, id responseObject); typedef void (^AFNetworkingFailureBlock)(AFHTTPRequestOperation *operation, NSError *error); -typedef void (^ANKClientFileUploadProgressBlock)(NSUInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite); +typedef void (^ANKClientFileUploadProgressBlock)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite); @interface ANKClient (ANKHandlerBlocks) From 4a5f4a226ae0a706b38aa5a8ef74998a3ece1d9b Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Fri, 23 May 2014 14:20:12 +1000 Subject: [PATCH 19/20] AFNetworking 2.2.4 --- External/AFNetworking | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/External/AFNetworking b/External/AFNetworking index c66282b..0f7ab0e 160000 --- a/External/AFNetworking +++ b/External/AFNetworking @@ -1 +1 @@ -Subproject commit c66282b09855bbf8f83cb0b49df69349a07134d9 +Subproject commit 0f7ab0e4c009ed6908e8cb46f09049029cd1b80d From 0a9bdf1878078a12ad989f75e689be278e6f8747 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Fri, 23 May 2014 14:22:07 +1000 Subject: [PATCH 20/20] Handle streamed deletions --- ADNKit/ANKClient.h | 1 + ADNKit/ANKClient.m | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ADNKit/ANKClient.h b/ADNKit/ANKClient.h index eaacd16..6d02921 100644 --- a/ADNKit/ANKClient.h +++ b/ADNKit/ANKClient.h @@ -57,6 +57,7 @@ typedef NS_ENUM(NSUInteger, ANKStreamingAvailability) { @required - (void)client:(ANKClient *)client didReceiveObject:(id)responseObject withMeta:(ANKAPIResponseMeta *)meta; +- (void)client:(ANKClient *)client didDeleteObjectID:(NSString *)objectID withMeta:(ANKAPIResponseMeta *)meta; @end diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index f4d3bcc..0cf28b7 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.m @@ -544,14 +544,24 @@ - (void)socket:(KATSocketShuttle *)socket didReceiveMessage:(id)message { } } else { for (NSString *subscriptionID in subscriptionIDs) { - id object = [self parsedObjectFromJSON:JSON]; + if (response.meta.isDeleted) { + NSLog(@"Received deleted object ID: %@ subscription ID: %@", response.meta.deletedID, subscriptionID); - NSLog(@"Received object: %@ for subscription ID: %@", object, subscriptionID); + for (id streamingDelegate in [[self.streamContexts filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"identifier == %@", subscriptionID]] valueForKey:@"delegate"]) { + NSLog(@"Messaging delegate %@", streamingDelegate); - for (id streamingDelegate in [[self.streamContexts filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"identifier == %@", subscriptionID]] valueForKey:@"delegate"]) { - NSLog(@"Messaging delegate %@", streamingDelegate); - - [streamingDelegate client:self didReceiveObject:object withMeta:response.meta]; + [streamingDelegate client:self didDeleteObjectID:response.meta.deletedID withMeta:response.meta]; + } + } else { + id object = [self parsedObjectFromJSON:JSON]; + + NSLog(@"Received object: %@ for subscription ID: %@", object, subscriptionID); + + for (id streamingDelegate in [[self.streamContexts filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"identifier == %@", subscriptionID]] valueForKey:@"delegate"]) { + NSLog(@"Messaging delegate %@", streamingDelegate); + + [streamingDelegate client:self didReceiveObject:object withMeta:response.meta]; + } } } }