Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking.getInitialURL() not working in Android when the app is closed #26383

Closed
injas427 opened this issue Sep 9, 2019 · 1 comment
Closed
Labels
API: Linking Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@injas427
Copy link

injas427 commented Sep 9, 2019

I'm implementing deeplinking and when the app is closed then Linking.getInitialURL() isn't getting triggered. I'm facing this issue only in Android device and iOS is working fine. There is no issue when the app is in background. I've issue only when the app is closed. I've tried Linking.addEventListener("url", this.handleOpenURL) too. But issue still exists. Even Linking.addEventListener("url", this.handleOpenURL) isn't getting triggered in Android

React Native version:

System:
    OS: macOS 10.14.5
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 18.70 MB / 10.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 27, 28, 29
      Build Tools: 27.0.3, 28.0.3, 29.0.1
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-create-library: 3.1.2
    react-native-git-upgrade: 0.2.7

Expected Behavior

When the app is launched using the deep linking, then Linking.getInitialURL() should trigger

Example code snippet

Linking.getInitialURL().then(url => {
            this.navigate(url);
        }).catch(e => {
            console.warn(e.message);
        })

Neither then nor catch is triggered

@injas427
Copy link
Author

The issue solved after upgrading react-native to 0.60.5

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Linking Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants