Android Question I am very confused with In-App Billing

welu1805

Active Member
Licensed User
Longtime User
Hi all,

sorry, but I am very very confused with in-app billing. I have an app in Play Store with In-App Billing like described in Erels "Android In-App Billing v3 Tutorial". The app starts at first in demo mode with some restrictions. After purchase via In-App Billing the app will be unlocked with no further restrictions. I had 2 test purchases by myself with 2 different Google accounts. It worked fine, even if I installed the app on 4 different devices.

Now 2 tablets were broken and yesterday I got the first back from the shop where I bought it. But my app is still locked with both accounts.

I test the OwnedProducts in B4A with this code:

B4X:
Sub manager_OwnedProducts (Success As Boolean,  purchases As Map)
   If Success Then
     Log(purchases)
     For Each p As Purchase In purchases.Values
.
.
.

But the map "purchases" ist empty for both acounts. It's the same if I install the app from Play Store or over B4A-Bridge. If I deinstall and reinstall on another tablet, it works with both accounts. That makes me stupid!

How can I retrieve the account which is logged in from B4A?

Has anyone an idea? Did I forgot some settings on the new tablet?


Thanks for all help
Lutz

 

welu1805

Active Member
Licensed User
Longtime User
Yes, I purchased in Alpha test. Now I installed the app from Play Store. With the NEW tablet and the accounts from Alpha test with GetOwnedProducts I get NO purchases.

On an OLD tablet (I used in Alpha test for purchasing) I deistalled my app in Play Store and reinstalled it from Play Store with the the accounts from Alpha test - with GetOwnedProducts I get ONE purchase.

Does GetOwnedProducts not only depend from logged account rather from device?
 
Upvote 0

welu1805

Active Member
Licensed User
Longtime User
If GetOwnedProducts definitvly does NOT append from the device, there MUST be on all devices the same response in GetOwnedProducts (for the SAME logged account).

Perhaps it is NOT exactly the same account. To exclude this, I would like to retrieve the current account in my app and show it in a MsgBox. How can I retrieve it?
 
Upvote 0

welu1805

Active Member
Licensed User
Longtime User
You are right. I created a new Google account and purchased my app on the old tablet.
With the new tablet and the same account I installed from Play Store. GetOwnedProducts gives me the in-app product so I can unlock it.
Thanks.
 
Upvote 0

welu1805

Active Member
Licensed User
Longtime User
Erel, perhaps you could add this tip to your tutorial to prevent other users to make the same error.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…