I have installed the telegram app and just want to send a message (string) from my app through telegram to a contact.
All I found yet is in the question: How to send a Intent with telegram
with the code:
//Sending message
void intentMessageTelegram(String msg)
{
final String appName = "org.telegram.messenger";
final boolean isAppInstalled = isAppAvailable(this.getApplicationContext(), appName);
if (isAppInstalled)
{
Intent myIntent = new Intent(Intent.ACTION_SEND);
myIntent.setType("text/plain");
myIntent.setPackage(appName);
myIntent.putExtra(Intent.EXTRA_TEXT, msg);//
this.startActivity(Intent.createChooser(myIntent, "Kevin"));
}
else
{
Toast.makeText(this, "Telegram not Installed", Toast.LENGTH_SHORT).show();
}
}
when I use that the telegram opens a contact list. But choosing multiple contacts, It is not sending it to them. If I click on one of them the message will be sent.
How can I send a message without displaying the telegram? Is there a way to read messages too?
Thanks in advance^^