question

krislipscombe@gmail.com avatar image
krislipscombe@gmail.com asked

Handling Non-Consumables on Google Play

Hi,

We've been working on the Android port of our title recently, and am now looking at restoring Non Consumable purchases with Google Play, whether it's on the same PlayFab account or not. You have given a good example in the past for iOS, but obviously purchase restore works rather differently on Google Play, with the system notifying the app about non-consumed purchases. We're using Unity IAP which gives us this information on launch, and we reprocess the receipts fine, but then get the Receipt Already Used error.

For now I've put in a fix which simply locally unlocks the item if we get the ReceiptAlreadyUsed error code for a product which has an ID that matches a non-consumable, but I was wondering if there are any best practices that I'm missing in this instance? My current solution feels somewhat hacky.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The problem is that Google does not provide a restore-type receipt. That's the system that iTunes provides, to let you request a fresh receipt for all purchases made by the player. We track on all receipt usage and only allow any given receipt to be used once, to prevent players from purchasing something that they then can get over and over again for free (a "replay" attack, basically), or sharing the receipt with others, so that many people can get the item(s) for free. That latter scenario would be very likely to occur for any game with a non-trivial number of players, if we weren't checking whether the receipt was already used.

The best thing to do is to provide the player with a way to get back to their account. Using a secondary login system, like Facebook, Google, or Twitch, means that players will be able to recover their accounts even if they have to replace their device.

But because Google doesn't provide something like the restore receipt, there isn't a secure way to automate replacement of items purchased from a different device. The best thing to do for users who have replaced their device and have no other way to get back to their account would be to make sure your players have a way to contact you, to get help with their accounts.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.