0
votes

I am using in-app purchase. To see if user has bought the product, we need to connect to the store:

var listing = await CurrentApp.LoadListingInformationAsync();

then check the value. But I don't want to ask store every time user runs the app, so is it OK to save the purchase after a successful purchase in local, and after that, just check whether the user bought the product or not (for durable products).

Will this way happen some unexpected scenarios?

2
the user could buy something with a different devicethumbmunkeys
store it in "boughtProducts.txt", so user can easily transfer it to his other devices. Or friends devices. Or make it available for public download. ^_^;Corak
But I think in-app products are available just for one device, isn't it?user2757047
You could store it in a local setting to get fast access to the value, but should load in background anyway. Maybe you could save the last time you checked this value and recheck not earlier than maybe a few hours.Matt

2 Answers

0
votes

As a general rule it's safe to save knowledge of a successful IAP purchase.

Whether the purchase is of a consumable or a durable will have an impact on how your app should behave based on knowledge of that purchase.

Purchases ("In App" or otherwise) are related to an account, not a device, so if the item that is being purchased would have an impact if the user logged in on multiple devices then you should consider this in your application logic.
Similarly, users of your app may get new devices (repairs, replacements, upgrades, etc.) and want to continue their experience of your app on their new device without losing anything. Again you should consider this in your application logic too.

-1
votes

If this is a windows store app, if I understood correctly, there's a windows service built into windows 8 and windows phone. The service refreshes the licenses every 6 hours or so, and when the purchase button is clicked. Once the license is synced to the machine, the API calls are to the local service. Thus calling often isn't an issue, as long as you're just checking to see if the license is active and whether or not the license is a trial one. Now if you're getting information on the values of the products etc., I believe those are requested from the store and thus doing those often may be an issue.