mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 17:59:51 +02:00
Update Google Play Billing Library
This commit is contained in:
parent
3d49bd8229
commit
4498aa191f
3 changed files with 21 additions and 7 deletions
|
@ -218,7 +218,7 @@ dependencies {
|
|||
implementation 'com.squareup.okhttp3:okhttp-tls:4.9.3'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
|
||||
|
||||
googleApiImplementation "com.android.billingclient:billing-ktx:7.1.1"
|
||||
googleApiImplementation "com.android.billingclient:billing-ktx:8.0.0"
|
||||
|
||||
implementation('io.socket:socket.io-client:2.0.0') {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* TimeLimit Copyright <C> 2019 - 2023 Jonas Lochmann
|
||||
* TimeLimit Copyright <C> 2019 - 2025 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -74,9 +74,14 @@ class ActivityPurchaseModel(application: Application): AndroidViewModel(applicat
|
|||
clientMutex.withLock {
|
||||
if (_billingClient == null) {
|
||||
_billingClient = BillingClient.newBuilder(getApplication())
|
||||
.enablePendingPurchases()
|
||||
.setListener(purchaseUpdatedListener)
|
||||
.build()
|
||||
.enablePendingPurchases(
|
||||
PendingPurchasesParams
|
||||
.newBuilder()
|
||||
.enableOneTimeProducts()
|
||||
.build()
|
||||
)
|
||||
.setListener(purchaseUpdatedListener)
|
||||
.build()
|
||||
}
|
||||
|
||||
val initBillingClient = _billingClient!!
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* TimeLimit Copyright <C> 2019 - 2022 Jonas Lochmann
|
||||
* TimeLimit Copyright <C> 2019 - 2025 Jonas Lochmann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -42,7 +42,7 @@ object BillingClient {
|
|||
enum class ProductType { INAPP }
|
||||
|
||||
object Builder {
|
||||
fun enablePendingPurchases() = this
|
||||
fun enablePendingPurchases(params: PendingPurchasesParams) = this
|
||||
fun setListener(listener: PurchasesUpdatedListener) = this
|
||||
fun build() = BillingClient
|
||||
}
|
||||
|
@ -143,4 +143,13 @@ object QueryPurchasesParams {
|
|||
fun newBuilder() = this
|
||||
fun setProductType(type: BillingClient.ProductType) = this
|
||||
fun build() = this
|
||||
}
|
||||
|
||||
object PendingPurchasesParams {
|
||||
object Builder {
|
||||
fun enableOneTimeProducts() = this
|
||||
fun build() = PendingPurchasesParams
|
||||
}
|
||||
|
||||
fun newBuilder() = Builder
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue