Linking.getInitialUrl never returns
See original GitHub issueSystem: 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
- 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:
- Created 4 years ago
- Reactions:4
- Comments:10
Top GitHub Comments
still happen in “react-native”: “0.63.0”, and it’s always “null”
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