Skip to content

Commit

Permalink
Merge pull request #9 from GRBurst/fixTelegramNaming
Browse files Browse the repository at this point in the history
Fix naming in telegram intent in android
  • Loading branch information
ShekarMudaliyar committed Apr 11, 2020
2 parents 99ecd56 + e9144bb commit 377e612
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -170,14 +170,14 @@ class SocialSharePlugin(private val registrar: Registrar): MethodCallHandler {
}
}
else if(call.method == "shareTelegram"){
//shares content on WhatsApp
//shares content on Telegram
val content: String? = call.argument("content")
val whatsappIntent = Intent(Intent.ACTION_SEND)
whatsappIntent.type = "text/plain"
whatsappIntent.setPackage("org.telegram.messenger")
whatsappIntent.putExtra(Intent.EXTRA_TEXT, content)
val telegramIntent = Intent(Intent.ACTION_SEND)
telegramIntent.type = "text/plain"
telegramIntent.setPackage("org.telegram.messenger")
telegramIntent.putExtra(Intent.EXTRA_TEXT, content)
try {
registrar.activity().startActivity(whatsappIntent)
registrar.activity().startActivity(telegramIntent)
result.success("true")
} catch (ex: ActivityNotFoundException) {
result.success("false")
Expand Down

0 comments on commit 377e612

Please sign in to comment.