Rich link preview in flutter

馋奶兔 提交于 2019-12-21 05:43:30

问题


Is it possible to make a preview from an url, grabbing all the information such as title, relevant texts and images. Is there any plugins I can use readily?

See this Native android plugin


回答1:


You can do this way :

1)Create a user at https://www.linkpreview.net

2)Generate an Access Key.

3)From your code call

 http://api.linkpreview.net/?key=<Your_API_KEY_From_Step_2>&q=https://www.google.com

It returns the meta tags in JSON as below :

 {"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.","image":"http:\/\/www.google.com\/images\/branding\/googlelogo\/1x\/googlelogo_white_background_color_272x92dp.png","url":"https:\/\/www.google.com\/"}

4) Use it in flutter widget to create a preview.




回答2:


Currently, there is not an open source library for flutter providing these meta tags for a website.

There is a temporal solution, using these freemium APIs for getting this information. The main drawback is that the requests are limited before paying.



来源:https://stackoverflow.com/questions/53408402/rich-link-preview-in-flutter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!