I've implemented the firebase email link login, after generating the mail I want to open the phone's email app, so the user can directly open the mail, which was sent.
fun startEmailApp(context: Context) {
val emailPackage = "com.google.android.gm"
val isGmailInstalled = isAppInstalled(context, emailPackage)
val intent = Intent(Intent.ACTION_SEND)
context.startActivity(Intent.createChooser(intent, "choose an email client"))
if (isGmailInstalled) {
intent.type = "text/html"
intent.setPackage(emailPackage)
context.startActivity(intent)
} else {
intent.type = "message/rfc822";
context.startActivity(Intent.createChooser(intent, "choose an email client"))
}
}
This implementation will open gmail, but in compose email screen. How do I manage to show the list of emails in the inbox instead?