[FREE] πŸ’° In App Billing V7.0.0 - Integrate In App Purchases In Your Apps

In App Billing extension developed by Akshat Developer. Using this extension you can sell digital in-app products and subscriptions in your app.

InAppBilling

In App Billing extension developed by Akshat Developer. Using this extension you can sell digital in-app products and subscriptions in your app.

Methods:

StartConnection

7068d482e2a09394202017a92125a65847bae3f7_2_345x37

Starts up BillingClient setup process asynchronously.


EndConnection


Ends the connection with billing client


IsReady


Checks if the client is currently connected to the service, so that requests to other methods will succeed.

Return Type: boolean


IsSubscriptionSupported


Returns if subscription feature is supported or not.

Return Type: boolean


GetProduct


Performs a network query of the details of products available for sale in your app.

Parameter Type
productId text

GetSubscription


Performs a network query of the details of subscription available for sale in your app.

Parameter Type
subscriptionId text

LaunchProductPurchase


Initiates the billing flow for an in-app product purchase.

Parameter Type
productDetails any

LaunchSubscriptionPurchase


Launches the billing-flow for an in-app subscription purchase.

Parameter Type
subscriptionDetails any
offerToken text

ConsumePurchase


Used to consume a purchase

Parameter Type
purchaseToken text

GetPurchaseDetails


Retrieves the purchase details.

Parameter Type
purchase any

QueryPurchases


Returns purchases details for currently owned items bought within your app.

Parameter Type
productType text

QueryPurchasesHistory


Returns purchases history details.

Parameter Type
productType text

GetPurchaseJSON


Returns the JSON format details the purchase.

Parameter Type
purchase any

Return Type: dictionary


IsPurchased


Returns if the given product is purchased or not.

Parameter Type
productId text
purchasesList list

Return Type: boolean


GetPurchaseHistoryRecordJSON


Returns the JSON format record of purchases history from the given purchase record.

Parameter Type
purchaseRecord any

Return Type: dictionary


IsPurchaseAcknowledged


Returns if the given purchase is acknowledged or not.

Parameter Type
purchase any

Return Type: boolean


AcknowledgePurchase


Used to acknowledge a purchase

Parameter Type
purchaseToken text

Events:

Error

Parameter Type
message text

InAppMessageResponse


Called when response from In App Message is detected.

Parameter Type
responseCode number
purchaseToken text

ConnectionSuccessful


Called when connection is successful.


ConnectionFailed


Called when connection is failed.

Parameter Type
message text

ConnectionDisconnected


Called when connection is disconnected.


GotProduct


Called when the product has been successfully retrived by GetProduct method.

Parameter Type
productId text
title text
name text
description text
price text
productDetails any

FailedToGetProduct


Called when the product failed to retrieve by GetProduct method.

Parameter Type
message text

GotSubscription


Called when subscription details is successfully retrived.

Parameter Type
subscriptionId text
subscriptionName text
title text
description text
priceList list
offerTokenList list
offerIdList list
basePlanIdList list
subscriptionDetails any

FailedToGetSubscription


Called when subscription details is failed to get.

Parameter Type
message text

ProductPurchaseLaunched


Called when purchase is successfully launched.


ProductPurchaseFailedToLaunch


Called when purchase failed to launch.

Parameter Type
response text

SubscriptionPurchaseLaunched


Called when purchase is successfully launched.


SubscriptionPurchaseFailedToLaunch


Called when purchase failed to launch.

Parameter Type
response text

ProductConsumedSuccessfully


Called when purchase is consumed successfully

Parameter Type
purchaseToken text

ProductConsumeFailed


Called when the purchase failed to consume

Parameter Type
message text
purchaseToken text

PurchaseSuccessful


Called when purchase is successful.

Parameter Type
purchaseInstance any
purchaseToken text

PurchaseFailed


Called when purchase is failed due to any reason.

Parameter Type
response text

PurchaseCancelled


Called when purchase is cancelled.

Parameter Type
response text

GotPurchaseDetails


