Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a504629
Added SocketShuttle
Jun 9, 2013
f46eb22
Updated SocketShuttle
Jun 9, 2013
1ffba12
Fixes non-buildability.
kolinkrewinkel Jun 9, 2013
82543e9
Merge branch 'master' of github.com:joeldev/ADNKit into user-streams
kolinkrewinkel Jun 9, 2013
04702e4
Fix spacing
kolinkrewinkel Jun 9, 2013
ceab058
Completes stream context objects and conform with Joel's fucking codi…
kolinkrewinkel Jun 9, 2013
d8bf35f
Begin outlining stream protocols.
kolinkrewinkel Jun 9, 2013
2bcf3a8
Revise naming of request method.
kolinkrewinkel Jun 9, 2013
4a9fb8f
Add method in implementation body.
kolinkrewinkel Jun 9, 2013
d54afd7
Conform to coding style and add a semaphore.
kolinkrewinkel Jun 9, 2013
82b39f6
Begin attemps to connect.
kolinkrewinkel Jun 10, 2013
87fa46f
Make sure I\'m not missing anything.
kolinkrewinkel Jun 10, 2013
c4d621e
Remove frameworks from the list.
kolinkrewinkel Jun 10, 2013
b36fcfc
Spawns request and at least gets data back.
kolinkrewinkel Jun 10, 2013
3a01702
Switch to a set and add some basic handling code.
kolinkrewinkel Jun 10, 2013
a8dfb3b
Connects and disconnects. Warns of the current issue; SocketShuttle a…
kolinkrewinkel Jun 10, 2013
eada99a
Switch away from using the easily-broken property-delegate method; pa…
kolinkrewinkel Jun 11, 2013
50c92fe
Switch context objects to store delegates instead of blocks.
kolinkrewinkel Jun 12, 2013
47a49d2
Call back the delegate.
kolinkrewinkel Jun 12, 2013
818baee
Maybe we're getting somewhere...
kolinkrewinkel Jun 12, 2013
c45ba57
There, this fixes things and prevents hold ups and queue bullshit.
kolinkrewinkel Jun 12, 2013
41c5d67
Fixes header and removes unneeded properties and initializers.
kolinkrewinkel Jun 12, 2013
e39b8f8
Hey, it actually works now.
kolinkrewinkel Jun 15, 2013
ea19975
Minor revisions to structuring and verbiage.
kolinkrewinkel Jun 15, 2013
6668c32
Switch to just passing back the entirety of the JSON.
kolinkrewinkel Jun 15, 2013
5b9b561
Okay, now it actually messages the delegate. Yes.
kolinkrewinkel Jun 15, 2013
cb68b86
Minor revisions.
kolinkrewinkel Jun 16, 2013
6252e6d
Okay, so we\'ll have to identify the incoming JSON\'s type to parse it.
kolinkrewinkel Jun 17, 2013
6ea1bee
This should add parsing.
kolinkrewinkel Jun 17, 2013
f310af8
Remove debug log.
kolinkrewinkel Jun 17, 2013
8121bb8
Minor optimization.
kolinkrewinkel Jun 18, 2013
b960cd3
Implement all of the new KATSocketShuttleDelegate methods and send on…
kolinkrewinkel Jun 18, 2013
eed88e5
Add convenience method.
kolinkrewinkel Jun 18, 2013
c2fb149
Revise to match project coding style.
kolinkrewinkel Jun 18, 2013
8875e90
Add some convenience methods for getting the right delegates and gene…
kolinkrewinkel Jun 18, 2013
e191178
Get your types right, idiot.
kolinkrewinkel Jun 18, 2013
040a21a
Concurrency = no.
kolinkrewinkel Jun 18, 2013
116d613
Adds a convenience method and sends the rest of the methods.
kolinkrewinkel Jun 19, 2013
af68b08
>_>
kolinkrewinkel Jun 19, 2013
b06fc83
More minor cleanup
kolinkrewinkel Jun 19, 2013
b0b2c3d
Transfers over the completion block. Kinda critical, and really it sh…
kolinkrewinkel Jun 21, 2013
9dfd167
This is ghetto, but it will work.
kolinkrewinkel Jun 21, 2013
b1f6537
Leftovers or something.
kolinkrewinkel Jul 25, 2013
66bad7a
Add stream contexts to combination-AFNetworking target.
kolinkrewinkel Jul 27, 2013
e545d26
Add SocketShuttle to the AFNetworking-hybrid target.
kolinkrewinkel Jul 27, 2013
a3d0a64
Fixes the issue with freezing queues (but with a hacky approach) and …
kolinkrewinkel Jul 27, 2013
1891858
Merge master into user-streams.
kolinkrewinkel Jul 27, 2013
8af576b
Fixes non-building status.
kolinkrewinkel Jul 27, 2013
6ea1d9b
Code cleanup.
kolinkrewinkel Jul 27, 2013
8007c31
Fix a compiler warning over ANKOEmbed... which was out of nowhere.
kolinkrewinkel Jul 27, 2013
ea38572
Fix kv coding error. Test things first kolin
kolinkrewinkel Jul 29, 2013
3e706c4
...And again with the KV coding.
kolinkrewinkel Jul 29, 2013
5770c89
Switch to use the constant.
kolinkrewinkel Jul 29, 2013
99bec30
Hmm...this might actually be fixed.
kolinkrewinkel Jul 30, 2013
9bd1d4d
...Fixes the never-resuming operation.
kolinkrewinkel Jul 31, 2013
f01c302
This adds reconnect support. Both SocketShuttle and SocketRocket have…
kolinkrewinkel Aug 1, 2013
3b19b97
..Maybe this is the trick?
kolinkrewinkel Aug 1, 2013
216a6ff
Begin adding reachability-connection-type flags
kolinkrewinkel Aug 1, 2013
7db9944
Fixes non-building status with AFNetworking-bundled target.
kolinkrewinkel Aug 1, 2013
c4107c5
Prevents operations from stalling out forever.
kolinkrewinkel Aug 2, 2013
b8193c3
...now it works. removed the dispatch_async stuff in the socketshuttl…
kolinkrewinkel Aug 2, 2013
3ab25f6
Use the correct developer frameworks variable so that builds work pro…
tonyarnold Aug 14, 2013
13e60f2
Update SocketShuttle submodule to use HTTPS URL
tonyarnold Aug 14, 2013
b69cf62
Re-enable OS X support
tonyarnold Aug 14, 2013
b1fbe69
Update submodule reference to latest SocketShuttle changes that inclu…
tonyarnold Aug 14, 2013
449e1ed
Make missing project headers public in the framework
tonyarnold Aug 14, 2013
370b56c
Merge pull request #58 from tonyarnold/user-streams
kolinkrewinkel Aug 14, 2013
7a7c520
Allow multiple streaming operations to be started
mthurman Jan 26, 2014
ab36edb
Add meta params applicable to user streams
mthurman Jan 26, 2014
cc0499f
Merge pull request #71 from mthurman/multiple-user-streams
berg Jan 30, 2014
e84083c
Merge pull request #72 from mthurman/user-streams-meta
berg Jan 30, 2014
ed17977
ADNKit-OSX had the iOS SocketShuttle as a target dependency, fixed.
tonyarnold Feb 18, 2014
a6feb2e
NSString+ANKAdditions header should be public
tonyarnold Feb 18, 2014
9aae7dd
Merge pull request #75 from tonyarnold/user-streams
kolinkrewinkel Feb 18, 2014
59be43a
Add support for the inactive field on Channel objects
tonyarnold Feb 27, 2014
03de25b
Merge pull request #78 from tonyarnold/user-streams-inactive-field
berg Apr 2, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
405 changes: 383 additions & 22 deletions ADNKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions ADNKit/ADNKit-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>

#define _AFNETWORKING_PIN_SSL_CERTIFICATES_

#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <MobileCoreServices/MobileCoreServices.h>
#endif
Expand Down
4 changes: 2 additions & 2 deletions ADNKit/ADNKit-iOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ADNKit/ANKOAuthViewController.h>
#import <ADNKit/ANKUsernamePasswordAuthViewController.h>
#import "ANKOAuthViewController.h"
#import "ANKUsernamePasswordAuthViewController.h"
7 changes: 7 additions & 0 deletions ADNKit/ANKAPIResponseMeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion ADNKit/ANKAPIResponseMeta.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"}];
}


Expand Down
1 change: 1 addition & 0 deletions ADNKit/ANKAnnotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "ANKPlace.h"
#import "ANKChannel.h"
#import "ANKGeolocation.h"
#import "ANKOEmbed.h"


@interface ANKAnnotation ()
Expand Down
1 change: 1 addition & 0 deletions ADNKit/ANKChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion ADNKit/ANKChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"}];
}


Expand Down
2 changes: 1 addition & 1 deletion ADNKit/ANKClient+ANKRequestsAPI.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright (c) 2013, Joel Levin
All rights reserved.

Expand Down
32 changes: 31 additions & 1 deletion ADNKit/ANKClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NSObject>

@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);


Expand All @@ -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 -
Expand Down Expand Up @@ -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<ANKStreamingDelegate>)delegate;

#pragma mark -
#pragma mark Operation Queues
Expand Down
Loading