React native 在React Native中获取页面预览
我试图让用户在react native中查看网页预览,就像在Facebook和其他应用程序上看到的链接预览一样。我做了一些研究 我见过一些为node提供函数的库,但它不适用于react-native(因为原来的cheerio.js不直接适用于react-native) 我也检查了oEmbed库,但它似乎也不起作用React native 在React Native中获取页面预览,react-native,cheerio,oembed,React Native,Cheerio,Oembed,我试图让用户在react native中查看网页预览,就像在Facebook和其他应用程序上看到的链接预览一样。我做了一些研究 我见过一些为node提供函数的库,但它不适用于react-native(因为原来的cheerio.js不直接适用于react-native) 我也检查了oEmbed库,但它似乎也不起作用 我想知道什么是获得网页预览的好方法,最后编写了一个小型库来完成这项工作。希望它对一些人有用 用法 样本返回 { url: 'https://www.google.com', l
我想知道什么是获得网页预览的好方法,最后编写了一个小型库来完成这项工作。希望它对一些人有用 用法 样本返回
{ url: 'https://www.google.com',
loadFailed: false,
title: 'Google',
description: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
contentType: 'text/html',
mediaType: 'website',
images: [ 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png' ],
videos: undefined,
audios: undefined }
最后写了一个小图书馆来完成这项工作。希望它对一些人有用 用法 样本返回
{ url: 'https://www.google.com',
loadFailed: false,
title: 'Google',
description: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
contentType: 'text/html',
mediaType: 'website',
images: [ 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png' ],
videos: undefined,
audios: undefined }
嘿,我一直在尝试使用你的库,但是当我尝试预览google.com时,我得到了一个未处理的承诺拒绝,任何其他页面都给出了未定义的数据,有什么想法吗?@ospfranco刚才有一个修复合并。你能再试一次吗?谢谢嘿,我一直在尝试使用你的库,但是当我尝试预览google.com时,我得到了一个未处理的承诺拒绝,任何其他页面都给出了未定义的数据,有什么想法吗?@ospfranco刚才有一个修复合并。你能再试一次吗?谢谢