Skip to content

FeedbackManager#

Open in GitHub

Latest Release Last Update License

Stars Forks

This is a very small library that allows you to send feedback from an app without internet permission via email, either directly or via an unintrusive notification.

Features#

  • send feedback mail via a single function
  • show a feedback notification via a single function
  • no internet permission needed - everything is done via a shared Intent which then can by handled by an installed email app
  • minimal size - only a few functions inside 2 classes

🔗 Dependencies#

Dependency Version
CacheFileProvider 0.3.1

Setup Gradle#

This library is distributed via JitPack.io.

1/2: Add jitpack to your project's build.gradle
repositories {
    maven { url "https://jitpack.io" }
}
2/2: Add dependencies to your module's build.gradle
// use the latest version of the library
val feedbackmanager = "<LATEST-VERSION>" 

// add library dependency
implementation("com.github.MFlisar:FeedbackManager:$feedbackmanager")

⌨ Usage#

It works as simple as following:

val feedback = Feedback(
    receivers = listOf("some.email@gmail.com"),
    subject = "Subject of mail",
    text = "Some text",
    textIsHtml = false, // indicates if text is holding html text or plain texz
    attachments = listOf(
        FeedbackFile(uri),
        FeedbackFile(file)
    )
)
feedback.startEmailChooser(context, titleForChooser)

Advanced Usage#

Create an Intent for later
val feedback = Feedback(...)
val intent = feedback.buildIntent(
    context = context,
    chooserTitle = "Title of the Email Chooser"
)
Show a notification

This allows you to show a notification which will start the email chooser if the user clicks on the notification only.

val feedback = Feedback(...)
feedback.startNotification(
    context = context,
    chooserTitle = "Title of the Email Chooser"
    notificationTitle = "Notification",
    notificationText = "Message",
    notificationIcon = R.mipmap.icon,
    notificationChannel = "ChannelName",
    notificationId = 1234 /* channel id */
)