Skip to content

Commit

Permalink
-billing lib updated to 7.0.0
Browse files Browse the repository at this point in the history
-Issues Solved
  • Loading branch information
hannanshahidfunsoltech committed Jun 13, 2024
1 parent d2866ae commit 67730d5
Show file tree
Hide file tree
Showing 9 changed files with 367 additions and 349 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

[![](https://jitpack.io/v/Funsol-Projects/Funsol-Billing-Helper.svg)](https://jitpack.io/#Funsol-Projects/Funsol-Billing-Helper)

Funsol Billing Helper is a simple, straight-forward implementation of the Android v6.0 In-app billing API
Funsol Billing Helper is a simple, straight-forward implementation of the Android v7.0 In-app billing API

> Support both IN-App and Subscriptions.
### **Billing v6 subscription model:**
### **Billing v7 subscription model:**

![Subcription](https://user-images.githubusercontent.com/106656179/227849820-8b9e8566-fa6e-40d4-862e-77aaeaa65e6c.png)

Expand Down Expand Up @@ -37,7 +37,7 @@ Add Funsol Billing Helper dependencies in App level build.gradle.
```kotlin

dependencies {
implementation 'com.github.Funsol-Projects:Funsol-Billing-Helper:v1.0.4'
implementation 'com.github.Funsol-Projects:Funsol-Billing-Helper:v1.0.5'
}

```
Expand Down Expand Up @@ -82,13 +82,17 @@ Call this in first stable activity or in App class
.setInAppKeys(mutableListOf("In-App Key"))
.enableLogging()
.setBillingClientListener(object : BillingClientListener {
override fun onClientReady() {
Log.i("billing", "onClientReady: ")
}
override fun onPurchasesUpdated() {
Log.i("billing", "onPurchasesUpdated: called when user latest premium status fetched ")
}

override fun onClientInitError() {
Log.i("billing", "onClientInitError: ")
}
override fun onClientReady() {
Log.i("billing", "onClientReady: Called when client ready after fetch products details and active product against user")
}

override fun onClientInitError() {
Log.i("billing", "onClientInitError: Called when client fail to init")
}

})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
FunSolBillingHelper(this).setInAppKeys(mutableListOf("android.test.purchase")).setSubKeys(mutableListOf("basic")).enableLogging(true)
FunSolBillingHelper(this).setInAppKeys(mutableListOf("android.test.purchase")).setSubKeys(mutableListOf("basic")).enableLogging(false)
.setBillingClientListener(object : BillingClientListener {
override fun onPurchasesUpdated() {
Log.i("billing", "onPurchasesUpdated: called when user latest premium status fetched ")
}

override fun onClientReady() {
Log.i("billing", "onClientReady: ")
Log.i("billing", "onClientReady: Called when client ready after fetch products details and active product against user")
}

override fun onClientInitError() {
Log.i("billing", "onClientInitError: ")
Log.i("billing", "onClientInitError: Called when client fail to init")
}

})
Expand Down
7 changes: 4 additions & 3 deletions funsol-billing-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
namespace 'com.funsol.iap.billing'
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.android.billingclient:billing:6.0.1'
implementation 'com.android.billingclient:billing:7.0.0'
}

afterEvaluate {
Expand All @@ -49,13 +50,13 @@ afterEvaluate {
from components.release
groupId = 'com.github.Funsol-Projects'
artifactId = 'Funsol-Billing-Helper'
version = 'v1.0.4'
version = 'v1.0.5'
}
debug(MavenPublication) {
from components.debug
groupId = 'com.github.Funsol-Projects'
artifactId = 'Funsol-Billing-Helper'
version = 'v1.0.4'
version = 'v1.0.5'
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions funsol-billing-utils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.funsol.iap.billing">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.funsol.iap.billing

import com.android.billingclient.api.Purchase
import com.funsol.iap.billing.model.ErrorType

interface BillingClientListener {
fun onPurchasesUpdated()
fun onClientReady()
fun onClientAllReadyConnected(){}
fun onClientInitError()
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ interface BillingEventListener {
fun onPurchaseAcknowledged(purchase: Purchase)
fun onPurchaseConsumed(purchase: Purchase)
fun onBillingError(error: ErrorType)

}
Loading

0 comments on commit 67730d5

Please sign in to comment.