Skip to content

Commit e4a545a

Browse files
author
Abraham Przewodnik
committed
Remove IOS7 polyfill for containsString
1 parent 9110ef2 commit e4a545a

File tree

5 files changed

+9
-41
lines changed

5 files changed

+9
-41
lines changed

ios/IOS7Polyfill.h

Lines changed: 0 additions & 27 deletions
This file was deleted.

ios/RNFetchBlob.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
A19B48241D98102400E6868A /* RNFetchBlobProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFetchBlobProgress.m; sourceTree = "<group>"; };
4646
A1AAE2971D300E3E0051D11C /* RNFetchBlobReqBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFetchBlobReqBuilder.h; sourceTree = "<group>"; };
4747
A1AAE2981D300E4D0051D11C /* RNFetchBlobReqBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFetchBlobReqBuilder.m; sourceTree = "<group>"; };
48-
A1F950181D7E9134002A95A6 /* IOS7Polyfill.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IOS7Polyfill.h; sourceTree = "<group>"; };
4948
/* End PBXFileReference section */
5049

5150
/* Begin PBXFrameworksBuildPhase section */
@@ -71,7 +70,6 @@
7170
children = (
7271
A19B48241D98102400E6868A /* RNFetchBlobProgress.m */,
7372
A19B48231D98100800E6868A /* RNFetchBlobProgress.h */,
74-
A1F950181D7E9134002A95A6 /* IOS7Polyfill.h */,
7573
A1AAE2981D300E4D0051D11C /* RNFetchBlobReqBuilder.m */,
7674
A1AAE2971D300E3E0051D11C /* RNFetchBlobReqBuilder.h */,
7775
A158F42E1D0539CE006FFD38 /* RNFetchBlobNetwork.h */,

ios/RNFetchBlobFS.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#import "RNFetchBlob.h"
1111
#import "RNFetchBlobFS.h"
1212
#import "RNFetchBlobConst.h"
13-
#import "IOS7Polyfill.h"
1413
@import AssetsLibrary;
1514

1615
#import <CommonCrypto/CommonDigest.h>
@@ -375,7 +374,7 @@ + (void) writeFile:(NSString *)path
375374

376375
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:path];
377376
NSData * content = nil;
378-
if([encoding RNFBContainsString:@"base64"]) {
377+
if([encoding containsString:@"base64"]) {
379378
content = [[NSData alloc] initWithBase64EncodedString:data options:0];
380379
}
381380
else if([encoding isEqualToString:@"uri"]) {

ios/RNFetchBlobReqBuilder.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#import "RNFetchBlobNetwork.h"
1212
#import "RNFetchBlobConst.h"
1313
#import "RNFetchBlobFS.h"
14-
#import "IOS7Polyfill.h"
1514

1615
#if __has_include(<React/RCTAssert.h>)
1716
#import <React/RCTLog.h>
@@ -117,7 +116,7 @@ +(void) buildOctetRequest:(NSDictionary *)options
117116
orgPath = [RNFetchBlobFS getPathOfAsset:orgPath];
118117
if([orgPath hasPrefix:AL_PREFIX])
119118
{
120-
119+
121120
[RNFetchBlobFS readFile:orgPath encoding:nil onComplete:^(id content, NSString* code, NSString * err) {
122121
if(err != nil)
123122
{
@@ -131,7 +130,7 @@ +(void) buildOctetRequest:(NSDictionary *)options
131130
onComplete(request, [((NSData *)content) length]);
132131
}
133132
}];
134-
133+
135134
return;
136135
}
137136
size = [[[NSFileManager defaultManager] attributesOfItemAtPath:orgPath error:nil] fileSize];
@@ -150,7 +149,7 @@ +(void) buildOctetRequest:(NSDictionary *)options
150149

151150
__block NSString * cType = [[self class]getHeaderIgnoreCases:@"content-type" fromHeaders:mheaders];
152151
// when content-type is application/octet* decode body string using BASE64 decoder
153-
if([[cType lowercaseString] hasPrefix:@"application/octet"] || [[cType lowercaseString] RNFBContainsString:@";base64"])
152+
if([[cType lowercaseString] hasPrefix:@"application/octet"] || [[cType lowercaseString] containsString:@";base64"])
154153
{
155154
__block NSString * ncType = [[cType stringByReplacingOccurrencesOfString:@";base64" withString:@""]stringByReplacingOccurrencesOfString:@";BASE64" withString:@""];
156155
if([mheaders valueForKey:@"content-type"] != nil)

ios/RNFetchBlobRequest.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#import "RNFetchBlobConst.h"
1313
#import "RNFetchBlobReqBuilder.h"
1414

15-
#import "IOS7Polyfill.h"
1615
#import <CommonCrypto/CommonDigest.h>
1716

1817

@@ -214,20 +213,20 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
214213

215214
return;
216215
} else {
217-
self.isServerPush = [[respCType lowercaseString] RNFBContainsString:@"multipart/x-mixed-replace;"];
216+
self.isServerPush = [[respCType lowercaseString] containsString:@"multipart/x-mixed-replace;"];
218217
}
219218

220219
if(respCType)
221220
{
222221
NSArray * extraBlobCTypes = [options objectForKey:CONFIG_EXTRA_BLOB_CTYPE];
223222

224-
if ([respCType RNFBContainsString:@"text/"]) {
223+
if ([respCType containsString:@"text/"]) {
225224
respType = @"text";
226-
} else if ([respCType RNFBContainsString:@"application/json"]) {
225+
} else if ([respCType containsString:@"application/json"]) {
227226
respType = @"json";
228227
} else if(extraBlobCTypes) { // If extra blob content type is not empty, check if response type matches
229228
for (NSString * substr in extraBlobCTypes) {
230-
if ([respCType RNFBContainsString:[substr lowercaseString]]) {
229+
if ([respCType containsString:[substr lowercaseString]]) {
231230
respType = @"blob";
232231
respFile = YES;
233232
destPath = [RNFetchBlobFS getTempPath:taskId withExtension:nil];
@@ -285,7 +284,7 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
285284

286285
// if not set overwrite in options, defaults to TRUE
287286
BOOL overwrite = [options valueForKey:@"overwrite"] == nil ? YES : [[options valueForKey:@"overwrite"] boolValue];
288-
BOOL appendToExistingFile = [destPath RNFBContainsString:@"?append=true"];
287+
BOOL appendToExistingFile = [destPath containsString:@"?append=true"];
289288

290289
appendToExistingFile = !overwrite;
291290

0 commit comments

Comments
 (0)