Skip to content

Commit c6fc576

Browse files
committed
Remove redundant iOS 7 polyfill
1 parent 189e766 commit c6fc576

File tree

5 files changed

+7
-39
lines changed

5 files changed

+7
-39
lines changed

ios/IOS7Polyfill.h

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

ios/ReactNativeBlobUtil.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
A19B48241D98102400E6868A /* ReactNativeBlobUtilProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilProgress.m; sourceTree = "<group>"; };
4949
A1AAE2971D300E3E0051D11C /* ReactNativeBlobUtilReqBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilReqBuilder.h; sourceTree = "<group>"; };
5050
A1AAE2981D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilReqBuilder.m; sourceTree = "<group>"; };
51-
A1F950181D7E9134002A95A6 /* IOS7Polyfill.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IOS7Polyfill.h; sourceTree = "<group>"; };
5251
/* End PBXFileReference section */
5352

5453
/* Begin PBXFrameworksBuildPhase section */
@@ -76,7 +75,6 @@
7675
9FD8D3C126F1709A00009F35 /* ReactNativeBlobUtilFileTransformer.h */,
7776
A19B48241D98102400E6868A /* ReactNativeBlobUtilProgress.m */,
7877
A19B48231D98100800E6868A /* ReactNativeBlobUtilProgress.h */,
79-
A1F950181D7E9134002A95A6 /* IOS7Polyfill.h */,
8078
A1AAE2981D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m */,
8179
A1AAE2971D300E3E0051D11C /* ReactNativeBlobUtilReqBuilder.h */,
8280
A158F42E1D0539CE006FFD38 /* ReactNativeBlobUtilNetwork.h */,

ios/ReactNativeBlobUtilFS.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#import "ReactNativeBlobUtilFS.h"
1212
#import "ReactNativeBlobUtilConst.h"
1313
#import "ReactNativeBlobUtilFileTransformer.h"
14-
#import "IOS7Polyfill.h"
1514
@import AssetsLibrary;
1615

1716
#import <CommonCrypto/CommonDigest.h>
@@ -381,7 +380,7 @@ + (void) writeFile:(NSString *)path
381380

382381
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:path];
383382
NSData * content = nil;
384-
if([encoding RNFBContainsString:@"base64"]) {
383+
if([encoding containsString:@"base64"]) {
385384
content = [[NSData alloc] initWithBase64EncodedString:data options:0];
386385
}
387386
else if([encoding isEqualToString:@"uri"]) {

ios/ReactNativeBlobUtilReqBuilder.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#import "ReactNativeBlobUtilNetwork.h"
1212
#import "ReactNativeBlobUtilConst.h"
1313
#import "ReactNativeBlobUtilFS.h"
14-
#import "IOS7Polyfill.h"
1514

1615
#if __has_include(<React/RCTAssert.h>)
1716
#import <React/RCTLog.h>
@@ -151,7 +150,7 @@ +(void) buildOctetRequest:(NSDictionary *)options
151150

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

ios/ReactNativeBlobUtilRequest.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#import "ReactNativeBlobUtilFileTransformer.h"
1414
#import "ReactNativeBlobUtilReqBuilder.h"
1515

16-
#import "IOS7Polyfill.h"
1716
#import <CommonCrypto/CommonDigest.h>
1817

1918

@@ -222,20 +221,20 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
222221

223222
return;
224223
} else {
225-
self.isServerPush = [[respCType lowercaseString] RNFBContainsString:@"multipart/x-mixed-replace;"];
224+
self.isServerPush = [[respCType lowercaseString] containsString:@"multipart/x-mixed-replace;"];
226225
}
227226

228227
if(respCType)
229228
{
230229
NSArray * extraBlobCTypes = [options objectForKey:CONFIG_EXTRA_BLOB_CTYPE];
231230

232-
if ([respCType RNFBContainsString:@"text/"]) {
231+
if ([respCType containsString:@"text/"]) {
233232
respType = @"text";
234-
} else if ([respCType RNFBContainsString:@"application/json"]) {
233+
} else if ([respCType containsString:@"application/json"]) {
235234
respType = @"json";
236235
} else if(extraBlobCTypes) { // If extra blob content type is not empty, check if response type matches
237236
for (NSString * substr in extraBlobCTypes) {
238-
if ([respCType RNFBContainsString:[substr lowercaseString]]) {
237+
if ([respCType containsString:[substr lowercaseString]]) {
239238
respType = @"blob";
240239
respFile = YES;
241240
destPath = [ReactNativeBlobUtilFS getTempPath:taskId withExtension:nil];
@@ -293,7 +292,7 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
293292

294293
// if not set overwrite in options, defaults to TRUE
295294
BOOL overwrite = [options valueForKey:@"overwrite"] == nil ? YES : [[options valueForKey:@"overwrite"] boolValue];
296-
BOOL appendToExistingFile = [destPath RNFBContainsString:@"?append=true"];
295+
BOOL appendToExistingFile = [destPath containsString:@"?append=true"];
297296

298297
appendToExistingFile = !overwrite;
299298

0 commit comments

Comments
 (0)