How to share programmatically a message with a hyperlink from my Android app to Telegram without using bots?

Viewed 256

I want to get something like this:

Download my app here

...but in a Telegram message when the user clicks a button in my Android app. Note the link in the word here.

I have the following code inside the button's onClickListener callback:

String msg = "Download my app <a href=\"https://play.google.com/store/apps/details?id=my.id.app.packagename\">here</a>";
Intent myIntent = new Intent(Intent.ACTION_SEND);
myIntent.setType("text/plain");
myIntent.putExtra(Intent.EXTRA_TEXT, msg);
startActivity(Intent.createChooser(myIntent, "Share with"));

However, the above code does not create a clikable link on the word here, instead it explicitly shows what I have in the msg variable.

I tried with HTML:

<a href="https://example.com">This is an example</a>

...and with markdown:

[This is an example](https://example.com)

Both cases don't work for my.

How to share programmatically a message with a hyperlink from my Android app to Telegram without using bots?

Please, note in my question that I don't want to use Telegram bots, like:

https://api.telegram.org/bot<BOT_TOKEN>/sendMessage?text=%3Ca+href%3D%27url.com%27%3Eword%3C%2Fa%3E&chat_id=<chat_id>&parse_mode=HTML
0 Answers
Related