Android Question GooglePlayBilling: How do I set the sku ?

MitchBu

Well-Known Member
Licensed User
Longtime User

Erel

B4X founder
Staff member
Licensed User
Longtime User
No. The SKUs are in the array:

1595487402170.png
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
I have copied the code in Starter from the example project. It does display the purchase box, but I am stuck in Starter's Process_Globals:

B4X:
Sub Process_Globals
    Public billing As BillingClient
    Public AdsRemoved As Boolean
    Public const ADS_SDK_ID As String = "android.test.purchased"
    Public const BILLING_KEY As String = "3434ABCDEF..."
End Sub

I suppose "android.test.purchased" can be one of my paying apps, for instance "com.bujardet.checkprinter".

But where will I find the BILLING_KEY ? I went through the Google pages to no avail.

Any hint ? TIA
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
Thank you Erel.

I was puzzled for a while because the new Google Play console does not show Development Tools.

After clicking "Classic Google Play Console" at the bottom of the left hand column, I found it immediately.
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
Bonjour Toby.

Here are my constants in Process_Globals


B4X:
    '--- Billing ---
    Public billing As BillingClient
    Public AdsRemoved As Boolean
    Public const ADS_SDK_ID As String = "com.bujardet.checkprinterfreeunlock" '"android.test.purchased"
    Public const BILLING_KEY As String = "MIIBIjANBgkqhkiG9w.../..""   
    Public billing As BillingClient
    Public InAppSupported As Boolean

com.bujardet.checkprinterfreeunlock is the name of the app in In-app Products, in the Google Play interface.
Billing key, I followed Erel's instructions to find it in GP interface.

The app must be available in the store for that to work.

Try the example program.
 
Upvote 0

defillo

Member
Licensed User
Longtime User
Bonjour Toby.

Here are my constants in Process_Globals


B4X:
    '--- Billing ---
    Public billing As BillingClient
    Public AdsRemoved As Boolean
    Public const ADS_SDK_ID As String = "com.bujardet.checkprinterfreeunlock" '"android.test.purchased"
    Public const BILLING_KEY As String = "MIIBIjANBgkqhkiG9w.../..""  
    Public billing As BillingClient
    Public InAppSupported As Boolean

com.bujardet.checkprinterfreeunlock is the name of the app in In-app Products, in the Google Play interface.
Billing key, I followed Erel's instructions to find it in GP interface.

The app must be available in the store for that to work.

Try the example program.


Hello MitchBu

could you please be more exaustive?
in particular: "com.bujardet.checkprinterfreeunlock" : where did you get this? I suppose this is your app name? I mean, the name of the app in your app list in the console? or what else?
and more: "The app must be available in the store for that to work." this means that the app needs to be ready for download in the market?
Hope you should clarify better this. I'm stuck in the detailssize=0 :)

BR
defillo
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
Hi defillo,

The in-app product that will be purchased has to be set in your listing.

In my case, Check Printer Free can be unlocked buying com.bujardet.checkprinterfreeunlock. Once that app has been bough, Check Printer Free will be able to check for it at launch, and give access to all the premium features.

in-app.PNG


Once you have set this in-app product, it will be used to purchase within the app.

Since this particular app exists only within your listing, indeed you cannot try to purchase before the containing app is in the store. As you write "ready to download in the market".

You will get detailssize=0 until the app containing iAP is available in the Play Store.
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Hi defillo,

The in-app product that will be purchased has to be set in your listing.

In my case, Check Printer Free can be unlocked buying com.bujardet.checkprinterfreeunlock. Once that app has been bough, Check Printer Free will be able to check for it at launch, and give access to all the premium features.

View attachment 104113

Once you have set this in-app product, it will be used to purchase within the app.

Since this particular app exists only within your listing, indeed you cannot try to purchase before the containing app is in the store. As you write "ready to download in the market".

You will get detailssize=0 until the app containing iAP is available in the Play Store.

Bonjour Michel,

You just published your app, so you might be able to help me.

I'm doing the internal testing and I still get SkuDetails.Size=0. If that's the way it's supposed to be, how do I test the InApp products to make sure everything works before publishing?

Merci
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
This will persist until the app is in the store, at which time SKUDetail will have a size.

There is no way I know of to test in app purchase before publishing.
 
Last edited:
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime User
I should add that I have now two versions in the store : the complete version, and the free version with in app purchase. The free version is doing between 3 and 5 times more money than the paid for.

So, commercially, a free version with in app purchase makes a lot of commercial sense :)
 
Upvote 0
Top