mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +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:okhttp-tls:4.9.3'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor: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') {
|
implementation('io.socket:socket.io-client:2.0.0') {
|
||||||
exclude group: 'org.json', module: 'json'
|
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
|
* 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
|
* 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 {
|
clientMutex.withLock {
|
||||||
if (_billingClient == null) {
|
if (_billingClient == null) {
|
||||||
_billingClient = BillingClient.newBuilder(getApplication())
|
_billingClient = BillingClient.newBuilder(getApplication())
|
||||||
.enablePendingPurchases()
|
.enablePendingPurchases(
|
||||||
.setListener(purchaseUpdatedListener)
|
PendingPurchasesParams
|
||||||
.build()
|
.newBuilder()
|
||||||
|
.enableOneTimeProducts()
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
.setListener(purchaseUpdatedListener)
|
||||||
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
val initBillingClient = _billingClient!!
|
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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -42,7 +42,7 @@ object BillingClient {
|
||||||
enum class ProductType { INAPP }
|
enum class ProductType { INAPP }
|
||||||
|
|
||||||
object Builder {
|
object Builder {
|
||||||
fun enablePendingPurchases() = this
|
fun enablePendingPurchases(params: PendingPurchasesParams) = this
|
||||||
fun setListener(listener: PurchasesUpdatedListener) = this
|
fun setListener(listener: PurchasesUpdatedListener) = this
|
||||||
fun build() = BillingClient
|
fun build() = BillingClient
|
||||||
}
|
}
|
||||||
|
@ -144,3 +144,12 @@ object QueryPurchasesParams {
|
||||||
fun setProductType(type: BillingClient.ProductType) = this
|
fun setProductType(type: BillingClient.ProductType) = this
|
||||||
fun build() = 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