Skip to content

Need to update documentation for setting up deep links for iOS in RN 0.77 #1425

Open

Description

@davepaiva

Current behavior

Since the newer versions of RN comes with Swift for iOS , the documentation needs to be updated
https://reactnavigation.org/docs/deep-linking/#setup-on-ios

I dont know enough of Swift to do it , currently stuck.

Expected behavior

need swift code samples

Reproduction

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-drawer-layout
  • react-native-tab-view

Environment

Activity

  1. github-actions commented on Mar 28, 2025

    @github-actions

    Couldn't find version numbers for the following packages in the issue:

    • @react-navigation/native

    Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

  2. github-actions commented on Mar 28, 2025

    @github-actions

    Hey @davepaiva! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro, or the provided repro is not valid (e.g. broken link, private repo, code doesn't run etc.).

    The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

    You can provide a repro using any of the following:

    A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

    Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

    You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a valid repro.

  3. davepaiva commented on Apr 4, 2025

    @davepaiva
    Author

    pasting the solution here if anyone needs:

     // Add the header at the top of the file:
    import React
    
    // Add this inside `AppDelegate`
    internal func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
      return RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
    }
    
  4. dougdrury commented on Apr 7, 2025

    @dougdrury

    @davepaiva - Thanks for putting this out there, but Xcode does not seem to like it. It is saying it needs an override keyword and also cannot find restorationHandler.

    I do have the import React line with the other imports.

    Xcode Version 16.2 (16C5032a).
    iOS SDK 18.1.
    RN Version: 0.78.2.
    @react-navigation/native: ^6.1.17
    @react-navigation/native-stack: ^6.9.26

    Image Any thoughts as to why this would be? Thank you for any input.
  5. a613 commented on Apr 8, 2025

    @a613

    Seems like this is good or close to good (RN 0.77 is crashing with SIGABRT at startup, but the build succeeds):

      override func application(
        _ app: UIApplication,
        open url: URL,
        options: [UIApplication.OpenURLOptionsKey: Any] = [:]
      ) -> Bool {
        return RCTLinkingManager.application(app, open: url, options: options)
      }
    
      override func application(
        _ application: UIApplication,
        continue userActivity: NSUserActivity,
        restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
      ) -> Bool {
        return RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
      }
  6. dougdrury commented on Apr 8, 2025

    @dougdrury

    Cool. I was able to build and run with @a613 update. Now to test deep linking. Thank you!

  7. Shasikhan commented on Apr 24, 2025

    @Shasikhan

    what is the solution?

  8. Shasikhan commented on Apr 24, 2025

    @Shasikhan

    So here is the official RN docs for Swift: Deep Linking

  9. moustaouiSalaheddine commented on Jul 8, 2025

    @moustaouiSalaheddine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions