question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linking.getInitialUrl never returns

See original GitHub issue

System: OS: macOS Mojave 10.14.6 CPU: (8) x64 Intel® Core™ i7-3770 CPU @ 3.40GHz Memory: 30.13 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.15.1 - /usr/local/bin/node npm: 6.9.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0 IDEs: Android Studio: 3.4 AI-183.5429.30.34.5452501 Xcode: 11.0/11A420a - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2 npmGlobalPackages: react-native-cli: 2.0.1

React Native version:

0.61.2

Steps To Reproduce

  1. On simulator / emulator / live iOS or Android phone run the command await Linking.getInitialUrl().

this command never returns and just hands

Describe what you expected to happen:

I expected an event to be returned. This worked in previous versions. This is the 4th app i’ve updated to v61.2 and had this issue on.

Snack, code example, screenshot, or link to a repository:

async function someFn() {
     let event = await Linking.getInitialURL()
     // Next line of code never runs
     ....
}

Edit: I’ve confirmed that this only happens when using async await. Using .then.catch the event seems to return as normal.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:10

github_iconTop GitHub Comments

2reactions
nastaransamuicommented, Jul 16, 2020

still happen in “react-native”: “0.63.0”, and it’s always “null”

2reactions
joaocaccommented, Jan 28, 2020

Hi,

my team has discovered that debug mode is breaking something since we have the correct and expected behavior in a real iOS device.

Unfortunately, this is not true for android. In a real device, without debug, we are experiencing a return of null value when calling getInitialUrl for cold-start (app is not running).

I hope this can help, and if someone figures how to make it work for android, please post.

System: OS: macOS 10.15.2 CPU: (8) x64 Intel® Core™ i7-6700HQ CPU @ 2.60GHz Memory: 68.70 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 11.9.0 - /usr/local/bin/node npm: 6.5.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 IDEs: Xcode: 11.3/11C29 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2 npmGlobalPackages: react-native-cli: 2.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native linking getinitialurl() works even when I don't call ...
getInitialUrl () works but when next time I'm back to My screen l inking.getInitialUrl() return my web URL without open web page by...
Read more >
Linking · React Native
As of iOS 9, your app needs to provide the LSApplicationQueriesSchemes key inside Info.plist or canOpenURL will always return false. getInitialURL().
Read more >
Why is Linking.getInitialURL always returning null?-React Native
Coding example for the question Why is Linking. ... getInitialURL always returning null?- ... onNotificationOpenedApp is never triggered, messaging().
Read more >
Deep Linking Your React Native App | by Nader Dabit - Medium
In this post, I'll quickly walk through how to add deep linking to a React Native app for both ... Linking.getInitialURL().then(url => {...
Read more >
Understanding deep linking in React Native - LogRocket Blog
The deep linking question is as important today as ever before, ... *)options { return [RCTLinkingManager application:application ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found