Skip to content

Commit f5fbcc3

Browse files
bllshttngfacebook-github-bot
authored andcommitted
Add newly recommended method for RCTLinkingManager due to deprecation
Summary: What existing problem does the pull request solve? Beginning in iOS9, Apple has deprecated `-application:openURL:sourceApplication:annotations:` `- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation NS_DEPRECATED_IOS(4_2, 9_0, "Please use application:openURL:options:") __TVOS_PROHIBITED;` This PR uses the newly recommended method: `- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)` while meanwhile, leaving the deprecated one for developers wishing to use the older `-application:openURL:sourceApplication:annotations:` for apps that support versions 8.x or less. Benefits will include: - [x] less warnings - [x] official deprecation should happen when iOS 11 is deployed - [x] TVOS support Closes react/react-native#13615 Differential Revision: D4987980 Pulled By: javache fbshipit-source-id: ae07715a55ca627860262a9c8cf7df1e3c5e752b
1 parent 533828a commit f5fbcc3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

RNTester/AppDelegate.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ - (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge
5656
fallbackResource:nil];
5757
}
5858

59+
- (BOOL)application:(UIApplication *)app
60+
openURL:(NSURL *)url
61+
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
62+
{
63+
return [RCTLinkingManager application:app openURL:url options:options];
64+
}
5965

6066
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
6167
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

0 commit comments

Comments
 (0)