Skip to content

Commit

Permalink
Merge pull request #328 from ingridwang/master
Browse files Browse the repository at this point in the history
Fix deprecated iOS API stringByAddingPercentEscapesUsingEncoding:
  • Loading branch information
RonRadtke authored Jan 23, 2024
2 parents 341eeb4 + cc3db64 commit 070ce10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ - (void)presentOptionsMenu:(NSString *)uri
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject
{
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString * utf8uri = [uri stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
// NSURL * url = [[NSURL alloc] initWithString:uri];
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
Expand Down Expand Up @@ -818,7 +818,7 @@ - (void)presentOpenInMenu:(NSString *)uri
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject
{
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString * utf8uri = [uri stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
UIViewController *rootCtrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
Expand Down Expand Up @@ -848,7 +848,7 @@ - (void)presentPreview:(NSString *)uri
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject
{
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString * utf8uri = [uri stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
// NSURL * url = [[NSURL alloc] initWithString:uri];
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
Expand Down

0 comments on commit 070ce10

Please sign in to comment.