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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking.getInitialUrl() always returning null on Android #10323

Closed
hesyifei opened this issue Sep 23, 2020 · 4 comments
Closed

Linking.getInitialUrl() always returning null on Android #10323

hesyifei opened this issue Sep 23, 2020 · 4 comments
Assignees
Labels
Android Linking needs validation Issue needs to be validated

Comments

@hesyifei
Copy link
Contributor

hesyifei commented Sep 23, 2020

馃悰 Bug Report

Summary of Issue

await Linking.getInitialUrl() always returns null on Android.

Environment - output of expo diagnostics & the platform(s) you're targeting

  Expo CLI 3.27.8 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.11.0 - /usr/local/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.8 - /usr/local/bin/npm
    Managers:
      CocoaPods: 1.9.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6626763
      Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^39.0.0 => 39.0.2
      react: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-39.0.0.tar.gz => 0.63.2
    npmGlobalPackages:
      expo-cli: 3.27.8
    Expo Workflow: managed

Reproducible Demo

Steps to Reproduce

  1. Set up deep links following the step here https://docs.expo.io/workflow/linking/#deep-links-on-android (I am sure that my deep links are set up correctly because when the app is already opened, and I opened a link, Linking.addEventListener("url", shows the correct URL on Android).
  2. Add a button that alerts 锘匡豢await Linking.getInitialURL() when on click (with import * as Linking from "expo-linking";).
  3. Build the app and install it on Android.
  4. Fully exit the app.
  5. Click a link (deep links) that opens the app.
  6. Click the button.

Expected Behavior vs Actual Behavior

Expected Behavior: On both Android and iOS, 锘匡豢await Linking.getInitialURL() returns the link from which I opened the app.

Actual Behavior: It works correctly on iOS (锘匡豢await Linking.getInitialURL() returns the correct URL from which I opened the app. Additionally, it returns https://expo.io:443/... when I opened the app directly). But on Android, 锘匡豢await Linking.getInitialURL() always returns null no matter how I opened the app.

(I'm not 100% sure, but I think 锘匡豢await Linking.getInitialURL() worked on Android before I upgrade from SDK 38 to SDK 39 and built a new binary.)


This might be related to #8408. However, that issue states that

but sometimes it is not (in those cases it is null in the bare workflow and
https://expo.io:443/@stellablaze/stella-deeplinktest in the managed workflow).

However, I am using the managed workflow but the value is null.

@hesyifei hesyifei added the needs validation Issue needs to be validated label Sep 23, 2020
@willadamskeane
Copy link

willadamskeane commented Sep 29, 2020

I am having this problem as well, and I too believe it was working in SDK 38 and no longer in 39.

@brentvatne
Copy link
Member

@esamelson - perhaps related to expo-updates integration changes?

@chromacoma
Copy link

I can verify that Linking.getInitialUrl() is working in SDK 38, and is not working SDK 39.

@brentvatne
Copy link
Member

resolved. more info: #10464 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Linking needs validation Issue needs to be validated
Projects
None yet
Development

No branches or pull requests

5 participants