Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Android In-App Question regarding bought non-consumable product
Started by d.mach Jun 05 2019 10:11 PM

1 reply to this topic
iap android google non consumable product
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 918 posts
  • Corona SDK

I have some problems understanding the correct take on iaps on Android. For example:

 

A user has bought a non-consumable product he only can buy once.

Now he deletes the game and re-installs it again.

Now he clicks the buy button for the same product and nothing happens.

 

How can I check in the transactionListener that the user already has this product because just trying to purchase it again is just quitting the transaction?

 

Is it possible to right before doing a store.purchase(product) call directly do a store.restore() call? This would automatically unlock a purchased product when the user is clicking on the products button. Or is this causing problems for users who try to purchase the product but don't have bought it before?

 

One more thing:

What if a product was refunded? Do I have to consume a non-consumable to make it ready to buy again or is it automatically handled when a refund was made?



[TOPIC: post.html]
#2

happymongoose

[GLOBAL: userInfoPane.html]
happymongoose
  • Contributor

  • 356 posts
  • Corona SDK

On Android, it's recommended you do a store.restore() when the application starts up.  That way, you can remove the option to buy before the user even gets that far, so this situation never occurs.

 

Refunds: my solution is, before you do your store.restore() on initialisation, remove access to all non-consumable products.  The restore listener will prompt you to give access to the ones the user still has a right to anyway (so the refunded product gets removed)

 

Simon




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: iap, android, google, non, consumable, product