diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-21 16:07:26 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-21 16:07:26 -0600 |
commit | ed146a582c140b9a472298390dafbc07bd06cf60 (patch) | |
tree | bd540e4a84244fdbdbdf5fde412fc4a179b6dae5 /src/App.native.tsx | |
parent | 39058cd36a9839df0e0c7e30ba486a09e30f169c (diff) | |
download | voidsky-ed146a582c140b9a472298390dafbc07bd06cf60.tar.zst |
Add web linking and proper share controls
Diffstat (limited to 'src/App.native.tsx')
-rw-r--r-- | src/App.native.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/App.native.tsx b/src/App.native.tsx index 3d3e5f1b0..65a77c3dc 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -1,5 +1,6 @@ import 'react-native-url-polyfill/auto' import React, {useState, useEffect} from 'react' +import {Linking} from 'react-native' import {RootSiblingParent} from 'react-native-root-siblings' import {GestureHandlerRootView} from 'react-native-gesture-handler' import SplashScreen from 'react-native-splash-screen' @@ -24,6 +25,14 @@ function App() { .then(store => { setRootStore(store) SplashScreen.hide() + Linking.getInitialURL().then((url: string | null) => { + if (url) { + store.nav.handleLink(url) + } + }) + Linking.addEventListener('url', ({url}) => { + store.nav.handleLink(url) + }) }) }, []) |