I want to add in-app products that can be bought by either real money via Google Play Billing Library or via virtual coins earned inside the app. Where does this product classify: as Rewarded Products or Managed Products? How should I process this if user opts to buy it using the virtual coins?
-
1Do i understand right that you are selling virtual coins not items and only by using coins user can get items in the app? – Bo Z Jul 31 '19 at 13:53
-
I do not sell virtual coins. The "items" that can be bought may be purchased using "real money" or using "virtual points". "Virtual Points" are not sold, they are earned from app usage, not sold. These "virtual points" can be used to purchase "items" the same way "real money" can (This is up to the user whichever he wants to use: "real money" or "virtual points"). – aLL Aug 02 '19 at 05:18
-
Gave you explanation. Please let me know if you find it helpful – Bo Z Aug 02 '19 at 13:30
1 Answers
The solution is not in the library. Solution is in your code logic. Google play just process payment thats it nothing else the rest is your own logic. What is purchase as itself it unlocking your product after payment was success. After some trigger. So divide it in two parts - first is payment second is unlock the product for the user. They are separate from each other. The code will be something like this
if (purchase.success || numberOfPoints.enough){
unlockProduct};
Then you implement each of this flows separate. purchase
flow goes separate and include all validation and payments process just need to return success or failure in the end
The same with checking number of points. Point I guess need to be stored somewhere in database for each user and you just checking enough or not enough
And unlock process just executing two processes above and if one of them is true it enable the product

- 2,359
- 1
- 13
- 31
-
this is helpful for me. I somehow get the gist of your answer. thank you. I'll up-vote it, however, this is still a few more edits short to be the accepted answer – aLL Aug 03 '19 at 03:43