I'm starting to create an APP where I can buy items from it.
Could be like this:
where you can see an Image, Name of product, and Price. Well, I allready have a Sign-in with Google made with Authentication Firebase and I store it on Firebase database, I'd like to create the following this structure that @Alex Mamo recommend to me :
Firebase-root
|
--- users
| |
| --- uid1
| |
| --- //user details (name, age, address, email and so on)
| |
| --- products
| |
| --- productId1 : true
| |
| --- productId2 : true
|
--- products
| |
| --- productId1
| | |
| | --- productName: "Apples"
| | |
| | --- price: 11
| |
| |
| --- users
| |
| --- uid1: true
| |
| --- uid2: true
|
--- purchasedProducts
| |
| --- uid1
| |
| --- productId1: true
| |
| --- productId2: true
|
--- paidProducts
| |
| --- uid2
| |
| --- productId3: true
|
--- availableProducts
| |
| --- uid3
| |
| --- productId4: true
Looks fine to make an easy app like mine. Because the scenario is as easy as :
- User loggs in the APP
- User see the free products and can buy some products
- User can see that products that has allready paid for them
From start I store the uid inside the users.
What I do not know is;
- Do I have to create the same products on
Google Play ConsoletoFirebase database? I've already created 1 product to test it onGoogle Play Console, I have to create the product as well on my app (I mean onFirebase database)?
To implement in-app billing I'm following this tutorial but I've found this android-inapp-billing-v3 library and looks good though.
If there is any of you that has worked with in-app-purchased and has created items and know how to get them from Google Play Console please feel free to share a demo of how to.
EDIT
I allready got how to purchase items I ended up using this Library, the thing is that on my Login page I have the db create of firebase I mean there I put the id of user and email... Do I have to add all the products there aswell?