diff options
author | Vitaly Takmazov | 2017-10-18 01:48:34 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-10-18 01:48:34 +0300 |
commit | 2345989ce454342d8ac45077e2cd650d18744066 (patch) | |
tree | a1c529b1dadab49c76b82da80044cc4a80d32ec0 /Juick/APIClient.m | |
parent | 07afcd6f36629f30a495f2be47262c75c006712f (diff) |
device registration
Diffstat (limited to 'Juick/APIClient.m')
-rw-r--r-- | Juick/APIClient.m | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Juick/APIClient.m b/Juick/APIClient.m index d2356b5..beace7c 100644 --- a/Juick/APIClient.m +++ b/Juick/APIClient.m @@ -23,16 +23,13 @@ -(id)init { if (self = [super init]) { self.manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.juick.com"]]; + self.manager.requestSerializer = [AFJSONRequestSerializer new]; } return self; } -(void) pullNextFromPath:(NSString *)path params:(NSDictionary *) params callback:(void(^)(NSArray *, NSError *))callback { AFHTTPSessionManager *manager = [APIClient sharedClient].manager; - if ([[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] != nil) { - manager.requestSerializer = [AFJSONRequestSerializer serializer]; - [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] password:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.password"]]; - } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [manager GET:path parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { NSMutableArray *messages = [NSMutableArray new]; |