Skip to content

Commit

Permalink
Merge pull request #38 from taras-omelchuk/file-transfer
Browse files Browse the repository at this point in the history
FileTransfer plugin for 12.0 release
  • Loading branch information
volodymyrtaliar committed Nov 16, 2023
2 parents 093337a + 28590bd commit 624ea4b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ios/CDVFileTransferBD.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 BlackBerry Limited. All Rights Reserved.
Copyright (c) 2023 BlackBerry Limited. All Rights Reserved.
Some modifications to the original Cordova FileTransfer plugin
from https://github.com/apache/cordova-plugin-file-transfer/
Expand Down Expand Up @@ -453,7 +453,17 @@ - (void)download:(CDVInvokedUrlCommand*)command
targetURL = [[self.commandDelegate getCommandInstance:@"BBDFile"] fileSystemURLforLocalPath:target].url;

} else {

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_17_0 && defined(__IPHONE_17_0)
if (@available(iOS 17.0, *)) {
targetURL = [NSURL URLWithString:target encodingInvalidCharacters:NO];
} else {
// Fallback on earlier versions
targetURL = [NSURL URLWithString:target];
}
#else
targetURL = [NSURL URLWithString:target];
#endif

if (targetURL == nil) {
NSString* targetUrlTextEscaped = [target stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
Expand Down

0 comments on commit 624ea4b

Please sign in to comment.