Skip to content

Commit

Permalink
Version 2.13.7 (#151)
Browse files Browse the repository at this point in the history
* Initializing LDClient in polling mode no longer blocks the calling thread
  • Loading branch information
arun251 authored Oct 16, 2018
1 parent 8db3591 commit 1159f5e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [2.13.7] - 2018-10-15
### Changed
- Initializing LDClient in polling mode no longer blocks the calling thread.

## [2.13.6] - 2018-10-05
### Fixed
- LDClient's `updateUser` did not attempt to retrieve the new user's cached flag values.
Expand Down
2 changes: 1 addition & 1 deletion Darkly/DarklyConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#import "DarklyConstants.h"

NSString * const kClientVersion = @"2.13.6";
NSString * const kClientVersion = @"2.13.7";
NSString * const kBaseUrl = @"https://app.launchdarkly.com";
NSString * const kEventsUrl = @"https://mobile.launchdarkly.com";
NSString * const kStreamUrl = @"https://clientstream.launchdarkly.com";
Expand Down
10 changes: 0 additions & 10 deletions Darkly/LDRequestManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ -(void)performFlagRequest:(NSURLRequest*)request completionHandler:(void (^)(NSD
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration:configuration delegate:nil delegateQueue:nil];

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

NSURLSessionDataTask *dataTask = [defaultSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if ([response isUnauthorizedHTTPResponse]) {
//Calling postNotification on the task completion handler thread causes the LDRequestManager to hang in some situations. Dispatching the postNotification onto the notificationQueue avoids that hang.
Expand All @@ -133,12 +131,9 @@ -(void)performFlagRequest:(NSURLRequest*)request completionHandler:(void (^)(NSD
if (completionHandler) {
completionHandler(data, response, error);
}
dispatch_semaphore_signal(semaphore);
}];

[dataTask resume];

dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
}

-(void)performEventRequest:(NSArray *)eventDictionaries {
Expand All @@ -160,8 +155,6 @@ -(void)performEventRequest:(NSArray *)eventDictionaries {

DEBUG_LOGX(@"RequestManager syncing events to server");

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

NSURLSession *defaultSession = [NSURLSession sharedSession];
NSString *requestUrl = [eventsUrl stringByAppendingString:kEventUrl];

Expand All @@ -183,16 +176,13 @@ -(void)performEventRequest:(NSArray *)eventDictionaries {
});
}

dispatch_semaphore_signal(semaphore);
dispatch_async(dispatch_get_main_queue(), ^{
BOOL processedEvents = !error;
[self.delegate processedEvents:processedEvents jsonEventArray:eventDictionaries responseDate:[response headerDate]];
});
}];

[dataTask resume];

dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
}

#pragma mark - requests
Expand Down
4 changes: 2 additions & 2 deletions LaunchDarkly.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LaunchDarkly"
s.version = "2.13.6"
s.version = "2.13.7"
s.summary = "iOS SDK for LaunchDarkly"

s.description = <<-DESC
Expand All @@ -23,7 +23,7 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = "9.0"
s.osx.deployment_target = '10.10'

s.source = { :git => "https://github.com/launchdarkly/ios-client.git", :tag => "2.13.6" }
s.source = { :git => "https://github.com/launchdarkly/ios-client.git", :tag => "2.13.7" }

s.source_files = 'Darkly/**/*.{h,m}'

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $ brew install carthage
To integrate LaunchDarkly into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "launchdarkly/ios-client" "2.13.6"
github "launchdarkly/ios-client" "2.13.7"
```

Run `carthage` to build the framework and drag the built `Darkly.framework` into your Xcode project.
Expand All @@ -61,7 +61,7 @@ Quick setup

1. Add the SDK to your `Podfile`:

pod 'LaunchDarkly', '2.13.6'
pod 'LaunchDarkly', '2.13.7'

2. Import the LaunchDarkly client:

Expand Down

0 comments on commit 1159f5e

Please sign in to comment.