From 35dd4b015b9a14c119acc5fce91614651a57f38b Mon Sep 17 00:00:00 2001 From: yenda Date: Tue, 14 Apr 2020 14:06:57 +0200 Subject: [PATCH] universal link fix fix for universal link not opening properly when app was closed with back button, returning nil instead of the url Signed-off-by: yenda --- src/status_im/utils/universal_links/core.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/status_im/utils/universal_links/core.cljs b/src/status_im/utils/universal_links/core.cljs index ed74d871c4..63e5571c2c 100644 --- a/src/status_im/utils/universal_links/core.cljs +++ b/src/status_im/utils/universal_links/core.cljs @@ -183,9 +183,13 @@ and handles incoming url if the app has been started by clicking on a link" [] (log/debug "universal-links: initializing") - (.. react/linking - (getInitialURL) - (then dispatch-url)) + ;;NOTE: https://github.com/facebook/react-native/issues/15961 + ;; workaround for getInitialURL returning null when opening the + ;; app from a universal link after closing it with the back button + (js/setTimeout #(.. react/linking + (getInitialURL) + (then dispatch-url)) + 200) (.. react/linking (addEventListener "url" url-event-listener)))