Search code examples
hyperlinkxamarin.formsxamarin.androidwhatsappandroid-sharing

Share a hyperlink from Xamarin Forms application in Android apps(e.g. Whatsapp, Viber..)


I created a share option for Xamarin Forms app, using CrossShare class from Plugin.Share plugin, but when I share in Whatsapp, for example, I get the whole link like:

enter image description here

But what I really want is to have just text like on next picture without the whole link that will take me to the same location:

enter image description here

This is the code I used for sharing:

 CrossShare.Current.Share(new ShareMessage
        {
            Title = ApplicationConstants.ApplicationName,
            Text = "Nurnberg - Frankfurt 23.09.2017 00:00:00 7 €",
            Url = "http://www.checkmybus.com..."
        });

How can I do this?


Solution

  • This is not possible in the current version of the Whatsapp application. I asked the same question here and this is still not possible in the current API.

    "Each application has their own implementation to handle the shared messages. The best option will be to shorten the link (using bit.ly or goo.gl) to make it user-friendly."

    Hopefully, they will allow something like this soon.