Skip to content

Commit

Permalink
Merge pull request #12874 from woocommerce/12793-receipt-is-not-attac…
Browse files Browse the repository at this point in the history
…hed-to-text-message

[Fix] Receipt is not attached to text message
  • Loading branch information
AnirudhBhat authored Nov 7, 2024
2 parents 0a86101 + d56cae4 commit 55a383d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
21.1
-----

- [*] Receipts can be shared via a google's sms application now [https://github.com/woocommerce/woocommerce-android/pull/12874]

21.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PaymentReceiptShare @Inject constructor(
selectedSite.get().name.orEmpty()
)
val intent = Intent(Intent.ACTION_SEND).apply {
type = "application/*"
type = "text/plain"
putExtra(Intent.EXTRA_STREAM, uri)
putExtra(Intent.EXTRA_TEXT, text)
}
Expand All @@ -61,11 +61,11 @@ class PaymentReceiptShare @Inject constructor(
}

sealed class ReceiptShareResult {
object Success : ReceiptShareResult()
data object Success : ReceiptShareResult()
sealed class Error : ReceiptShareResult() {
data class Sharing(val exception: Exception) : Error()
object FileCreation : Error()
object FileDownload : Error()
data object FileCreation : Error()
data object FileDownload : Error()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class FileDownloader @Inject constructor(
*
* @return true if the download succeeded and false otherwise
*/
@Suppress("BlockingMethodInNonBlockingContext")
suspend fun downloadFile(url: String, destinationFile: File): Boolean {
return try {
if (destinationFile.exists()) destinationFile.delete()
Expand Down

0 comments on commit 55a383d

Please sign in to comment.