Skip to content

[iOS] PushNotification with DeepLinks doesn't work when the app is close #48295

Description

@Javs-21

Description

when my iOS app receive push notification and when the app is close only opens in the home screen but never goes to the screen with the deeplink route, i always get url = null

//this way is to detect universal deep link
    Linking.getInitialURL()
      .then((url) => {
        console.log('DEEPLINK', url);
        if (url) {
          Linking.canOpenURL(url).then((supported) =>
            supported ? handleDeepLink(url) : null,
          );
        }
      })
      .catch((err) => {
        console.warn('An error occurred deepLink', err);
      });

but the curious thing is when the app is open or in the background it works perfectly, I have implemented documentation's setup with universal links

I am currently working with react native 0.73.11 and i updated to 0.74.6 and 0.75.1 because in your CHANGELOG mentions changes with Push Notification on iOS but the behavior is the same NO FIX

also looking on internet I haven't found any solution

Steps to reproduce

  1. close the iOS app
  2. send a push notification with deep links
  3. the app should open in the correct screen but only open at home screen

React Native Version

0.73.11

Affected Platforms

Runtime - iOS, Other (please specify)

Output of npx react-native info

System:
  OS: macOS 15.1.1
  CPU: (8) arm64 Apple M2
  Memory: 132.95 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.17.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.8.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.11.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK:
    API Levels:
      - "31"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 31.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-29 | Google Play ARM 64 v8a
      - android-32 | Google APIs ARM 64 v8a
      - android-32 | Google Play ARM 64 v8a
      - android-TiramisuPrivacySandbox | Google Play ARM 64 v8a
      - android-VanillaIceCream | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.3.6
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.1
    wanted: 0.75.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

not apply

Reproducer

none

Screenshots and Videos

none

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: LinkingNeeds: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.Platform: iOSiOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions