I am working an app that has In app purchase function. And i need some unique user information when they make some purchases in order to store it on my Database for some reason.
So how can i get some info like email,username or userId from the purchased user?
Thanks!
How to track Android in-app purchases automatically from Google Play. For Android apps that use in-app billing, you can automatically track when someone who clicked your ad makes an in-app purchase. You don't need to add code to your app. The value of the purchase will automatically be reported as the conversion value.
Find and download apps purchased by you or family members or your profile picture at the top right, then tap Purchased. If you set up Family Sharing, tap My Purchases or choose a family member to view their purchases. Note: You can see purchases made by family members only if they choose to share their purchases.
You cannot obtain this information from the Apple purchase flow, so the answer depends on what you are trying to accomplish.
If you are selling a non-consumable item, such as a game unlock, Deepak's solution will work for you -- by providing a "restore" button in you application the user will be able to connect to their iTunes account from any of their devices and re-obtain the item.
If you are selling a consumable item, such as in-game currency, you should have the users register with your backend service and be authenticated when they make their purchase. Once you have verified the purchase you can write it to your database and you will be responsible for restoring their state regardless of the device they log in on.
Note that if you combine these approaches it would be possible, though unlikely, that a user could share a non-consumable purchase by using the same iTunes account but different accounts on your system by performing a Apple restore action. If you are managing your own inventory on a server, I recommend using consumables.
So the short answer is, if you want that information, you have to ask for it from the user.
[Answer is valid if you have users registered with your system]The transactions can be restored based on user who has logged into your system ,please refer to link here then you can map the information from your system to the product you are selling via in-app purchase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With