Code: Select all
val body = """
----------start-----------------
Please don't remove this information
Info............
-----------end-----------------
"""
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:"))
intent.putExtra(
Intent.EXTRA_EMAIL,
arrayOf("abcd@gmail.com")
)
intent.putExtra(
Intent.EXTRA_SUBJECT,
"app-issue"
)
intent.putExtra(Intent.EXTRA_TEXT, body)
startActivity(LocalContext.current,intent,null)
< /code>
Aber im iOS -Teil habe ich solche gemacht, aber ich hatte keine vorliegende Methode in der iOS.kt -Datei. < /p>
if (MFMailComposeViewController.canSendMail()) {
val mail = MFMailComposeViewController()
mail.setToRecipients(listOf("abcd@gmail.com"))
mail.setSubject("app-issue")
val deviceInfo = """
----------start-----------------
Please don't remove this information
Info......
-----------end-----------------
"""
mail.setMessageBody(deviceInfo, isHTML = false)
} else {
// show failure alert
}