In my app i have a "Share App Link" button which when clicked shares app play store link in Social Media Apps (WhatsApp, Instagram, Twitter) using Intent.ACTION_SEND and gives user a prize for this action. But I can't confirm if user successfully shared the link in the Social Media Apps because Intent.ACTION_SEND doesn't have any return. What can i do about this situation ? I am also open to other ideas then confirmation or usage of another intent filter.
My code for this is:
fun shareAppLink(view: View){
val shareIntent = Intent(Intent.ACTION_SEND)
shareIntent.type = "text/plain"
shareIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name))
var shareMessage = "\nLet me recommend you this application\n\n"
shareMessage = """${shareMessage}https://play.google.com/store/app/details?id=${this.packageName}""".trimIndent()
shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage)
var whiteList=mutableListOf("com.whatsapp","com.instagram.android","com.twitter.android")
startActivity(CustomChooserIntent.create(packageManager,shareIntent,"",whiteList))
CustomChooserIntent uses a whitelist to allow which apps can be chosen.