react-native-url-preview
react-native-url-preview copied to clipboard
Youtube link not working
Youtube link not working, just showing youtube icon @maherzaidoune
Hi, Sorry I was quite busy and didn't look into the package for a while, I'll take a look at that in the next few days.
any update?
We're seeing this on iOS, but android is still working as expected
The same link, iOS: vs Android:
@maherzaidoune Adding a user agent to the reques header might solve this
headers: { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' }
Thanks to Josh
added as getLinkPreview(text, { imagesPropertyType: 'og', // fetches only open-graph images headers: { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', }, timeout: 1000, })
in
_node_modules/react-native-url-preview/index.js_