Last active
April 5, 2021 05:36
-
-
Save kaushal9678/a763e3288b7012a4350ed1e434c6e56f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LinkingOptions } from "@react-navigation/native"; | |
const config = { | |
screens: { | |
BottomTabs: { | |
path: 'bottom_tabs', | |
screens: { | |
Jobs: { | |
path: 'jobs', | |
exact: true, | |
screens: { | |
Search: { | |
path: 'search',///:keyword/:location | |
params: { | |
keyword: (keyword: string) => `${keyword}`, | |
location: (location: string) => `${location}` | |
}, | |
exact: true, | |
}, | |
JobDetail: { | |
path: 'users/:screamId/', | |
params: { | |
screamId: (screamId: string) => `${screamId}`, | |
}, | |
exact:true, | |
} | |
}, | |
}, | |
Resumes: { path: 'resume', exact: true }, | |
Profile: { path: 'profile', exact: true }, | |
Messages: { path: 'messages', exact: true, | |
screens:{ | |
MessageDetailView:{ | |
path:'messageDetail', | |
exact:true, | |
} | |
} }, | |
Settings: { | |
path: 'settings', exact: true, | |
GetHelp: { | |
path: 'getHelp', | |
exact: true, | |
}, | |
} | |
}, | |
} | |
}, | |
} | |
} | |
const linking = { | |
prefixes: ["https://www.kyadav.tech", "deeplink://"], | |
config, | |
}; | |
export default linking; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a
Linking configuration file
that will pass toNavigationContainer
.Here as you can see, I have defined
paths for every route
different from the page name because I have to make a path that I am getting in thedeep link
.So for example
I have a page
JobDetail
in myNavigationStack
but the deep link URL I get for this page isusers/:screamId/
. So, how our app will know that whenever I get a URL like thishttps://kyadav.tech/users/3242341dsf
in Mail or messages Safari browser etc. I have to send this to JobDetail Page.That's why we have to define our path like this
here we should pass
exact = true
because we only openjobDetail page
when the exact URL matches