diff --git a/.gitmodules b/.gitmodules index b80f714..f889196 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,4 +2,6 @@ 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 73e4247..9f819b6 100644 --- a/ADNKit.xcodeproj/project.pbxproj +++ b/ADNKit.xcodeproj/project.pbxproj @@ -244,8 +244,8 @@ 252A898D16F8CDF3001F3E8F /* NSDictionary+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E816F8CDF1001F3E8F /* NSDictionary+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252A898E16F8CDF3001F3E8F /* NSDictionary+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88E916F8CDF2001F3E8F /* NSDictionary+ANKAdditions.m */; }; 252A898F16F8CDF3001F3E8F /* NSDictionary+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 252A88E916F8CDF2001F3E8F /* NSDictionary+ANKAdditions.m */; }; - 252AD7151745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 252AD7121745C76600E12492 /* ANKClient+ANKRequestsAPI.h */; }; - 252AD7161745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 252AD7121745C76600E12492 /* ANKClient+ANKRequestsAPI.h */; }; + 252AD7151745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 252AD7121745C76600E12492 /* ANKClient+ANKRequestsAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 252AD7161745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 252AD7121745C76600E12492 /* ANKClient+ANKRequestsAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; 252AD7171745C76600E12492 /* ANKClient+ANKRequestsAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 252AD7131745C76600E12492 /* ANKClient+ANKRequestsAPI.m */; }; 252AD7181745C76600E12492 /* ANKClient+ANKRequestsAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 252AD7131745C76600E12492 /* ANKClient+ANKRequestsAPI.m */; }; 252AD7191745C76600E12492 /* ANKClient+ANKRequestsAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 252AD7131745C76600E12492 /* ANKClient+ANKRequestsAPI.m */; }; @@ -253,7 +253,7 @@ 252E632617421632003143D6 /* ANKClient+ANKStreamMarker.m in Sources */ = {isa = PBXBuildFile; fileRef = 252E632417421632003143D6 /* ANKClient+ANKStreamMarker.m */; }; 252E632717421632003143D6 /* ANKClient+ANKStreamMarker.m in Sources */ = {isa = PBXBuildFile; fileRef = 252E632417421632003143D6 /* ANKClient+ANKStreamMarker.m */; }; 252E632817421632003143D6 /* ANKClient+ANKStreamMarker.m in Sources */ = {isa = PBXBuildFile; fileRef = 252E632417421632003143D6 /* ANKClient+ANKStreamMarker.m */; }; - 2567680F1711539D00C57D47 /* NSString+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2567680D1711539D00C57D47 /* NSString+ANKAdditions.h */; }; + 2567680F1711539D00C57D47 /* NSString+ANKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2567680D1711539D00C57D47 /* NSString+ANKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 256768101711539D00C57D47 /* NSString+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 2567680E1711539D00C57D47 /* NSString+ANKAdditions.m */; }; 256768111711539D00C57D47 /* NSString+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 2567680E1711539D00C57D47 /* NSString+ANKAdditions.m */; }; 256768121711539D00C57D47 /* NSString+ANKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 2567680E1711539D00C57D47 /* NSString+ANKAdditions.m */; }; @@ -348,10 +348,49 @@ 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 */; }; - 331B250F17A247DF000E553E /* ANKSearchQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 331B250D17A247DF000E553E /* ANKSearchQuery.h */; }; - 331B251017A247DF000E553E /* ANKSearchQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 331B250D17A247DF000E553E /* ANKSearchQuery.h */; }; + 33041CE917A3760A00C4B25A /* ANKStreamContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 335AC10F176427C300AEFCFE /* ANKStreamContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 33041CEA17A3760D00C4B25A /* ANKStreamContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 335AC110176427C300AEFCFE /* ANKStreamContext.m */; }; + 33041CF017A38A0F00C4B25A /* libSocketShuttle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25D01E0B17640FF1000D365D /* libSocketShuttle.a */; }; + 330BDCAA17659465009BD559 /* libSocketShuttle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25D01E0B17640FF1000D365D /* libSocketShuttle.a */; }; + 331B250F17A247DF000E553E /* ANKSearchQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 331B250D17A247DF000E553E /* ANKSearchQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 331B251017A247DF000E553E /* ANKSearchQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 331B250D17A247DF000E553E /* ANKSearchQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; 331B251117A247DF000E553E /* ANKSearchQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 331B250E17A247DF000E553E /* ANKSearchQuery.m */; }; 331B251217A247DF000E553E /* ANKSearchQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 331B250E17A247DF000E553E /* ANKSearchQuery.m */; }; + 3326109617A3B75B00665C05 /* ANKSearchQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 331B250D17A247DF000E553E /* ANKSearchQuery.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109717A3B77000665C05 /* ANKSearchQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 331B250E17A247DF000E553E /* ANKSearchQuery.m */; }; + 3326109817A3B7E500665C05 /* ADNKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC370E116E0805E00190862 /* ADNKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109917A3B7E500665C05 /* ADNKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA357CB16EBC18B00FA21F8 /* ADNKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109A17A3B7E500665C05 /* ADNKit-OSX.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA357CC16EBC18B00FA21F8 /* ADNKit-OSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109B17A3B7E500665C05 /* ANKClient+ANKHandlerBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889216F8CDB8001F3E8F /* ANKClient+ANKHandlerBlocks.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109C17A3B7E500665C05 /* ANKClient+ANKRequestsAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 252AD7121745C76600E12492 /* ANKClient+ANKRequestsAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109D17A3B7E500665C05 /* ANKClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A2C4316E5624700DAE393 /* ANKClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109E17A3B7E500665C05 /* ANKClient+ANKChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888A16F8CDB7001F3E8F /* ANKClient+ANKChannel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3326109F17A3B7E500665C05 /* ANKClient+ANKExploreStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888C16F8CDB7001F3E8F /* ANKClient+ANKExploreStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A017A3B7E500665C05 /* ANKClient+ANKFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A888E16F8CDB7001F3E8F /* ANKClient+ANKFile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A117A3B7E500665C05 /* ANKClient+ANKFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889016F8CDB8001F3E8F /* ANKClient+ANKFilter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A217A3B7E500665C05 /* ANKClient+ANKInteraction.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889416F8CDB8001F3E8F /* ANKClient+ANKInteraction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A317A3B7E500665C05 /* ANKClient+ANKMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889616F8CDB9001F3E8F /* ANKClient+ANKMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A417A3B7E500665C05 /* ANKClient+ANKPlace.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889816F8CDB9001F3E8F /* ANKClient+ANKPlace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A517A3B7E500665C05 /* ANKClient+ANKPost.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889A16F8CDBA001F3E8F /* ANKClient+ANKPost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A617A3B7E500665C05 /* ANKClient+ANKPostStreams.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889C16F8CDBA001F3E8F /* ANKClient+ANKPostStreams.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A717A3B7E500665C05 /* ANKClient+ANKStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A889E16F8CDBB001F3E8F /* ANKClient+ANKStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A817A3B7E500665C05 /* ANKClient+ANKTokenStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88A016F8CDBB001F3E8F /* ANKClient+ANKTokenStatus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610A917A3B7E500665C05 /* ANKClient+ANKUser.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88A216F8CDBC001F3E8F /* ANKClient+ANKUser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610AA17A3B7E500665C05 /* ANKClient+ANKStreamMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 252E632317421632003143D6 /* ANKClient+ANKStreamMarker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610AB17A3B7E500665C05 /* ANKOAuthViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88C016F8CDCC001F3E8F /* ANKOAuthViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610AC17A3B7E500665C05 /* ANKTextFieldCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88D616F8CDDD001F3E8F /* ANKTextFieldCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610AD17A3B7E500665C05 /* ANKUsernamePasswordAuthViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E216F8CDEA001F3E8F /* ANKUsernamePasswordAuthViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610AE17A3B7E500665C05 /* ANKValueTransformations.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E416F8CDED001F3E8F /* ANKValueTransformations.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 332610AF17A3B7E500665C05 /* ANKUsernameFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 252A88E016F8CDE8001F3E8F /* ANKUsernameFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 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, ); }; }; + 335AC111176427C300AEFCFE /* ANKStreamContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 335AC10F176427C300AEFCFE /* ANKStreamContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 335AC112176427C300AEFCFE /* ANKStreamContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 335AC110176427C300AEFCFE /* ANKStreamContext.m */; }; 5D2CFEE61703E8F200086FBD /* ANKTokenLimits.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D2CFEE41703E8F200086FBD /* ANKTokenLimits.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D2CFEE71703E8F200086FBD /* ANKTokenLimits.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D2CFEE51703E8F200086FBD /* ANKTokenLimits.m */; }; 5D2CFEE81703E8F200086FBD /* ANKTokenLimits.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D2CFEE51703E8F200086FBD /* ANKTokenLimits.m */; }; @@ -380,6 +419,9 @@ 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 */; }; + 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 */; }; /* End PBXBuildFile section */ @@ -391,6 +433,41 @@ remoteGlobalIDString = 5DC3710716E0808C00190862; remoteInfo = "ADNKit-OSX"; }; + 25D01E0A17640FF1000D365D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4DE9EB65170D870A005B295E; + remoteInfo = SocketShuttle; + }; + 25D01E0F17641021000D365D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 4DE9EB64170D870A005B295E; + remoteInfo = SocketShuttle; + }; + 330BDCA81765945F009BD559 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 4DE9EB64170D870A005B295E; + remoteInfo = SocketShuttle; + }; + 902756DC18B3076E00CB0579 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 905AF99E17BB3F40002FDE4E; + remoteInfo = SocketShuttleOSX; + }; + 905AF9D617BB41AD002FDE4E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 905AF99F17BB3F40002FDE4E; + remoteInfo = SocketShuttleOSX; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -412,6 +489,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 905AF9D917BB41C3002FDE4E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 905AF9DA17BB41CC002FDE4E /* SocketShuttle.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -551,8 +638,11 @@ 2592B80916FF8410004573FF /* libADNKit-AFNetworking-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libADNKit-AFNetworking-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 25C0AA43171867B8006E47B7 /* CustomPost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomPost.h; sourceTree = ""; }; 25C0AA44171867B8006E47B7 /* CustomPost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomPost.m; sourceTree = ""; }; + 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SocketShuttle.xcodeproj; path = External/SocketShuttle/SocketShuttle.xcodeproj; sourceTree = ""; }; 331B250D17A247DF000E553E /* ANKSearchQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKSearchQuery.h; sourceTree = ""; }; 331B250E17A247DF000E553E /* ANKSearchQuery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKSearchQuery.m; sourceTree = ""; }; + 335AC10F176427C300AEFCFE /* ANKStreamContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKStreamContext.h; sourceTree = ""; }; + 335AC110176427C300AEFCFE /* ANKStreamContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKStreamContext.m; sourceTree = ""; }; 5D2CFEE41703E8F200086FBD /* ANKTokenLimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKTokenLimits.h; sourceTree = ""; }; 5D2CFEE51703E8F200086FBD /* ANKTokenLimits.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANKTokenLimits.m; sourceTree = ""; }; 5D955BE4174BD10B0077E387 /* ANKGeneralParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANKGeneralParameters.h; sourceTree = ""; }; @@ -614,6 +704,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 33041CF017A38A0F00C4B25A /* libSocketShuttle.a in Frameworks */, 2592B7FF16FF8410004573FF /* UIKit.framework in Frameworks */, 2592B80016FF8410004573FF /* MobileCoreServices.framework in Frameworks */, 2592B80116FF8410004573FF /* SystemConfiguration.framework in Frameworks */, @@ -626,6 +717,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 330BDCAA17659465009BD559 /* libSocketShuttle.a in Frameworks */, 5DC3727E16E3AF6900190862 /* UIKit.framework in Frameworks */, 5DC3727B16E3AF4400190862 /* MobileCoreServices.framework in Frameworks */, 5DC3727916E3AF4000190862 /* SystemConfiguration.framework in Frameworks */, @@ -638,6 +730,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 905AF9D817BB41B1002FDE4E /* SocketShuttle.framework in Frameworks */, F153F9AA1773C1DE0018BC16 /* Security.framework in Frameworks */, 252A87D416F79A09001F3E8F /* CoreServices.framework in Frameworks */, 5DC3728316E3AF8E00190862 /* SystemConfiguration.framework in Frameworks */, @@ -652,13 +745,15 @@ 2592B70516F8D120004573FF /* ANKClient */ = { isa = PBXGroup; children = ( - 252A2C4316E5624700DAE393 /* ANKClient.h */, - 252A2C4416E5624700DAE393 /* ANKClient.m */, - 2592B70916F8D1CC004573FF /* App.net API */, 252A889216F8CDB8001F3E8F /* ANKClient+ANKHandlerBlocks.h */, 252A889316F8CDB8001F3E8F /* ANKClient+ANKHandlerBlocks.m */, 252AD7121745C76600E12492 /* ANKClient+ANKRequestsAPI.h */, 252AD7131745C76600E12492 /* ANKClient+ANKRequestsAPI.m */, + 252A2C4316E5624700DAE393 /* ANKClient.h */, + 252A2C4416E5624700DAE393 /* ANKClient.m */, + 335AC10F176427C300AEFCFE /* ANKStreamContext.h */, + 335AC110176427C300AEFCFE /* ANKStreamContext.m */, + 2592B70916F8D1CC004573FF /* App.net API */, ); name = ANKClient; sourceTree = ""; @@ -830,6 +925,24 @@ name = "Supporting Files"; sourceTree = ""; }; + 25D01E0617640FF1000D365D /* Products */ = { + isa = PBXGroup; + children = ( + 25D01E0B17640FF1000D365D /* libSocketShuttle.a */, + 905AF9D717BB41AD002FDE4E /* SocketShuttle.framework */, + ); + name = Products; + sourceTree = ""; + }; + 25D01E0C17640FFA000D365D /* External */ = { + isa = PBXGroup; + children = ( + 5DC3724616E3AE1500190862 /* AFNetworking */, + 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */, + ); + name = External; + sourceTree = ""; + }; 5DC370D016E0805E00190862 = { isa = PBXGroup; children = ( @@ -839,7 +952,7 @@ 5DC370DE16E0805E00190862 /* ADNKit */, 5DC370DF16E0805E00190862 /* Supporting Files */, 5DC3710A16E0808C00190862 /* ADNKit-OSX */, - 5DC3724616E3AE1500190862 /* AFNetworking */, + 25D01E0C17640FFA000D365D /* External */, 2592B7A916FCED64004573FF /* ADNKitTests */, 5DC370DB16E0805E00190862 /* Frameworks */, 5DC370DA16E0805E00190862 /* Products */, @@ -1053,8 +1166,10 @@ 24DA122A1741FC2E00CAA8C5 /* AFXMLRequestOperation.h in Headers */, 24DA122B1741FC2E00CAA8C5 /* UIImageView+AFNetworking.h in Headers */, 24DA122C1741FC2E00CAA8C5 /* AFNetworkActivityIndicatorManager.h in Headers */, - 252AD7151745C76600E12492 /* ANKClient+ANKRequestsAPI.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 */, 5D955BE7174BD10B0077E387 /* ANKGeneralParameters.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1065,6 +1180,38 @@ files = ( 331B250F17A247DF000E553E /* ANKSearchQuery.h in Headers */, 5D955BE6174BD10B0077E387 /* ANKGeneralParameters.h in Headers */, + 335AC111176427C300AEFCFE /* ANKStreamContext.h in Headers */, + 3326109817A3B7E500665C05 /* ADNKit.h in Headers */, + 3326109917A3B7E500665C05 /* ADNKit-iOS.h in Headers */, + 3326109A17A3B7E500665C05 /* ADNKit-OSX.h in Headers */, + 3326109B17A3B7E500665C05 /* ANKClient+ANKHandlerBlocks.h in Headers */, + 3326109C17A3B7E500665C05 /* ANKClient+ANKRequestsAPI.h in Headers */, + 3326109D17A3B7E500665C05 /* ANKClient.h in Headers */, + 3326109E17A3B7E500665C05 /* ANKClient+ANKChannel.h in Headers */, + 3326109F17A3B7E500665C05 /* ANKClient+ANKExploreStream.h in Headers */, + 332610A017A3B7E500665C05 /* ANKClient+ANKFile.h in Headers */, + 332610A117A3B7E500665C05 /* ANKClient+ANKFilter.h in Headers */, + 332610A217A3B7E500665C05 /* ANKClient+ANKInteraction.h in Headers */, + 332610A317A3B7E500665C05 /* ANKClient+ANKMessage.h in Headers */, + 332610A417A3B7E500665C05 /* ANKClient+ANKPlace.h in Headers */, + 332610A517A3B7E500665C05 /* ANKClient+ANKPost.h in Headers */, + 332610A617A3B7E500665C05 /* ANKClient+ANKPostStreams.h in Headers */, + 332610A717A3B7E500665C05 /* ANKClient+ANKStream.h in Headers */, + 332610A817A3B7E500665C05 /* ANKClient+ANKTokenStatus.h in Headers */, + 332610A917A3B7E500665C05 /* ANKClient+ANKUser.h in Headers */, + 332610AA17A3B7E500665C05 /* ANKClient+ANKStreamMarker.h in Headers */, + 332610AB17A3B7E500665C05 /* ANKOAuthViewController.h in Headers */, + 332610AC17A3B7E500665C05 /* ANKTextFieldCell.h in Headers */, + 332610AD17A3B7E500665C05 /* ANKUsernamePasswordAuthViewController.h in Headers */, + 332610AE17A3B7E500665C05 /* ANKValueTransformations.h in Headers */, + 332610AF17A3B7E500665C05 /* ANKUsernameFormatter.h in Headers */, + 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 */, + 332610B517A3B7E500665C05 /* NSDictionary+ANKAdditions.h in Headers */, + 332610B617A3B7E500665C05 /* NSString+ANKAdditions.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1139,10 +1286,10 @@ 252A898A16F8CDF3001F3E8F /* NSArray+ANKAdditions.h in Headers */, 252A898D16F8CDF3001F3E8F /* NSDictionary+ANKAdditions.h in Headers */, 5D2CFEE61703E8F200086FBD /* ANKTokenLimits.h in Headers */, - 331B251017A247DF000E553E /* ANKSearchQuery.h in Headers */, - 2567680F1711539D00C57D47 /* NSString+ANKAdditions.h in Headers */, 2567682717153E3200C57D47 /* ANKResourceMap.h in Headers */, + 331B251017A247DF000E553E /* ANKSearchQuery.h in Headers */, 252AD7161745C76600E12492 /* ANKClient+ANKRequestsAPI.h in Headers */, + 2567680F1711539D00C57D47 /* NSString+ANKAdditions.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1180,6 +1327,7 @@ buildRules = ( ); dependencies = ( + 25D01E1017641021000D365D /* PBXTargetDependency */, ); name = "ADNKit-AFNetworking-iOS"; productName = ADNKit; @@ -1198,6 +1346,7 @@ buildRules = ( ); dependencies = ( + 330BDCA91765945F009BD559 /* PBXTargetDependency */, ); name = "ADNKit-iOS"; productName = ADNKit; @@ -1212,10 +1361,12 @@ 5DC3710416E0808C00190862 /* Frameworks */, 5DC3710516E0808C00190862 /* Headers */, 5DC3710616E0808C00190862 /* Resources */, + 905AF9D917BB41C3002FDE4E /* CopyFiles */, ); buildRules = ( ); dependencies = ( + 902756DD18B3076E00CB0579 /* PBXTargetDependency */, ); name = "ADNKit-OSX"; productName = "ADNKit-OSX"; @@ -1241,6 +1392,12 @@ mainGroup = 5DC370D016E0805E00190862; productRefGroup = 5DC370DA16E0805E00190862 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 25D01E0617640FF1000D365D /* Products */; + ProjectRef = 25D01E0517640FF1000D365D /* SocketShuttle.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 5DC370D816E0805E00190862 /* ADNKit-iOS */, @@ -1251,6 +1408,23 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 25D01E0B17640FF1000D365D /* libSocketShuttle.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libSocketShuttle.a; + remoteRef = 25D01E0A17640FF1000D365D /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 905AF9D717BB41AD002FDE4E /* SocketShuttle.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SocketShuttle.framework; + remoteRef = 905AF9D617BB41AD002FDE4E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 2592B79D16FCED64004573FF /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -1300,6 +1474,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3326109717A3B77000665C05 /* ANKSearchQuery.m in Sources */, 2592B7C616FF8410004573FF /* ANKClient.m in Sources */, 2592B7C716FF8410004573FF /* ANKACL.m in Sources */, 2592B7C816FF8410004573FF /* ANKAnnotatableResource.m in Sources */, @@ -1364,6 +1539,7 @@ 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 */, 256768111711539D00C57D47 /* NSString+ANKAdditions.m in Sources */, @@ -1441,6 +1617,7 @@ 252E632617421632003143D6 /* ANKClient+ANKStreamMarker.m in Sources */, 252AD7171745C76600E12492 /* ANKClient+ANKRequestsAPI.m in Sources */, 5D955BE9174BD10B0077E387 /* ANKGeneralParameters.m in Sources */, + 335AC112176427C300AEFCFE /* ANKStreamContext.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1510,6 +1687,7 @@ 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 */, @@ -1528,6 +1706,21 @@ target = 5DC3710716E0808C00190862 /* ADNKit-OSX */; targetProxy = 2592B7B616FCED92004573FF /* PBXContainerItemProxy */; }; + 25D01E1017641021000D365D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SocketShuttle; + targetProxy = 25D01E0F17641021000D365D /* PBXContainerItemProxy */; + }; + 330BDCA91765945F009BD559 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SocketShuttle; + targetProxy = 330BDCA81765945F009BD559 /* PBXContainerItemProxy */; + }; + 902756DD18B3076E00CB0579 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = SocketShuttleOSX; + targetProxy = 902756DC18B3076E00CB0579 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -1593,7 +1786,11 @@ DSTROOT = /tmp/ADNKit.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)\""; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "ADNKit-AFNetworking-iOS"; PUBLIC_HEADERS_FOLDER_PATH = ADNKit; @@ -1607,7 +1804,11 @@ DSTROOT = /tmp/ADNKit.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)\""; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "ADNKit-AFNetworking-iOS"; PUBLIC_HEADERS_FOLDER_PATH = ADNKit; @@ -1615,10 +1816,133 @@ }; name = Release; }; + 331FA3CA1773E7FB0011DF8E /* TestFlight */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + SDKROOT = iphoneos; + }; + name = TestFlight; + }; + 331FA3CB1773E7FB0011DF8E /* TestFlight */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/ADNKit.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ADNKit; + SKIP_INSTALL = YES; + }; + name = TestFlight; + }; + 331FA3CC1773E7FB0011DF8E /* TestFlight */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/ADNKit.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "ADNKit-AFNetworking-iOS"; + PUBLIC_HEADERS_FOLDER_PATH = ADNKit; + SKIP_INSTALL = YES; + }; + name = TestFlight; + }; + 331FA3CD1773E7FB0011DF8E /* TestFlight */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + $DEVELOPER_FRAMEWORKS_DIR_QUOTED, + ); + FRAMEWORK_VERSION = A; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; + 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; + PRODUCT_NAME = ADNKit; + SDKROOT = macosx; + WRAPPER_EXTENSION = framework; + }; + name = TestFlight; + }; + 331FA3CE1773E7FB0011DF8E /* TestFlight */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "ADNKitTests/ADNKitTests-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + INFOPLIST_FILE = "ADNKitTests/ADNKitTests-Info.plist"; + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + WRAPPER_EXTENSION = octest; + }; + name = TestFlight; + }; 5DC370E516E0805E00190862 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1639,8 +1963,17 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); IPHONEOS_DEPLOYMENT_TARGET = 5.0; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); SDKROOT = iphoneos; }; name = Debug; @@ -1648,7 +1981,7 @@ 5DC370E616E0805E00190862 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; @@ -1662,7 +1995,16 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -1674,8 +2016,15 @@ DSTROOT = /tmp/ADNKit.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)\""; - OTHER_LDFLAGS = "-ObjC"; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ADNKit; SKIP_INSTALL = YES; @@ -1688,8 +2037,15 @@ DSTROOT = /tmp/ADNKit.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "ADNKit/ADNKit-Prefix.pch"; - HEADER_SEARCH_PATHS = "\"$(SRCROOT)\""; - OTHER_LDFLAGS = "-ObjC"; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)\"", + "\"$(SRCROOT)/External/SocketShuttle\"", + "\"$(SRCROOT)/External/SocketShuttle/Third-Party/SocketRocket\"", + ); + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ADNKit; SKIP_INSTALL = YES; @@ -1705,7 +2061,7 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"", + $DEVELOPER_FRAMEWORKS_DIR_QUOTED, ); FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -1731,7 +2087,7 @@ DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"", + $DEVELOPER_FRAMEWORKS_DIR_QUOTED, ); FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -1754,6 +2110,7 @@ isa = XCConfigurationList; buildConfigurations = ( 2592B7B316FCED64004573FF /* Debug */, + 331FA3CE1773E7FB0011DF8E /* TestFlight */, 2592B7B416FCED64004573FF /* Release */, ); defaultConfigurationIsVisible = 0; @@ -1763,6 +2120,7 @@ isa = XCConfigurationList; buildConfigurations = ( 2592B80716FF8410004573FF /* Debug */, + 331FA3CC1773E7FB0011DF8E /* TestFlight */, 2592B80816FF8410004573FF /* Release */, ); defaultConfigurationIsVisible = 0; @@ -1772,6 +2130,7 @@ isa = XCConfigurationList; buildConfigurations = ( 5DC370E516E0805E00190862 /* Debug */, + 331FA3CA1773E7FB0011DF8E /* TestFlight */, 5DC370E616E0805E00190862 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -1781,6 +2140,7 @@ isa = XCConfigurationList; buildConfigurations = ( 5DC370E816E0805E00190862 /* Debug */, + 331FA3CB1773E7FB0011DF8E /* TestFlight */, 5DC370E916E0805E00190862 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -1790,6 +2150,7 @@ isa = XCConfigurationList; buildConfigurations = ( 5DC3711516E0808C00190862 /* Debug */, + 331FA3CD1773E7FB0011DF8E /* TestFlight */, 5DC3711616E0808C00190862 /* Release */, ); defaultConfigurationIsVisible = 0; diff --git a/ADNKit/ADNKit-Prefix.pch b/ADNKit/ADNKit-Prefix.pch index a34720d..a797d77 100644 --- a/ADNKit/ADNKit-Prefix.pch +++ b/ADNKit/ADNKit-Prefix.pch @@ -13,8 +13,6 @@ #ifdef __OBJC__ #import - #define _AFNETWORKING_PIN_SSL_CERTIFICATES_ - #if __IPHONE_OS_VERSION_MIN_REQUIRED #import #endif diff --git a/ADNKit/ADNKit-iOS.h b/ADNKit/ADNKit-iOS.h index eddb1bc..37d8a56 100644 --- a/ADNKit/ADNKit-iOS.h +++ b/ADNKit/ADNKit-iOS.h @@ -10,5 +10,5 @@ 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 -#import +#import "ANKOAuthViewController.h" +#import "ANKUsernamePasswordAuthViewController.h" diff --git a/ADNKit/ANKAPIResponseMeta.h b/ADNKit/ANKAPIResponseMeta.h index 17f9d73..b88c1ea 100644 --- a/ADNKit/ANKAPIResponseMeta.h +++ b/ADNKit/ANKAPIResponseMeta.h @@ -59,6 +59,13 @@ static NSString *const kANKErrorIDKey = @"ANKErrorID"; @property (strong) NSString *errorSlug; @property (strong) NSString *errorID; +// user streaming properties +@property (assign) BOOL isDeleted; +@property (strong) NSString *deletedID; +@property (strong) NSArray *subscriptionIDs; +@property (strong) NSString *connectionID; +@property (strong) NSString *type; + - (NSError *)error; - (BOOL)isError; - (ANKErrorType)errorType; diff --git a/ADNKit/ANKAPIResponseMeta.m b/ADNKit/ANKAPIResponseMeta.m index 84563ae..9f28632 100644 --- a/ADNKit/ANKAPIResponseMeta.m +++ b/ADNKit/ANKAPIResponseMeta.m @@ -23,7 +23,12 @@ + (NSDictionary *)JSONToLocalKeyMapping { @"more": @"moreDataAvailable", @"error_message": @"errorMessage", @"error_slug": @"errorSlug", - @"error_id": @"errorID"}]; + @"error_id": @"errorID", + @"is_deleted": @"isDeleted", + @"deleted_id": @"deletedID", + @"subscription_ids": @"subscriptionIDs", + @"connection_id": @"connectionID", + @"type": @"type"}]; } diff --git a/ADNKit/ANKAnnotation.m b/ADNKit/ANKAnnotation.m index bc03cf3..9aec80f 100644 --- a/ADNKit/ANKAnnotation.m +++ b/ADNKit/ANKAnnotation.m @@ -15,6 +15,7 @@ #import "ANKPlace.h" #import "ANKChannel.h" #import "ANKGeolocation.h" +#import "ANKOEmbed.h" @interface ANKAnnotation () diff --git a/ADNKit/ANKChannel.h b/ADNKit/ANKChannel.h index a71bb62..9f69f3c 100644 --- a/ADNKit/ANKChannel.h +++ b/ADNKit/ANKChannel.h @@ -28,6 +28,7 @@ @property (strong) ANKACL *writers; @property (assign) BOOL isCurrentUserSubscribed; @property (assign) BOOL isEditableByCurrentUser; +@property (assign) BOOL isInactive; @property (assign) BOOL hasUnreadMessages; - (BOOL)isPrivateMessageChannel; diff --git a/ADNKit/ANKChannel.m b/ADNKit/ANKChannel.m index 574c7e8..3dd3ae8 100644 --- a/ADNKit/ANKChannel.m +++ b/ADNKit/ANKChannel.m @@ -23,7 +23,8 @@ + (NSDictionary *)JSONToLocalKeyMapping { @"you_can_edit": @"isEditableByCurrentUser", @"has_unread": @"hasUnreadMessages", @"recent_message_id": @"latestMessageID", - @"recent_message": @"latestMessage"}]; + @"recent_message": @"latestMessage", + @"is_inactive" : @"isInactive"}]; } diff --git a/ADNKit/ANKClient+ANKRequestsAPI.m b/ADNKit/ANKClient+ANKRequestsAPI.m index ebac2bc..70550b1 100644 --- a/ADNKit/ANKClient+ANKRequestsAPI.m +++ b/ADNKit/ANKClient+ANKRequestsAPI.m @@ -1,4 +1,4 @@ -/* + /* Copyright (c) 2013, Joel Levin All rights reserved. diff --git a/ADNKit/ANKClient.h b/ADNKit/ANKClient.h index 45ec194..47115f5 100644 --- a/ADNKit/ANKClient.h +++ b/ADNKit/ANKClient.h @@ -34,8 +34,32 @@ typedef NS_ENUM(NSUInteger, ANKResponseDecodingType) { ANKResponseDecodingTypeNone // don't decode server response }; +typedef NS_ENUM(NSUInteger, ANKStreamingAvailability) { + ANKStreamingAvailabilityAllConnections, + ANKStreamingAvailabilityWiFi +}; + + +@class ANKClient, ANKAPIResponseMeta; + +#pragma mark - +#pragma mark - Protocols + +@protocol ANKStreamingDelegate + +@optional + +- (void)clientSocketDidConnect:(ANKClient *)client; +- (void)clientSocketDidDisconnect:(ANKClient *)client; + +- (void)client:(ANKClient *)client didDisconnectOnSocketError:(NSError *)error; + +@required + +- (void)client:(ANKClient *)client didReceiveObject:(id)responseObject withMeta:(ANKAPIResponseMeta *)meta; + +@end -@class ANKAPIResponseMeta; typedef void (^ANKClientCompletionBlock)(id responseObject, ANKAPIResponseMeta *meta, NSError *error); @@ -58,6 +82,8 @@ typedef void (^ANKClientCompletionBlock)(id responseObject, ANKAPIResponseMeta * @property (assign) dispatch_queue_t successCallbackQueue; @property (assign) dispatch_queue_t failureCallbackQueue; +@property (assign) ANKStreamingAvailability streamingAvailbility; + @property (copy) void (^webAuthCompletionHandler)(BOOL success, NSError *error); // set as completion block for oauth authentication #pragma mark - @@ -109,6 +135,10 @@ typedef void (^ANKClientCompletionBlock)(id responseObject, ANKAPIResponseMeta * - (void)setObject:(id)object forKeyInAuthenticatedUserDefaults:(NSString *)key; - (id)objectForKeyInAuthenticatedUserDefaults:(NSString *)key; +#pragma mark - +#pragma mark - Streams + +- (void)requestStreamingUpdatesForOperation:(ANKJSONRequestOperation *)operation withDelegate:(id)delegate; #pragma mark - #pragma mark Operation Queues diff --git a/ADNKit/ANKClient.m b/ADNKit/ANKClient.m index 182cd39..0c8e4e3 100644 --- a/ADNKit/ANKClient.m +++ b/ADNKit/ANKClient.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. @@ -15,18 +15,33 @@ #import "ANKPaginationSettings.h" #import "ANKGeneralParameters.h" #import "ANKAPIResponseMeta.h" +#import "ANKAPIResponse.h" #import "ANKTokenStatus.h" #import "ANKResourceMap.h" #import "ANKUser.h" +#import "ANKMessage.h" +#import "ANKFile.h" +#import "ANKPost.h" +#import "ANKChannel.h" #import "ANKClient+ANKTokenStatus.h" +#import "ANKStreamContext.h" +#import + +static const NSString *kANKUserStreamEndpointURL = @"wss://stream-channel.app.net/stream/user"; -@interface ANKClient () + +@interface ANKClient () @property (strong) AFHTTPClient *authHTTPClient; @property (strong) NSString *webAuthRedirectURI; @property (readwrite, strong) ANKUser *authenticatedUser; +@property (nonatomic, strong) KATSocketShuttle *socketShuttle; +@property (nonatomic, copy) NSString *streamingConnectionID; +@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; @@ -42,7 +57,7 @@ + (instancetype)sharedClient { dispatch_once(&onceToken, ^{ sharedANKClient = [[ANKClient alloc] init]; }); - + return sharedANKClient; } @@ -58,12 +73,16 @@ - (id)init { 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.streamContexts = [[NSMutableSet alloc] init]; + self.streamingAvailbility = ANKStreamingAvailabilityWiFi; } - + return self; } @@ -75,7 +94,7 @@ - (void)dealloc { - (id)copyWithZone:(NSZone *)zone { ANKClient *copy = [[[self class] alloc] init]; - + copy.accessToken = [self.accessToken copyWithZone:zone]; copy.authenticatedUser = [self.authenticatedUser copyWithZone:zone]; copy.generalParameters = [self.generalParameters copyWithZone:zone]; @@ -83,7 +102,7 @@ - (id)copyWithZone:(NSZone *)zone { copy.shouldUseSharedUserDefaultsController = self.shouldUseSharedUserDefaultsController; copy.shouldSynchronizeOnUserDefaultsWrite = self.shouldSynchronizeOnUserDefaultsWrite; copy.responseDecodingType = self.responseDecodingType; - + return copy; } @@ -117,13 +136,19 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)p return request; } +- (void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation { + [super enqueueHTTPRequestOperation:operation]; + + [self.operationQueue setSuspended:NO]; +} + #pragma mark - #pragma mark Authentication - (void)authenticateUsername:(NSString *)username password:(NSString *)password clientID:(NSString *)clientID passwordGrantSecret:(NSString *)passwordGrantSecret authScopes:(ANKAuthScope)authScopes completionHandler:(void (^)(BOOL success, NSError *error))completionHander { // http://developers.app.net/docs/authentication/flows/password/ - + NSDictionary *parameters = @{@"client_id": clientID, @"password_grant_secret": passwordGrantSecret, @"grant_type": @"password", @"username": username, @"password": password, @"scope": [[self class] scopeStringForAuthScopes:authScopes]}; [self authenticateWithParameters:parameters handler:completionHander]; } @@ -133,23 +158,23 @@ - (NSURLRequest *)webAuthRequestForClientID:(NSString *)clientID redirectURI:(NS // http://developers.app.net/docs/authentication/flows/web/ self.webAuthRedirectURI = redirectURI; NSMutableString *URLString = [NSMutableString stringWithFormat:@"https://account.app.net/oauth/authenticate?client_id=%@&response_type=code", clientID]; - + if (authScopes) { [URLString appendFormat:@"&scope=%@", [[self class] scopeStringForAuthScopes:authScopes]]; } - + if (redirectURI) { [URLString appendFormat:@"&redirect_uri=%@", redirectURI]; } - + if (shouldBeAppStoreCompliant) { [URLString appendString:@"&adnview=appstore"]; } - + if (state) { [URLString appendFormat:@"&state=%@", state]; } - + NSURL *URL = [NSURL URLWithString:URLString]; return [NSURLRequest requestWithURL:URL cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:60]; } @@ -164,9 +189,9 @@ - (void)authenticateWebAuthAccessCode:(NSString *)accessCode forClientID:(NSStri + (NSString *)scopeStringForAuthScopes:(ANKAuthScope)scopes { if (scopes == ANKAuthScopeNone) return nil; - + NSMutableArray *scopeValues = [NSMutableArray array]; - + if ((scopes & ANKAuthScopeBasic) == ANKAuthScopeBasic) [scopeValues addObject:@"basic"]; if ((scopes & ANKAuthScopeStream) == ANKAuthScopeStream) [scopeValues addObject:@"stream"]; if ((scopes & ANKAuthScopeEmail) == ANKAuthScopeEmail) [scopeValues addObject:@"email"]; @@ -177,14 +202,14 @@ + (NSString *)scopeStringForAuthScopes:(ANKAuthScope)scopes { if ((scopes & ANKAuthScopeUpdateProfile) == ANKAuthScopeUpdateProfile) [scopeValues addObject:@"update_profile"]; if ((scopes & ANKAuthScopeExport) == ANKAuthScopeExport) [scopeValues addObject:@"export"]; if ((scopes & ANKAuthScopeFiles) == ANKAuthScopeFiles) [scopeValues addObject:@"files"]; - + return [scopeValues componentsJoinedByString:@","]; } + (NSArray *)scopeDescriptionsForScope:(ANKAuthScope)scope { NSMutableArray *scopeDescriptions = [NSMutableArray array]; - + static NSDictionary *scopeDescriptionMap = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -199,15 +224,15 @@ + (NSArray *)scopeDescriptionsForScope:(ANKAuthScope)scope { mapping[@"update_profile"] = @"Update your profile information"; mapping[@"export"] = @"Bulk export all of your App.net data"; mapping[@"files"] = @"Manage your files for you"; - + scopeDescriptionMap = mapping; }); - + NSArray *scopeKeys = [[self scopeStringForAuthScopes:scope] componentsSeparatedByString:@","]; for (NSString *scopeKey in scopeKeys) { [scopeDescriptions addObject:scopeDescriptionMap[scopeKey]]; } - + return scopeDescriptions; } @@ -247,7 +272,7 @@ - (void)logOutAndDeauthorizeUserTokenWithCompletion:(ANKClientCompletionBlock)co if (!meta.isError && !error) { [self logOut]; } - + if (completionHandler) { completionHandler(responseObject, meta, error); } @@ -286,13 +311,13 @@ - (void)setObject:(id)object forKeyInAuthenticatedUserDefaults:(NSString *)key { if (self.isAuthenticated) { NSDictionary *settings = [self authenticatedUserDefaults] ?: @{}; NSMutableDictionary *modifiedSettings = [NSMutableDictionary dictionaryWithDictionary:settings]; - + if (object) { modifiedSettings[key] = object; } else { [modifiedSettings removeObjectForKey:key]; } - + [self.userDefaults setObject:modifiedSettings forKey:[NSString stringWithFormat:@"ANKUser%@", self.authenticatedUser.userID]]; if (self.shouldSynchronizeOnUserDefaultsWrite) { [self.userDefaults synchronize]; @@ -358,11 +383,200 @@ - (void)HTTPAuthDidCompleteSuccessfully:(BOOL)wasSuccessful error:(NSError *)err if (handler) { handler(wasSuccessful, error); } - + self.authHTTPClient = nil; self.webAuthCompletionHandler = nil; self.webAuthRedirectURI = nil; } +#pragma mark - +#pragma mark Streams + +- (NSURLRequest *)streamingRequest { + if (!self.streamingConnectionID) { + self.streamingConnectionID = [[NSProcessInfo processInfo] globallyUniqueString]; + } + + NSMutableURLRequest *streamingRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[(NSString *)kANKUserStreamEndpointURL stringByAppendingFormat:@"?connection_id=%@", self.streamingConnectionID]]]; + [streamingRequest setValue:[self defaultValueForHeader:@"Authorization"] forHTTPHeaderField:@"Authorization"]; + + return streamingRequest; +} + + +- (void)requestStreamingUpdatesForOperation:(ANKJSONRequestOperation *)operation 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]; + } + + if (self.socketShuttle.socketState == KATSocketStateConnected) { + [self reconfigureOperationForStreaming:operation subscriptionID:&subscriptionID]; + } else if (self.socketShuttle.socketState == KATSocketStateDisconnected || self.socketShuttle.socketState == KATSocketStateOffline) { + if (operation.isPaused) { + [operation resume]; + } else if (operation.isReady) { + [operation start]; + } + } else if (self.socketShuttle.socketState == KATSocketStateConnecting){ + [operation pause]; + } + + [self.streamContexts addObject:[ANKStreamContext streamContextWithOperation:operation identifier:subscriptionID delegate:delegate]]; +} + + +- (void)reconfigureOperationForStreaming:(ANKJSONRequestOperation *)operation subscriptionID:(NSString **)subscriptionID { + NSString *uniqueString = [[NSProcessInfo processInfo] globallyUniqueString]; + *subscriptionID = uniqueString; + + NSURL *modifiedURL = [NSURL URLWithString:[operation.request.URL.absoluteString stringByAppendingFormat:@"&connection_id=%@&subscription_id=%@", self.streamingConnectionID, uniqueString]]; + NSMutableURLRequest *request = [operation.request mutableCopy]; + request.URL = modifiedURL; + + [operation setValue:request forKey:@"request"]; + + if (operation.isPaused) { + [operation resume]; + } else if (operation.isFinished) { + [operation start]; + } +} + + +- (id)parsedObjectFromJSON:(NSDictionary *)JSON { + if (self.responseDecodingType != ANKResponseDecodingTypeNone) { + NSSet *dataSet = [[NSSet alloc] initWithArray:JSON[@"data"]]; + NSDictionary *sampleObject = [dataSet anyObject]; + + if (sampleObject) { + BOOL isUser = sampleObject[@"username"] && sampleObject[@"timezone"] && sampleObject[@"avatar_image"]; + 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"]; + + ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON]; + Class resourceClass = nil; + + if (isUser) + resourceClass = [ANKUser class]; + else if (isMessage) + resourceClass = [ANKMessage class]; + else if (isPost) + resourceClass = [ANKPost class]; + else if (isFile) + resourceClass = [ANKFile class]; + else if (isChannel) + resourceClass = [ANKChannel class]; + + if (resourceClass) + return [self unboxCollectionResponse:response ofResourceClass:resourceClass]; + } + } + + return JSON; +} + + +- (NSSet *)streamingDelegates { + return [self.streamContexts valueForKey:@"delegate"]; +} + + +- (NSSet *)streamingDelegatesImplementingDelegateMethod:(SEL)delegateMethod { + return [[self streamingDelegates] filteredSetUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id streamingDelegate, NSDictionary *bindings) { + return [streamingDelegate respondsToSelector:delegateMethod]; + }]]; +} + + +- (void)iterateOverStreamingDelegatesImplementingDelegateMethod:(SEL)delegateMethod withBlock:(void (^)(idstreamingDelegate))iterativeBlock { + [[self streamingDelegatesImplementingDelegateMethod:delegateMethod] enumerateObjectsUsingBlock:^(idstreamingDelegate, BOOL *stop) { + iterativeBlock(streamingDelegate); + }]; +} + + +- (void)socketShuttleDisconnectCommon { + self.socketShuttle = [[KATSocketShuttle alloc] initWithRequest:[self streamingRequest] delegate:self connectConditions:self.streamingAvailbility == ANKStreamingAvailabilityWiFi ? KATSocketConnectConditionWLAN : KATSocketConnectConditionAlways]; +} + + +#pragma mark - +#pragma mark KATSocketShuttleDelegate + +- (void)socketDidOpen:(KATSocketShuttle *)socket { + __weak typeof(self) weakSelf = self; + [self iterateOverStreamingDelegatesImplementingDelegateMethod:@selector(clientSocketDidConnect:) withBlock:^(id streamingDelegate) { + [streamingDelegate clientSocketDidConnect:weakSelf]; + }]; +} + + +- (void)socket:(KATSocketShuttle *)socket didReceiveMessage:(id)message { + NSError *error = nil; + NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData:[message dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&error]; + if (error) { + return; + } + + NSDictionary *metaDict = JSON[@"meta"]; + NSString *connectionID = metaDict[@"connection_id"]; + NSArray *subscriptionIDs = metaDict[@"subscription_ids"]; + BOOL isInitialConnectionResponse = (JSON.count == 1 && connectionID); + ANKAPIResponse *response = [[ANKAPIResponse alloc] initWithResponseObject:JSON]; + + if (isInitialConnectionResponse) { + BOOL connectionWasRevived = [self.streamingConnectionID isEqualToString:self.lastSuccessfulStreamingConnectionID]; + self.streamingConnectionID = connectionID; + self.lastSuccessfulStreamingConnectionID = self.streamingConnectionID; + + if (!connectionWasRevived) { + for (ANKStreamContext *streamContext in self.streamContexts) { + NSString *newID = nil; + [self reconfigureOperationForStreaming:streamContext.operation subscriptionID:&newID]; + streamContext.identifier = newID; + } + } + } else { + for (NSString *subscriptionID in subscriptionIDs) { + 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]; + } + } + } +} + + +- (void)socket:(KATSocketShuttle *)socket didFailWithError:(NSError *)error { + [self socketShuttleDisconnectCommon]; + + __weak typeof(self) weakSelf = self; + [self iterateOverStreamingDelegatesImplementingDelegateMethod:@selector(client:didDisconnectOnSocketError:) withBlock:^(id streamingDelegate) { + [streamingDelegate client:weakSelf didDisconnectOnSocketError:error]; + }]; +} + + +- (void)socket:(KATSocketShuttle *)socket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean { + [self socketShuttleDisconnectCommon]; + + __weak typeof(self) weakSelf = self; + [self iterateOverStreamingDelegatesImplementingDelegateMethod:@selector(clientSocketDidDisconnect:) withBlock:^(id streamingDelegate) { + [streamingDelegate clientSocketDidDisconnect:weakSelf]; + }]; +} + + @end diff --git a/ADNKit/ANKGeneralParameters.h b/ADNKit/ANKGeneralParameters.h index 9d9f2a4..60b1105 100644 --- a/ADNKit/ANKGeneralParameters.h +++ b/ADNKit/ANKGeneralParameters.h @@ -18,6 +18,7 @@ @property (assign) BOOL includeMuted; @property (assign) BOOL includeDeleted; @property (assign) BOOL includeDirectedPosts; +@property (assign) BOOL includeInactive; @property (assign) BOOL includeMachine; @property (assign) BOOL includeStarredBy; @property (assign) BOOL includeReposters; diff --git a/ADNKit/ANKGeneralParameters.m b/ADNKit/ANKGeneralParameters.m index 982ee73..531d116 100644 --- a/ADNKit/ANKGeneralParameters.m +++ b/ADNKit/ANKGeneralParameters.m @@ -19,6 +19,7 @@ + (NSDictionary *)JSONToLocalKeyMapping { return [[super JSONToLocalKeyMapping] ank_dictionaryByAppendingDictionary:@{ @"include_muted": @"includeMuted", @"include_deleted": @"includeDeleted", + @"include_inactive": @"includeInactive", @"include_directed_posts": @"includeDirectedPosts", @"include_machine": @"includeMachine", @"include_starred_by": @"includeStarredBy", diff --git a/ADNKit/ANKGeolocation.h b/ADNKit/ANKGeolocation.h index 3ba3868..7272d2d 100644 --- a/ADNKit/ANKGeolocation.h +++ b/ADNKit/ANKGeolocation.h @@ -10,7 +10,6 @@ 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 #import diff --git a/ADNKit/ANKJSONRequestOperation.m b/ADNKit/ANKJSONRequestOperation.m index f6771b7..69759e6 100644 --- a/ADNKit/ANKJSONRequestOperation.m +++ b/ADNKit/ANKJSONRequestOperation.m @@ -37,4 +37,5 @@ - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *, id))su }]; } + @end diff --git a/ADNKit/ANKOEmbed.h b/ADNKit/ANKOEmbed.h index 311e7e0..6949cb3 100644 --- a/ADNKit/ANKOEmbed.h +++ b/ADNKit/ANKOEmbed.h @@ -10,9 +10,6 @@ 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 - - @interface ANKOEmbed : ANKResource @property (strong) NSString *type; diff --git a/ADNKit/ANKStreamContext.h b/ADNKit/ANKStreamContext.h new file mode 100644 index 0000000..86d6d49 --- /dev/null +++ b/ADNKit/ANKStreamContext.h @@ -0,0 +1,27 @@ +// +// ANKStreamContext.h +// ADNKit +// +// Created by Kolin Krewinkel on 6/8/13. +// Copyright (c) 2013 Afterwork Studios. All rights reserved. +// + +@class KATSocketShuttle; + +@interface ANKStreamContext : NSObject + +#pragma mark - Designated Initializer + ++ (instancetype)streamContextWithOperation:(ANKJSONRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate; +- (instancetype)initWithOperation:(ANKJSONRequestOperation *)operation identifier:(NSString *)identifier delegate:(id)delegate; + +#pragma mark - Internal + +@property (nonatomic, weak, readonly) id delegate; +@property (nonatomic, strong, readonly) ANKJSONRequestOperation *operation; + +#pragma mark - API Level + +@property (nonatomic, copy) NSString *identifier; + +@end diff --git a/ADNKit/ANKStreamContext.m b/ADNKit/ANKStreamContext.m new file mode 100644 index 0000000..f60b2a1 --- /dev/null +++ b/ADNKit/ANKStreamContext.m @@ -0,0 +1,37 @@ +// +// ANKStreamContext.m +// ADNKit +// +// Created by Kolin Krewinkel on 6/8/13. +// Copyright (c) 2013 Afterwork Studios. All rights reserved. +// + +#import "ANKStreamContext.h" + +@interface ANKStreamContext () + +@property (nonatomic, weak) id delegate; +@property (nonatomic, strong) ANKJSONRequestOperation *operation; + +@end + +@implementation ANKStreamContext + +#pragma mark - +#pragma mark Designated Initializer + ++ (instancetype)streamContextWithOperation:(ANKJSONRequestOperation *)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 { + if ((self = [super init])) { + self.operation = operation; + self.identifier = identifier; + self.delegate = delegate; + } + + return self; +} + +@end diff --git a/External/SocketShuttle b/External/SocketShuttle new file mode 160000 index 0000000..2e2f37a --- /dev/null +++ b/External/SocketShuttle @@ -0,0 +1 @@ +Subproject commit 2e2f37af20c6662f23a3140c0b933d0acd26c388