Skip to content

Commit

Permalink
universal link fix
Browse files Browse the repository at this point in the history
fix for universal link not opening properly when app was closed with
back button, returning nil instead of the url

Signed-off-by: yenda <eric@status.im>
  • Loading branch information
yenda committed Apr 28, 2020
1 parent 5608d64 commit 35dd4b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/status_im/utils/universal_links/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit 35dd4b0

Please sign in to comment.