4

I have requirement of sharing the product link with title, description and image on social media.

I tried fire-base dynamic links for deep-linking it works perfectly fine but I was not able to get the image while sharing the link in Whats-App. As we want this to work in whatsapp so please have any idea for firebase dynamic link than I prefer that.

I have also used the Open graph(og) tags and twitter card for twitter and try to redirect to app using java script.Below is java-script.

    var now = new Date().valueOf();
    setTimeout(function () {
        if (new Date().valueOf() - now > 600) return;
        RedirectToMarket();
    }, 500);    
    var deepUrl = getParameterByName('deepUrl');
    var url = encodeURI(deepUrl);
    if (url) {
        window.location = url;
    }

The script helps to redirect to app when app is installed but when app is not install in mobile it not redirect to play-store or app-store.

Need any other solution if have.

KENdi
  • 7,576
  • 2
  • 16
  • 31
Shah Harsh
  • 131
  • 1
  • 6

2 Answers2

9

The problem was that the image criteria of the image on WhatsApp. The image(JPG or PNG) must have a size of less than 300KB and a minimum dimension of 300 x 200 pixel.

Shah Harsh
  • 131
  • 1
  • 6
3

For preview image check out FIRDynamicLinkSocialMetaTagParameters in this example iOS code https://firebase.google.com/docs/dynamic-links/ios/create . Using this class you can provide for the link text, description and image that will be rendered in preview. These data is rendered while link is posted in iMessage and Facebook. WhatsApp should work with this data as well.

About JavaScript redirect: I recommend not using JS redirect or server redirect while navigating to dynamic links. iOS has strict rules requiring user interaction to activate the App via Universal Link. When doing JS redirect Universal Links will not be engaged. What you trying to achieve by using JS redirect?

Oleksiy Ivanov
  • 2,454
  • 15
  • 21
  • No WhatsApp not work with the firebase dynamic link.It only show the link as we share with out title,description and image but if we share on FB,twitter,linkedin,etc then it show image title and description. With Javascript we can redirect to iOS app if it is installed but not to AppStore if not, same for the android. – Shah Harsh Jul 19 '17 at 04:55
  • Can you share dynamic link you are using? Feel free to reply here or email to oleksiyi _at_ google.com – Oleksiy Ivanov Jul 19 '17 at 17:22
  • Sorry cannot share the link.But I can tell you that the firebase dynamic link was properly working it was the WhatsApp image criteria due to which the image was not previewing in WhatsApp. – Shah Harsh Jul 20 '17 at 06:18
  • Thanks Shah. I created bug for this issue in Firebase internal tracking system. Do not have ETA when this will be fixed, but server side engineers working on it. Feel free to open Firebase support ticket or ask question here if you have any issues. – Oleksiy Ivanov Jul 20 '17 at 19:14