sur950 / any_link_preview

A flutter Plugin/Package to show the preview of any web link that starts with HTTP/HTTPS. Mostly useful for application that had chat.
MIT License
70 stars 70 forks source link

Error while using www. in the twitter url #35

Closed SatyamKr07 closed 1 year ago

SatyamKr07 commented 2 years ago

When i use the url "https://www.twitter.com" it is showing error. But when I am using url "https://twitter.com" (without www.) it is not showing error and I am able to see the link preview.

Here's the error : D/InsetsController(11360): show(ime(), fromIme=true) I/flutter (11360): Error while retrieving cache data => type 'Null' is not a subtype of type 'String' D/InputMethodManager(11360): showSoftInput() view=io.flutter.embedding.android.FlutterView{bfbbd4d VFE...... .F...... 0,0-1080,2154 #2 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT

woogi-kang commented 2 years ago

I am also having this error with notion url. any changes?

sur950 commented 2 years ago

Usually site builders will add a CName entry to their DNS which redirects to domain.com when someone hitswww.domain.com.

So logically there won't be any metadata for www. links, we generally replace www.domain.com with domain.com while fetching the meta info.

I forgot to do that. I will add that in my next release, till then you can do this replacement in your code before passing it to the preview component.

Simply find for host and if the host domain has www. then simply replace that with an empty string. And append https:// at the beginning. That should solve your issue.

Cheers, Suresh

harmeet-sidhu commented 1 year ago

I am having issues with all Twitter URLs whether they start with www. or not. I think the issue is on the Twitter side because metadata extractor websites also show errors for twitter URLs.

sur950 commented 1 year ago

I hope you found the RCA for the links that you are trying. I am closing the issue. Feel free to open a new one when you find this is an issue with our package while the same is loading in metadata extractor websites.