Get long url from any short or redirect url

1.2k Views Asked by At

I am using React native and i have some short url's or redirect urls to some other url. So i want to get destination url. So check with two libraries

https://www.npmjs.com/package/tall
https://www.npmjs.com/package/react-native-google-shortener

None worked for me as tall is using node. And 2nd one is old and giving me an error. So anyone have a solution to do it.

1

There are 1 best solutions below

5
Adil kasbaoui On BEST ANSWER

you don't need a library to do that, you can simply use XMLHttpRequest.

i created a snack : snack,

but only work with redirect URL not shorted ones like : shorturl.at/egzG4

Hope this helps you.