diff --git a/versioned_docs/version-7.x/deep-linking.md b/versioned_docs/version-7.x/deep-linking.md index 6b6389861f..fe9eee2450 100755 --- a/versioned_docs/version-7.x/deep-linking.md +++ b/versioned_docs/version-7.x/deep-linking.md @@ -72,10 +72,7 @@ function App() { return ( Loading...}> - {/* content */} - - ); -} + {/* content */ ``` @@ -127,6 +124,28 @@ If your app is using [Universal Links](https://developer.apple.com/ios/universal } ``` +If you're using Swift, you'll need to add the following to your `AppDelegate.swift` file. You can find more information in the [React Native documentation](https://reactnative.dev/docs/linking?ios-language=swift). + +```swift +// Add this to your AppDelegate.swift file + +import React + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return RCTLinkingManager.application(application, open: url, options: options) + } + + // For Universal Links + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler) + } +} +``` + Now you need to add the scheme to your project configuration. The easiest way to do this is with the `uri-scheme` package by running the following: