From f8819959ae8c1c46c731d78d53eeba161b654edf Mon Sep 17 00:00:00 2001 From: ocleo1 Date: Tue, 28 Nov 2017 21:37:33 -0500 Subject: [PATCH] Eliminate openURL deprecated error if deployment target is 10.0 or above --- Libraries/LinkingIOS/RCTLinkingManager.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Libraries/LinkingIOS/RCTLinkingManager.m b/Libraries/LinkingIOS/RCTLinkingManager.m index 51a2896cfe4943..59c0c1315842eb 100644 --- a/Libraries/LinkingIOS/RCTLinkingManager.m +++ b/Libraries/LinkingIOS/RCTLinkingManager.m @@ -89,12 +89,13 @@ - (void)handleOpenURLNotification:(NSNotification *)notification resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) { - BOOL opened = [RCTSharedApplication() openURL:URL]; - if (opened) { - resolve(nil); - } else { - reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil); - } + [RCTSharedApplication() openURL:URL options:@{} completionHandler:^(BOOL success) { + if (success) { + resolve(nil); + } else { + reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil); + } + }]; } RCT_EXPORT_METHOD(canOpenURL:(NSURL *)URL