Hi I'm sharing file using intent. And work well, share to whatsapp too.
fun shareFile(fileList: List<File>) {
activity?.let {
val target = Intent(Intent.ACTION_SEND_MULTIPLE)
val uriList = fileList.map { file ->
FileProvider.getUriForFile(
it.baseContext, it.applicationContext?.packageName + ".provider", file)
}
target.putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(uriList))
target.type = "application/pdf"
target.flags = Intent.FLAG_ACTIVITY_NO_HISTORY
target.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
try {
startActivity(Intent.createChooser(target, ""))
} catch (e: ActivityNotFoundException) {
Crashlytics.logException(e)
}
}
}
But the problem if whatsapp with fingerprint on. Share file not work.
Any suggestion to share on this case?
Thank you