Android Question Price from in-app purchase

aaronk

Well-Known Member
Licensed User
Longtime User
Have you tried it with a different phone with a different account?
I had been using my Nexus 5X with my developer account.

I just tried on my Nexus 5 with a different Gmail account and still the same result

Are you able to create a small demo app and PM it to me so I can check and confirm it's working on my devices since I can't seem to get it working ?
 
Last edited:
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
Does it work?
Yes, it lets me purchase the item.

Now when I call GetOwnedProducts it returns the details etc.

** Manager_OwnedProducts triggered **
getSku = testing
getPrice = $0.99
getTitle = Testing (Test App)
getDescription = testing

However I want to get those details before the user places the order.

Looking at this page (https://developer.android.com/training/in-app-billing/list-iab-products.html) it looks like you need to list the SKU we want to get the values for ?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are correct. It wasn't implemented properly.

I've sent you a beta version (v1.30). Please try it.
You need to call it like this:
B4X:
manager.GetInventoryInformation(Array(<products ids here>))

Sub Manager_InventoryCompleted (Success As Boolean, Products As List)
If Success Then
   For Each sk As SkuDetails In Products
    Log(sk)
   Next
End If
End Sub
 
Last edited:
Upvote 0

Misterbates

Active Member
Licensed User
You are correct. It wasn't implemented properly.
I've sent you a beta version (v1.30). Please try it.

I'd be interested in the beta version too. I'm just at the point of implementing billing and was going to build the products list in my app, but would much prefer to pull description/price etc. from Google Play.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
You are correct.
Of course

I've sent you a beta version (v1.30).
When I run it with that code as above, it displays an error in the log:

 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
Now it shows nothing in the log.

I have sent you my demo app which also includes my API key so it should connect to my Google Play account and you can check and confirm if you are getting the same result.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
Fix it and it will work
That fixed it. I missed that typo as well.

One other thing, since I have already purchased the item, if I request it again it shows:

Unable to buy item (response: 7:Item Already Owned)
PurchaseCompleted = false

I know PurchaseCompleted = false is from the manager_PurchaseCompleted event, but what about the other line.

Where does that come from? Is there an event which this goes too ?

I know I need to run Manager.ConsumeProduct after the purchase has been made if I want to re-use it again, but is there a way to capture that response 7 items already owned, in an event ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…