0

I am generating a FirebaseDynamicLink using below code:

DynamicLink baseDynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
                .setLink(BASE_URI)
                .setDynamicLinkDomain(DYNAMIC_LINK_DOMAIN)
                .setAndroidParameters(new DynamicLink.AndroidParameters.Builder(BuildConfig.APPLICATION_ID).setMinimumVersion(MIN_VERSION).build())
                .buildDynamicLink();
        baseDynamicLinkUri = baseDynamicLink.getUri();

I am using below code to share it to other apps such as WhatsApp, gmail, etc:

public void shareDeepLinkWithExtraText(String extraText) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(Intent.EXTRA_SUBJECT, "Firebase Deep Link");

        intent.putExtra(Intent.EXTRA_TEXT,extraText);

        startActivity(intent);
    }

The generated link looks like this: Check this out at my app - https://tvh54.app.goo.gl?amv=10&apn=mydomain.myapp&link=http%3A%2F%2Fwww.mydomain.co.in%2F.

Now the problem is - when shared on gmail, the complete link is tappable, however when shared on WhatsApp the link is tappable in parts. So https://tvh54.app.goo.gl is tappable, 2Fwww.mydomain.co.in is tappable.

How can I make complete link tappable on WhatsApp?

I can generate short link but problem is when there is no any Internet connection then short link cannot be obtained hence as a fallback mechanism I am allowing user to share the complete link.

In case if there is no any solution for the first query then is there any alternative solution to implement intended fallback mechanism?

Devarshi
  • 16,440
  • 13
  • 72
  • 125

1 Answers1

2

The link you posted seems correct. As a verification try to append &d=1 to the link. You will go to the debug page for this link. If this page do not have errors, the link should work correctly.

The issue you describing seems to be related to WhatsApp. To get more data, you can post this link to WatsApp iOS App. Interesting, is this behavior will be shown there as well. May want to reach out to WhatsApp/Facebook about this.

Another route you can consider: always use short link. I am wondering what is the use case, there is no Internet connection to shorten the long link, but there are value in sharing the long link? I feel that long link looks quite weird for end-users.

Oleksiy Ivanov
  • 2,454
  • 15
  • 21
  • Hey @Oleksiy thanks for your inputs. I agree with all your points. Regarding no internet when sharing - in the app user can get to user details screen when there is Internet but there are chances that when he is trying to share the details to other users Internet connection is lost, though there are very less chances of it have to handle it. – Devarshi Aug 14 '17 at 04:07
  • I tried to tap on the same link when shared through Gmail, it is working as expected, seems like I have to reach out to WhatsApp guys about it. I was thinking that perhaps I need some kind of encoding to make it working? – Devarshi Aug 14 '17 at 04:10
  • 1
    @Devarshi Makes sense. About link: I believe the link itself is correctly formatted. There is no way to encode long link in different way. You can consider generating short link before navigating to sharing screen if possible. Another thing to keep in mind: what is probability that short link failed to generate and user shared long link to WhatsApp? Maybe impact of this bug not that large. – Oleksiy Ivanov Aug 14 '17 at 06:48