Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit dda1e2b

Browse files
committed
fix for ios7
1 parent 3d96100 commit dda1e2b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ios/CodePush/CodePushDownloadHandler.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "CodePush.h"
2+
#import <UIKit/UIKit.h>
23

34
@implementation CodePushDownloadHandler {
45
// Header chars used to determine if the file is a zip.
@@ -27,9 +28,15 @@ -(void)download:(NSString*)url {
2728
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request
2829
delegate:self
2930
startImmediately:NO];
30-
NSOperationQueue *delegateQueue = [NSOperationQueue new];
31-
delegateQueue.underlyingQueue = self.operationQueue;
32-
[connection setDelegateQueue:delegateQueue];
31+
if ([NSOperationQueue respondsToSelector:@selector(setUnderlyingQueue:)]) {
32+
NSOperationQueue *delegateQueue = [NSOperationQueue new];
33+
delegateQueue.underlyingQueue = self.operationQueue;
34+
[connection setDelegateQueue:delegateQueue];
35+
} else {
36+
[connection scheduleInRunLoop:[NSRunLoop mainRunLoop]
37+
forMode:NSDefaultRunLoopMode];
38+
}
39+
3340
[connection start];
3441
}
3542

ios/CodePush/CodePushTelemetryManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ + (NSString *)getVersionLabelFromStatusReportIdentifier:(NSString *)statusReport
114114

115115
+ (BOOL)isStatusReportIdentifierCodePushLabel:(NSString *)statusReportIdentifier
116116
{
117-
return statusReportIdentifier != nil && [statusReportIdentifier containsString:@":"];
117+
return statusReportIdentifier != nil && [statusReportIdentifier rangeOfString:@":"].location != NSNotFound;
118118
}
119119

120120
+ (void)recordDeploymentStatusReported:(NSString *)appVersionOrPackageIdentifier

0 commit comments

Comments
 (0)