Skip to content

Linking.getInitialURL() for android #25675

@sajaddp

Description

@sajaddp

Hi,
On Android Linking.getInitialURL() has a problem and not return anything.
More precisely, none of the following logs are executed.

  Linking.getInitialURL().then((url) => {
      console.log('Initial url is: ' + url);
  }).catch(err => console.error('An error occurred', err));

but when i change https://github.com/facebook/react-native/blob/master/Libraries/Linking/Linking.js#L86-L92
to:

  getInitialURL(): Promise<?string> {
    return NativeLinking.getInitialURL();
  }

the problem was fixed.

React Native version:

System:
    OS: Linux 4.18 Ubuntu 18.04.2 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 582.26 MB / 15.50 GB
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 10.16.0 - /usr/bin/node
    Yarn: 1.17.3 - /usr/bin/yarn
    npm: 6.9.0 - /usr/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 28
      Build Tools: 28.0.3, 29.0.0, 29.0.1
      System Images: android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
      Android NDK: 20.0.5594570
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.3 => 0.60.3 
  npmGlobalPackages:
    react-native-cli: 2.0.1

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