SuddenH4X / awesome-app-rating

An Android library providing a dialog, which asks the user to rate the app or give feedback. You can also use the library to show the Google in-app review easily under certain conditions.
Apache License 2.0
231 stars 40 forks source link

Subject and text does not work #7

Closed vivchar closed 4 years ago

vivchar commented 4 years ago

Hi

I try to use your library, but when I try to send mail feedback the subject and the text didn't populate.

It happens when I select the Gmail app, when I select the Email App it works fine

image

SuddenH4X commented 4 years ago

Hi,

thanks for reporting this. I will look into the issue later this week.

SuddenH4X commented 4 years ago

Hi @vivchar,

I can reproduce your issue. The Gmail app seems to have changed its implementation recently while other mail apps are still working. I will fix the issue in my next big release (2.0.0).

Meanwhile you can simply overwrite the click listener of the mail feedback button with the following line: .setMailFeedbackButton(mailFeedbackButtonTextId: Int, mailFeedbackButtonClickListener: RateDialogClickListener)

The click listener should then use a working implementation. This one seems to work correctly:

val mailIntent: Intent = Intent(Intent.ACTION_SENDTO).apply {
            data = Uri.parse("mailto:")
            putExtra(Intent.EXTRA_EMAIL, arrayOf("test@example.com"))
            putExtra(Intent.EXTRA_SUBJECT, "subject")
            putExtra(Intent.EXTRA_TEXT, "body")
        }

        if (mailIntent.resolveActivity(packageManager) != null) {
            startActivity(mailIntent)
        } else {
            // no mail app installed
        }