react-native-url-preview icon indicating copy to clipboard operation
react-native-url-preview copied to clipboard

Youtube link not working

Open aneena-thomas opened this issue 3 years ago • 6 comments

Youtube link not working, just showing youtube icon @maherzaidoune

aneena-thomas avatar Jun 24 '21 10:06 aneena-thomas

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.

maherzaidoune avatar Jun 29 '21 09:06 maherzaidoune

any update?

Amazing1974 avatar Jul 14 '21 23:07 Amazing1974

We're seeing this on iOS, but android is still working as expected

ahaverty avatar Sep 17 '21 08:09 ahaverty

The same link, iOS: image vs Android: image

ahaverty avatar Sep 17 '21 09:09 ahaverty

@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' }

Joshmatjjen avatar Jan 19 '22 08:01 Joshmatjjen

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_

sujatha2016 avatar Mar 01 '22 05:03 sujatha2016