Called when purchase details have been retrived successfully

Parameter Type
purchaseState number
purchaseToken text
responseJSON text
orderId text
products list
purchaseTime number
quantity number
signature text

QueryPurchasesSuccess


Called when query purchases is successful

Parameter Type
purchasesList list
response text

QueryPurchasesFailed


Called when purchase query failed due to some reason

Parameter Type
response text

QueryPurchaseHistorySuccess


Called when query purchases history is successful

Parameter Type
purchasesList list
response text

QueryPurchaseHistoryFailed


Called when purchase history query failed due to some reason

Parameter Type
response text

AcknowledgeSuccessful


Called when acknowledge successful

Parameter Type
purchaseToken text

AcknowledgeFailed


Called when the purchase is failed to acknowledge

Parameter Type
response text
purchaseToken text

Properties:

TestMode


Sets if test mode is enabled or not.


ShowInAppMessages

Overlays billing related messages on top of the calling app.


ProductTypeInApp


Product Type InApp


ProductTypeSubscription


Product Type Subscription


This documentation was generated using Akshat Developer's Documentation Generator.

Usage

65dee6e4b148a8101dd78aaf441e0beee18715fb_2_588x500

Changelogs

πŸ†• V2 (SDK 7.0.0) (23 May 2024)

Major Update

--> Added support for subscription
--> Changed usage
--> Divided subscription and product purchase usage
--> Reduced extension size from 1.6MB to 300KB

V7.0.0 (23 May 2024)

Extension Released.

Video Tutorial

Download

Liked My Work?

Support me on:

https://ko-fi.com/akshatdeveloper

8 Likes

Thank you for your contribution, please correct the block isReady -> IsReady.

1 Like

Awesome job ! :+1:

2 Likes

Awesome workπŸ‘Œ
Uploading tutorial videos will be appreciated :+1:

Good work man :upside_down_face::slightly_smiling_face::+1:

1 Like

Major Update

--> Added support for subscription
--> Changed usage
--> Divided subscription and product purchase usage
--> Reduced extension size from 1.6MB to 300KB

See main post:-

3 Likes

Great extension.

I am trying to purchase a test product, I have enabled the test mode however I am getting error "product list is empty".

Is it possible to test in test mode without adding product in Play Console?

1 Like

You can test with the test product id only.

android.test.purchased
1 Like

This is not working for me. I also added product id in play console and activated it. Always getting product list is empty error with both purchase and subscription.

Same issue with test mode also.

I used same blocks as described in setup video. Tested in Apk.

Have you uploaded the aab file to the Play Store at least once and installed apk from there?

1 Like

I have uploaded the AAB file in closed testing, but tested in apk generated from builder. Without publishing the app how can I download it from Play Store?

You can test the apk without publishing it into console with test product id. Show us your relevant blocks, so we might guide you better.

1 Like

It worked by uploading the AAB in internal testing and downloaded the Apk from test link provided in internal testing.

Thanks.

1 Like

Hi, I have been using your extension and the purchase working but I am trying to verify the purchase using below blocks, however its not working. Tested in a published app on play store.

I also tried below approach but the GotPurchaseDetails block never raised.

I have not used acknowledge purchase block is that the reason which avoiding the purchase to be registered as purchased?

I have also not used consume purchase block which will again ask the user to purchase.

Ideally, this should work. Make sure to double-check the product ID you are giving.

Secondly, you can use QueryPurchasesFailed block to check if there is any error

1 Like

This is working but the problem is we must acknowledge the purchase to confirm that the user has been awarded with the in app purchased item, if not done within 3 days of the purchase then the purchase will be automatically refunded to the user due to unacknowledged purchase as per Android in app billing documentation.

In my case it was refunded and it was giving results as not purchased.

1 Like

After user purchased, have you used this block to Acknowledge instantly

Yes after purchase successful use acknowledge purchase block.

1 Like

@AkshatRana could take a look into it and provide an update.

I use paid extension from @JEWEL which I Acknowledge after purchase and it works fine for me.

1 Like