I want to have a share intent where it sends the message "here" and when the user clicks on the message, it takes them to my app in the google play store. Currently I'm not getting any text at all in the message
val shareMessage = SpannableString("Here")
shareMessage.setSpan(URLSpan("https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
val sendIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, shareMessage)
type = "text/plain"
}
val shareIntent = Intent.createChooser(sendIntent, null)
if (shareIntent.resolveActivity(context.packageManager) != null) {
context.startActivity(shareIntent)
}