mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-04 18:29:27 +02:00
Catch exceptions during consuming purchases
This commit is contained in:
parent
b85f585d7e
commit
9d6289bbbc
1 changed files with 8 additions and 2 deletions
|
@ -165,9 +165,15 @@ class ActivityPurchaseModel(application: Application): AndroidViewModel(applicat
|
||||||
|
|
||||||
runAsync {
|
runAsync {
|
||||||
lock.withLock {
|
lock.withLock {
|
||||||
|
try {
|
||||||
Checkout.forApplication(billing).startAsync().use {
|
Checkout.forApplication(billing).startAsync().use {
|
||||||
it.requests.consumeAsync(purchase.token)
|
it.requests.consumeAsync(purchase.token)
|
||||||
}
|
}
|
||||||
|
} catch (ex: Exception) {
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
Log.w(LOG_TAG, "consumePurchaseAsync() failed", ex)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue