Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate NewNode #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ target "Push" do
pod 'DateTools', :path => '~/Repositories/DateTools'
pod 'YAML-Framework'
pod 'HTMLKit', '~> 0.9'
pod 'NewNode'
end
14 changes: 10 additions & 4 deletions Push/NotificationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2016 OCCRP. All rights reserved.
//

@import NewNode;

#import "NotificationManager.h"
#import "SettingsManager.h"
#import "LanguageManager.h"
Expand Down Expand Up @@ -111,8 +113,10 @@ - (void)registerWithPushServer:(NSData*)devToken andLanguage:(NSString*)language
@"sandbox": SANDBOX};

NSMutableURLRequest * request = [[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlString parameters:parameters error:nil];

AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];

NSURLSessionConfiguration *config = NSURLSessionConfiguration.defaultSessionConfiguration;
config.connectionProxyDictionary = NewNode.connectionProxyDictionary;
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:config];

manager.responseSerializer = [AFHTTPResponseSerializer serializer];

Expand Down Expand Up @@ -141,8 +145,10 @@ - (void)unRegisterWithPushServerWithLanguage:(NSString*)languageShortCode

NSMutableURLRequest * request = [[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlString parameters:parameters error:nil];

AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];

NSURLSessionConfiguration *config = NSURLSessionConfiguration.defaultSessionConfiguration;
config.connectionProxyDictionary = NewNode.connectionProxyDictionary;
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:config];

manager.responseSerializer = [AFHTTPResponseSerializer serializer];

NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
Expand Down
7 changes: 6 additions & 1 deletion Push/PushSyncManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2015 OCCRP. All rights reserved.
//

@import NewNode;

#import "PushSyncManager.h"
#import "SettingsManager.h"
#import "LanguageManager.h"
Expand Down Expand Up @@ -37,7 +39,10 @@ + (PushSyncManager *)sharedManager {

- (instancetype)init
{
return [super initWithBaseURL:[NSURL URLWithString:[SettingsManager sharedManager].pushUrl]];
NSURLSessionConfiguration *config = NSURLSessionConfiguration.defaultSessionConfiguration;
config.connectionProxyDictionary = NewNode.connectionProxyDictionary;
return [super initWithBaseURL:[NSURL URLWithString:[SettingsManager sharedManager].pushUrl]
sessionConfiguration:config];
}

// Returns the current cached array, and then does another call.
Expand Down