I'm working on a project that requires generating short URLs for links with numerous query parameters. I've attempted to achieve this using Firebase Dynamic Links, but I've encountered some issues. I'm seeking your expertise to help resolve these problems.
I have a lengthy URL with several query parameters, like this:
https://example.com/p/h2b883?params1=value¶ms2=value¶ms3=225555
I want to replace this long URL with a shorter one using Firebase Dynamic Links.
Here's the code I've used:
httpService
.post(process.env.DYNAMIC_LINK_API, {
longDynamicLink:
'https://domain.page.link/?link=' +
'https://example.com/p/h2b883?params1=value¶ms2=value¶ms3=225555',
})
.toPromise()
.then((res) => {
return res.data.shortLink;
})
The code provided returned the following result:
{
shortLink: 'https://domain.page.link/vyLMGdsqdsqrjruVGA87',
warning: [
{
warningCode: 'UNRECOGNIZED_PARAM',
warningMessage: "Unrecognized param 'params2'. [https://firebase.google.com/docs/dynamic-links/create-manually#ddl_parameters]"
},
{
warningCode: 'UNRECOGNIZED_PARAM',
warningMessage: "Unrecognized param 'params3'. [https://firebase.google.com/docs/dynamic-links/create-manually#ddl_parameters]"
}
],
previewLink: 'https://domain.page.link/vyLMG2hdsqdqVGA87?d=1'
}
The issue is that it generates a URL perfectly, but only with one query parameter, specifically the first one. It disregards the others that are displayed in the warning message.
Thank you in advance for your assistance!