Amitbhave / flutter-simple-url-preview

Simple url preview package for flutter
https://pub.dev/packages/simple_url_preview
MIT License
32 stars 35 forks source link

Firebase Dynamic Link not previewing correctly #19

Open iqfareez opened 3 years ago

iqfareez commented 3 years ago

I have long url, say https://flutree.web.app/NWfLo and I shorten it, adding social metadata in app and it became https://flut.page.link/hcpa.

So, when tap the shorten link, it should redirect to the long link.

The problem is, this package returns a preview of the redirected link, not the Firebase Dynamic Link one.

My Code:

SimpleUrlPreview(
      url: 'https://flut.page.link/hcpa',
      bgColor: Colors.white,
),

Screenshot: This package: image

How I want it to look like: image

Amitbhave commented 3 years ago

@iqfareez yes, that is because we make HTTP call to the URL. Now as that URL redirects it to resultant URL, you will be shown resultant URL's preview..

iqfareez commented 3 years ago

I see. Understood but you have any idea I can get the preview of the dynamic link itself?

Amitbhave commented 3 years ago

@iqfareez can you tell me more about the requirement here? The screenshot that you have shared, is it the dynamic link's preview shown in whatsapp?

iqfareez commented 3 years ago

@Amitbhave I'm not really sure about the requirement. The docs not really helpful. The link preview (that I want) works on major social platform (WhatsApp, Twitter etc).

Dynamic Link social preview doc: https://firebase.google.com/docs/dynamic-links/link-previews