I am using firebase dynamic link service to utilize dynamic linking within a react native application. I created the domain as "xyz.page.link" (where "xyz" is, of course, a different string) from the firebase console and then I created the deep link as "xyz.page.link/resetforgottenPassword"
Now I want to send a query param along with the link such as: xyz.page.link/resetforgottenPassword?forgotPasswordCode=123
where the param forgotPasswordCode will change on each new link.
I am receiving the link but not with the dynamic query parameters. I have followed react native's official docs when setting up the linking for android and iOS platforms.
The behavior I am looking for is that after tapping on the link, I am redirected to the ResetPassword screen with the dynamic query parameters, which in this case are "forgotPasswordCode: 123"
Following is the code I have employed till now:
const linking = {
prefixes: ['https://xyz.page.link', 'xyz://'],
config: {
screens: {
ResetPassword: {
path: '/resetforgottenPassword',
},
},
},
};
const handleDynamicLink = (link) => {
// Handle dynamic link inside your own application
link.url === 'https://thriveonthespectrum.page.link/resetforgottenPassword') {
// ...navigate to your screen
}
};
the above function "handleDynamicLink" is inside App.js useEffect and linking is passed as prop to as instructed in the docs:
useEffect(() => {
const unsubscribe = dynamicLinks().onLink(handleDynamicLink);
}, []);